File Coverage

blib/lib/WebService/TypePad/Object/Video.pm
Criterion Covered Total %
statement 12 97 12.3
branch 0 34 0.0
condition n/a
subroutine 4 21 19.0
pod 17 17 100.0
total 33 169 19.5


line stmt bran cond sub pod time code
1             package WebService::TypePad::Object::Video;
2 1     1   1357 use strict;
  1         2  
  1         30  
3 1     1   5 use warnings;
  1         2  
  1         22  
4 1     1   5 use WebService::TypePad::Util::Coerce;
  1         2  
  1         28  
5 1     1   6 use base qw(WebService::TypePad::Object::Asset);
  1         3  
  1         1310  
6              
7             sub video_link {
8 0     0 1   my $self = shift;
9 0 0         if (@_) {
10 0           $self->{data}{videoLink} = WebService::TypePad::Util::Coerce::coerce_VideoLink_in($_[0]);
11 0           return $_[0];
12             }
13             else {
14 0           return WebService::TypePad::Util::Coerce::coerce_VideoLink_out($self->{data}{videoLink});
15             }
16             }
17              
18             sub preview_image_link {
19 0     0 1   my $self = shift;
20 0 0         if (@_) {
21 0           $self->{data}{previewImageLink} = WebService::TypePad::Util::Coerce::coerce_ImageLink_in($_[0]);
22 0           return $_[0];
23             }
24             else {
25 0           return WebService::TypePad::Util::Coerce::coerce_ImageLink_out($self->{data}{previewImageLink});
26             }
27             }
28              
29             sub id {
30 0     0 1   my $self = shift;
31 0 0         if (@_) {
32 0           $self->{data}{id} = WebService::TypePad::Util::Coerce::coerce_string_in($_[0]);
33 0           return $_[0];
34             }
35             else {
36 0           return $self->{data}{id};
37             }
38             }
39              
40             sub url_id {
41 0     0 1   my $self = shift;
42 0 0         if (@_) {
43 0           $self->{data}{urlId} = WebService::TypePad::Util::Coerce::coerce_string_in($_[0]);
44 0           return $_[0];
45             }
46             else {
47 0           return $self->{data}{urlId};
48             }
49             }
50              
51             sub permalink_url {
52 0     0 1   my $self = shift;
53 0 0         if (@_) {
54 0           $self->{data}{permalinkUrl} = WebService::TypePad::Util::Coerce::coerce_string_in($_[0]);
55 0           return $_[0];
56             }
57             else {
58 0           return $self->{data}{permalinkUrl};
59             }
60             }
61              
62             sub author {
63 0     0 1   my $self = shift;
64 0 0         if (@_) {
65 0           $self->{data}{author} = WebService::TypePad::Util::Coerce::coerce_User_in($_[0]);
66 0           return $_[0];
67             }
68             else {
69 0           return WebService::TypePad::Util::Coerce::coerce_User_out($self->{data}{author});
70             }
71             }
72              
73             sub published {
74 0     0 1   my $self = shift;
75 0 0         if (@_) {
76 0           $self->{data}{published} = WebService::TypePad::Util::Coerce::coerce_string_in($_[0]);
77 0           return $_[0];
78             }
79             else {
80 0           return $self->{data}{published};
81             }
82             }
83              
84             sub content {
85 0     0 1   my $self = shift;
86 0 0         if (@_) {
87 0           $self->{data}{content} = WebService::TypePad::Util::Coerce::coerce_string_in($_[0]);
88 0           return $_[0];
89             }
90             else {
91 0           return $self->{data}{content};
92             }
93             }
94              
95             sub text_format {
96 0     0 1   my $self = shift;
97 0 0         if (@_) {
98 0           $self->{data}{textFormat} = WebService::TypePad::Util::Coerce::coerce_string_in($_[0]);
99 0           return $_[0];
100             }
101             else {
102 0           return $self->{data}{textFormat};
103             }
104             }
105              
106             sub groups {
107 0     0 1   my $self = shift;
108 0 0         if (@_) {
109 0           $self->{data}{groups} = WebService::TypePad::Util::Coerce::coerce_array_in($_[0], \&WebService::TypePad::Util::Coerce::coerce_string_in);
110 0           return $_[0];
111             }
112             else {
113 0           return WebService::TypePad::Util::Coerce::coerce_array_out($self->{data}{groups});
114             }
115             }
116              
117             sub source {
118 0     0 1   my $self = shift;
119 0 0         if (@_) {
120 0           $self->{data}{source} = WebService::TypePad::Util::Coerce::coerce_AssetSource_in($_[0]);
121 0           return $_[0];
122             }
123             else {
124 0           return WebService::TypePad::Util::Coerce::coerce_AssetSource_out($self->{data}{source});
125             }
126             }
127              
128             sub links {
129 0     0 1   my $self = shift;
130 0 0         if (@_) {
131 0           $self->{data}{links} = WebService::TypePad::Util::Coerce::coerce_array_in($_[0], \&WebService::TypePad::Util::Coerce::coerce_LegacyHyperlink_in);
132 0           return $_[0];
133             }
134             else {
135 0           return WebService::TypePad::Util::Coerce::coerce_array_out($self->{data}{links}, \&WebService::TypePad::Util::Coerce::coerce_LegacyHyperlink_out);
136             }
137             }
138              
139             sub object_types {
140 0     0 1   my $self = shift;
141 0 0         if (@_) {
142 0           $self->{data}{objectTypes} = WebService::TypePad::Util::Coerce::coerce_set_in($_[0], \&WebService::TypePad::Util::Coerce::coerce_string_in);
143 0           return $_[0];
144             }
145             else {
146 0           return WebService::TypePad::Util::Coerce::coerce_set_out($self->{data}{objectTypes});
147             }
148             }
149              
150             sub is_favorite_for_current_user {
151 0     0 1   my $self = shift;
152 0 0         if (@_) {
153 0           $self->{data}{isFavoriteForCurrentUser} = WebService::TypePad::Util::Coerce::coerce_boolean_in($_[0]);
154 0           return $_[0];
155             }
156             else {
157 0           return WebService::TypePad::Util::Coerce::coerce_boolean_out($self->{data}{isFavoriteForCurrentUser});
158             }
159             }
160              
161             sub favorite_count {
162 0     0 1   my $self = shift;
163 0 0         if (@_) {
164 0           $self->{data}{favoriteCount} = WebService::TypePad::Util::Coerce::coerce_integer_in($_[0]);
165 0           return $_[0];
166             }
167             else {
168 0           return $self->{data}{favoriteCount};
169             }
170             }
171              
172             sub comment_count {
173 0     0 1   my $self = shift;
174 0 0         if (@_) {
175 0           $self->{data}{commentCount} = WebService::TypePad::Util::Coerce::coerce_integer_in($_[0]);
176 0           return $_[0];
177             }
178             else {
179 0           return $self->{data}{commentCount};
180             }
181             }
182              
183             sub allowed_methods {
184 0     0 1   my $self = shift;
185 0 0         if (@_) {
186 0           $self->{data}{allowedMethods} = WebService::TypePad::Util::Coerce::coerce_set_in($_[0], \&WebService::TypePad::Util::Coerce::coerce_string_in);
187 0           return $_[0];
188             }
189             else {
190 0           return WebService::TypePad::Util::Coerce::coerce_set_out($self->{data}{allowedMethods});
191             }
192             }
193              
194             1;
195              
196             =head1 NAME
197              
198             WebService::TypePad::Object::Video - Perl representation of TypePad's Video object type
199              
200             =head1 SYNOPSIS
201              
202             use WebService::TypePad::Object::Video;
203             my $video = WebService::TypePad::Object::Video->new();
204              
205             =head1 DESCRIPTION
206              
207             This is a Perl representation of TypePad's Video object type.
208             For more information about this type and its parameters, see L.
209              
210             This is a subtype of L.
211              
212             =head1 PROPERTIES
213              
214             Each of these properties has an accessor method which will retrieve the property's value when called with no arguments or set the property's value when called with one argument.
215              
216             =head2 $video->allowed_methods
217              
218             Set of strings containing the HTTP methods that the currently-authenticated client is allowed to apply to this asset.
219              
220             Returns a set of C values.
221              
222             =head2 $video->author
223              
224             The user that created the selected asset.
225              
226             Returns a single L object.
227              
228             =head2 $video->comment_count
229              
230             The number of comments that have been posted in the comment tree beneath this asset.
231              
232             Returns a single C value.
233              
234             =head2 $video->content
235              
236             The raw asset content. The C property defines what format this data is in.
237              
238             Returns a single C value.
239              
240             =head2 $video->favorite_count
241              
242             The number of distinct users who have added this asset as a favorite.
243              
244             Returns a single C value.
245              
246             =head2 $video->groups
247              
248             An array of strings containing the id URIs of the groups that this asset is mapped into, if any. At present an asset can only be added to one group, but this may change in future.
249              
250             Returns an array of C values.
251              
252             =head2 $video->id
253              
254             A URI that serves as a globally-unique id for the user. This can be used to recognise where the same user is returned in response to different requests, and as a mapping key for an application's local data store.
255              
256             Returns a single C value.
257              
258             =head2 $video->is_favorite_for_current_user
259              
260             C if this asset is a favorite for the current user, or C otherwise. This property is not set for responses to anonymous requests.
261              
262             Returns a single C value.
263              
264             =head2 $video->links
265              
266             B The hyperlinks for the user object. The "alternate" hyperlink of type "text/html" points at the user's TypePad profile page. This property has been deprecated in favor of the separate link properties defined by the subclasses of L.
267              
268             Returns an array of L objects.
269              
270             =head2 $video->object_types
271              
272             An array of object type identifier URIs. At the present time, only one object type is returned per asset, but this may be extended in future. Clients should scan this list and ignore any types that are not recognised. This list also includes appropriate type URIs as defined by the ActivityStrea.ms schema specification.
273              
274             Returns a set of C values.
275              
276             =head2 $video->permalink_url
277              
278             The URL which is considered to be this asset's permalink. This might be C if the asset does not have a permalink of its own (for example, if it's embedded in another asset), or if TypePad does not know its permalink.
279              
280             Returns a single C value.
281              
282             =head2 $video->preview_image_link
283              
284             A link to an image which serves as a preview or poster frame for this video. Might be C if such an image is not available.
285              
286             Returns a single L object.
287              
288             =head2 $video->published
289              
290             The time that the asset was created, as an RFC3339 timestamp.
291              
292             Returns a single C value.
293              
294             =head2 $video->source
295              
296             An object describing the site from which this asset was retrieved, for assets obtained from external feeds.
297              
298             Returns a single L object.
299              
300             =head2 $video->text_format
301              
302             A keyword which indicates what formatting mode is used for the content of this asset. This can currently be "html", for assets whose content is HTML, or "text", for assets whose content is plain text. Other formatting modes may be added in future.
303              
304             Returns a single C value.
305              
306             =head2 $video->url_id
307              
308             A string containing the canonical identifier that can be used as the "id" for this object in URLs. However, this should not be used as a database key to avoid collisions when an application is switched to a different backend server; use the "id" property instead.
309              
310             Returns a single C value.
311              
312             =head2 $video->video_link
313              
314             A link to the actual video that provides the primary content for this asset.
315              
316             Returns a single L object.
317              
318             =head1 SEE ALSO
319              
320             =over 1
321              
322             =item * L
323              
324             =back