| 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 | ▶ | 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 | 1 | my %type_of : ATTR(:name<type> :default<"">); | |
| 29 | |||
| 30 | # Bad data triggering the error. | ||
| 31 | 1 | my %trigger_of : ATTR(:name<trigger> :default<"">); | |
| 32 | |||
| 33 | # ONGL path to the field cause of the error. | ||
| 34 | 2 | my %field_path_of : ATTR(:name<field_path> :default<"">); | |
| 35 | |||
| 36 | 2 | my %response_code_of : ATTR(:name<response_code> :default<"">); | |
| 37 | |||
| 38 | 2 | my %response_message_of : ATTR(:name<response_message> :default<"">); | |
| 39 | |||
| 40 | # Always return false in boolean context. | ||
| 41 | sub as_bool : BOOLIFY { | ||
| 42 | return; | ||
| 43 | 2 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | |||
| 45 | sub as_str : STRINGIFY { | ||
| 46 | my ($self) = @_; | ||
| 47 | 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 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 55 | |||
| 56 | 2 | 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 | ||