File Coverage

lib/Google/Ads/Common/CaptchaRequiredError.pm
Criterion Covered Total %
statement 21 23 91.3
branch n/a
condition n/a
subroutine 7 8 87.5
pod 0 1 0.0
total 28 32 87.5


line stmt bran cond sub pod time code
1             # Copyright 2012, Google Inc. All Rights Reserved.
2             #
3             # Licensed under the Apache License, Version 2.0 (the "License");
4             # you may not use this file except in compliance with the License.
5             # You may obtain a copy of the License at
6             #
7             # http://www.apache.org/licenses/LICENSE-2.0
8             #
9             # Unless required by applicable law or agreed to in writing, software
10             # distributed under the License is distributed on an "AS IS" BASIS,
11             # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12             # See the License for the specific language governing permissions and
13             # limitations under the License.
14              
15             package Google::Ads::Common::CaptchaRequiredError;
16              
17 1     1   603 use strict;
  1         1  
  1         27  
18 1     1   4 use warnings;
  1         2  
  1         29  
19 1     1   8 use version;
  1         2  
  1         8  
20 1     1   95 use base qw(Google::Ads::Common::AuthError);
  1         3  
  1         288  
21              
22             # The following needs to be on one line because CPAN uses a particularly hacky
23             # eval() to determine module versions.
24 1     1   7 use Google::Ads::Common::Constants; our $VERSION = ${Google::Ads::Common::Constants::VERSION};
  1         2  
  1         28  
25              
26 1     1   5 use Class::Std::Fast;
  1         1  
  1         4  
27              
28             # Class::Std-style attributes. Need to be kept in the same line.
29             my %token_of : ATTR(:name);
30             my %image_of : ATTR(:name);
31             my %url_of : ATTR(:name);
32              
33             sub as_string : STRINGIFY {
34 0     0 0   my $self = shift;
35 0           return sprintf(
36             "CaptchaRequiredError {\n token: %s\n image: %s\n" .
37             " url: %s\n message: %s\n code: %s\n content: %s\n}",
38             $self->get_token(), $self->get_image(), $self->get_url(),
39             $self->get_message(), $self->get_code(), $self->get_content());
40 1     1   166 }
  1         5  
  1         6  
41              
42             1;
43              
44             =pod
45              
46             =head1 NAME
47              
48             Google::Ads::Common::CaptchaRequiredError
49              
50             =head1 DESCRIPTION
51              
52             Captures Captcha authorization required error information.
53              
54             =head1 ATTRIBUTES
55              
56             Each of these attributes can be set via
57             Google::Ads::Common::CaptchaRequiredError->new().
58             Alternatively, there is a get_ and set_ method associated with each attribute
59             for retrieving or setting them dynamically.
60              
61             =head2 token
62              
63             Captcha challenge token.
64              
65             =head2 image
66              
67             Holds the URL to the captcha image.
68              
69             =head2 url
70              
71             Holds the URL to unlock the challenge.
72              
73             =head1 LICENSE AND COPYRIGHT
74              
75             Copyright 2012 Google Inc.
76              
77             Licensed under the Apache License, Version 2.0 (the "License");
78             you may not use this file except in compliance with the License.
79             You may obtain a copy of the License at
80              
81             http://www.apache.org/licenses/LICENSE-2.0
82              
83             Unless required by applicable law or agreed to in writing, software
84             distributed under the License is distributed on an "AS IS" BASIS,
85             WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86             See the License for the specific language governing permissions and
87             limitations under the License.
88              
89             =head1 REPOSITORY INFORMATION
90              
91             $Rev: $
92             $LastChangedBy: $
93             $Id: $
94              
95             =cut