lib/Google/Ads/AdWords/Utilities/BatchJobHandlerError.pm

filter: Statementstmt 100% 34 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 0.0% 0 / 2 totaltotal 91.1% 41 / 45 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Google/Ads/AdWords/Utilities/BatchJobHandler.pm ↑ Summary blib/lib/Google/Ads/Common/Constants.pm »
1 # Copyright 2015, 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::AdWords::Utilities::BatchJobHandlerError;
16  
17 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use version;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # The following needs to be on one line because CPAN uses a particularly hacky
22 # eval() to determine module versions.
23 2 ▶use Google::Ads::Common::Constants; our $VERSION = ${Google::Ads::Common::Constants::VERSION};
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶use Class::Std::Fast;
Subroutine BEGIN: called CC=1 SCAR=0.0
26  
27 # Error type.
28 2 my %type_of : ATTR(:name<type> :default<"">);
29  
30 # Description of the error.
31 2 my %description_of : ATTR(:name<description> :default<"">);
32  
33 ##################################################
34 # Additional information for HTTP errors.
35 ##################################################
36 2 my %http_type_of : ATTR(:name<http_type> :default<"">);
37  
38 # Bad data triggering the error.
39 2 my %http_trigger_of : ATTR(:name<http_trigger> :default<"">);
40  
41 # ONGL path to the field cause of the error.
42 2 my %http_field_path_of : ATTR(:name<http_field_path> :default<"">);
43  
44 2 my %http_response_code_of : ATTR(:name<http_response_code> :default<"">);
45  
46 1 my %http_response_message_of : ATTR(:name<http_response_message> :default<"">);
47  
48 ##################################################
49 # Additional information for PROCESSING errors.
50 ##################################################
51 1 my %processing_errors_of : ATTR(:name<processing_errors> :default<>);
52  
53 # Always return false in boolean context.
54 0 ▶sub as_bool : BOOLIFY {
Subroutine as_bool: not called CC=1 SCAR=0.0
Pod undocumented
55 1 return;
56 2 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58 0 ▶sub as_str : STRINGIFY {
Subroutine as_str: not called CC=1 SCAR=0.0
Pod undocumented
59 1 my ($self) = @_;
60 1 return sprintf(
61 "BatchJobHandlerError {\n type: %s\n description: %s\n" .
62 " http_type: %s\n http_trigger: %s\n http_field_path: %s\n" .
63 " http_response_code: %s\n http_response_message: %s\n}",
64 $self->get_type(), $self->get_description(),
65 $self->get_http_type(),
66 $self->get_http_trigger(),
67 $self->get_http_field_path(),
68 $self->get_http_response_code(),
69 $self->get_http_response_message());
70 2 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
71  
72 1 return 1;
73  
74 =pod
75  
76 =head1 NAME
77  
78 Google::Ads::AdWords::Utilities::BatchJobHandlerError
79  
80 =head1 DESCRIPTION
81  
82 Data object that holds the information of an error that occurred during a
83 batch job upload request.
84  
85 =head1 ATTRIBUTES
86  
87 There is a get_ and set_ method associated with each attribute for retrieving or
88 setting them dynamically.
89  
90 =head2 type
91  
92 The type of error that occurred (HTTP, PROCESSING, UPLOAD).
93 HTTP => Specific to an HTTP request made to the server.
94 PROCESSING => Check the current job because the job has processing errors.
95 UPLOAD => A general error happened during upload.
96  
97 =head2 description
98  
99 The detailed description of the error.
100  
101 =head2 http_type
102  
103 For HTTP errors, the type of HTTP error.
104  
105 =head2 http_trigger
106  
107 For HTTP errors, invalid data cause of the error.
108  
109 =head2 http_field_path
110  
111 For HTTP errors, ONGL path to the field that caused the error.
112  
113 =head2 http_response_code
114  
115 For HTTP errors, the HTTP response code.
116  
117 =head2 http_response_message
118  
119 For HTTP errors, the HTTP response message.
120  
121 =head2 processing_errors
122  
123 For PROCESSING errors, this contains an array of processing errors of type
124 BatchJobProcessingError.
125  
126 =head1 LICENSE AND COPYRIGHT
127  
128 Copyright 2015 Google Inc.
129  
130 Licensed under the Apache License, Version 2.0 (the "License");
131 you may not use this file except in compliance with the License.
132 You may obtain a copy of the License at
133  
134 http://www.apache.org/licenses/LICENSE-2.0
135  
136 Unless required by applicable law or agreed to in writing, software
137 distributed under the License is distributed on an "AS IS" BASIS,
138 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139 See the License for the specific language governing permissions and
140 limitations under the License.
141  
142 =head1 REPOSITORY INFORMATION
143  
144 $Rev: $
145 $LastChangedBy: $
146 $Id: $
147  
148 =cut
149  
« lib/Google/Ads/AdWords/Utilities/BatchJobHandler.pm ↑ Summary blib/lib/Google/Ads/Common/Constants.pm »