| 1 | # Copyright 2019, Google LLC | ||
| 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::GoogleAds::Common::AuthError; | ||
| 16 | |||
| 17 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 19 | 1 | ▶ | 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 | 1 | ▶ | use Google::Ads::GoogleAds::Constants; our $VERSION = ${Google::Ads::GoogleAds::Constants::VERSION}; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | |||
| 25 | 1 | ▶ | use Class::Std::Fast; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | |||
| 27 | # Class::Std-style attributes. Need to be kept in the same line. | ||
| 28 | # These need to go in the same line for older Perl interpreters to understand. | ||
| 29 | 1 | my %message_of : ATTR(:name<message>); | |
| 30 | 1 | my %code_of : ATTR(:name<code>); | |
| 31 | 1 | my %content_of : ATTR(:name<content>); | |
| 32 | |||
| 33 | 0 | ▶ | sub as_string : STRINGIFY { |
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 34 | 0 | my $self = shift; | |
| 35 | return | ||
| 36 | 0 | sprintf("AuthError {\n message: %s\n code: %s\n" . " content: %s\n}", | |
| 37 | $self->get_message(), $self->get_code(), $self->get_content()); | ||
| 38 | 1 | ▶ | } |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 39 | |||
| 40 | 1 | 1; | |
| 41 | |||
| 42 | =pod | ||
| 43 | |||
| 44 | =head1 NAME | ||
| 45 | |||
| 46 | Google::Ads::GoogleAds::Common::AuthError | ||
| 47 | |||
| 48 | =head1 DESCRIPTION | ||
| 49 | |||
| 50 | Captures authorization error information. | ||
| 51 | |||
| 52 | =head1 ATTRIBUTES | ||
| 53 | |||
| 54 | Each of these attributes can be set via | ||
| 55 | Google::Ads::GoogleAds::Common::AuthError->new(). | ||
| 56 | |||
| 57 | Alternatively, there is a get_ and set_ method associated with each attribute | ||
| 58 | for retrieving or setting them dynamically. | ||
| 59 | |||
| 60 | =head2 message | ||
| 61 | |||
| 62 | Holds the error message. | ||
| 63 | |||
| 64 | =head2 code | ||
| 65 | |||
| 66 | Holds the HTTP code associated with the error. | ||
| 67 | |||
| 68 | =head2 content | ||
| 69 | |||
| 70 | Holds the body of the error response. | ||
| 71 | |||
| 72 | =head1 LICENSE AND COPYRIGHT | ||
| 73 | |||
| 74 | Copyright 2019 Google LLC | ||
| 75 | |||
| 76 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 77 | you may not use this file except in compliance with the License. | ||
| 78 | You may obtain a copy of the License at | ||
| 79 | |||
| 80 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 81 | |||
| 82 | Unless required by applicable law or agreed to in writing, software | ||
| 83 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 84 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 85 | See the License for the specific language governing permissions and | ||
| 86 | limitations under the License. | ||
| 87 | |||
| 88 | =head1 REPOSITORY INFORMATION | ||
| 89 | |||
| 90 | $Rev: $ | ||
| 91 | $LastChangedBy: $ | ||
| 92 | $Id: $ | ||
| 93 | |||
| 94 | =cut | ||