File Coverage

lib/Google/Ads/Common/ReportDownloadError.pm
Criterion Covered Total %
statement 21 24 87.5
branch n/a
condition n/a
subroutine 7 7 100.0
pod n/a
total 28 31 90.3


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::ReportDownloadError;
16              
17 2     2   105596 use strict;
  2         4  
  2         57  
18 2     2   10 use warnings;
  2         5  
  2         78  
19 2     2   15 use version;
  2         5  
  2         18  
20              
21             # The following needs to be on one line because CPAN uses a particularly hacky
22             # eval() to determine module versions.
23 2     2   149 use Google::Ads::Common::Constants; our $VERSION = ${Google::Ads::Common::Constants::VERSION};
  2         3  
  2         77  
24              
25 2     2   9 use Class::Std::Fast;
  2         4  
  2         14  
26              
27             # Error type.
28             my %type_of : ATTR(:name :default<"">);
29              
30             # Bad data triggering the error.
31             my %trigger_of : ATTR(:name :default<"">);
32              
33             # ONGL path to the field cause of the error.
34             my %field_path_of : ATTR(:name :default<"">);
35              
36             my %response_code_of : ATTR(:name :default<"">);
37              
38             my %response_message_of : ATTR(:name :default<"">);
39              
40             # Always return false in boolean context.
41             sub as_bool : BOOLIFY {
42 0         0 return;
43 2     2   320 }
  2         4  
  2         12  
44              
45             sub as_str : STRINGIFY {
46 0           my ($self) = @_;
47 0           return sprintf(
48             "ReportDownloadError {\n type: %s\n trigger: %s\n" .
49             " field_path: %s\n response_code: %s\n response_message: %s\n}",
50             $self->get_type(), $self->get_trigger(),
51             $self->get_field_path(),
52             $self->get_response_code(),
53             $self->get_response_message());
54 2     2   532 }
  2         5  
  2         8  
55              
56             return 1;
57              
58             =pod
59              
60             =head1 NAME
61              
62             Google::Ads::Common::ReportDownloadError
63              
64             =head1 DESCRIPTION
65              
66             Data object that holds the information of an error that occurred during a
67             report download request.
68              
69             =head1 ATTRIBUTES
70              
71             There is a get_ and set_ method associated with each attribute for retrieving or
72             setting them dynamically.
73              
74             =head2 type
75              
76             The type of error ocurred.
77              
78             =head2 trigger
79              
80             Invalid data cause of the error.
81              
82             =head2 field_path
83              
84             ONGL path to the field that caused the error.
85              
86             =head1 LICENSE AND COPYRIGHT
87              
88             Copyright 2012 Google Inc.
89              
90             Licensed under the Apache License, Version 2.0 (the "License");
91             you may not use this file except in compliance with the License.
92             You may obtain a copy of the License at
93              
94             http://www.apache.org/licenses/LICENSE-2.0
95              
96             Unless required by applicable law or agreed to in writing, software
97             distributed under the License is distributed on an "AS IS" BASIS,
98             WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99             See the License for the specific language governing permissions and
100             limitations under the License.
101              
102             =head1 REPOSITORY INFORMATION
103              
104             $Rev: $
105             $LastChangedBy: $
106             $Id: $
107              
108             =cut