« blib/lib/Google/Ads/SOAP/Generator/Generator.pm
↑ Summary
lib/Google/Ads/AdWords/AuthTokenHandler.pm »
| 1 | # Copyright 2011, 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::FaultDetail; | ||
| 16 | |||
| 17 | use strict; | ||
| 18 | use warnings; | ||
| 19 | use base qw(SOAP::WSDL::XSD::Typelib::ComplexType); | ||
| 20 | |||
| 21 | # The following needs to be on one line because CPAN uses a particularly hacky | ||
| 22 | # eval() to determine module versions. | ||
| 23 | use Google::Ads::AdWords::Constants; our $VERSION = ${Google::Ads::AdWords::Constants::VERSION}; | ||
| 24 | |||
| 25 | use Class::Std::Fast::Storable constructor => 'none'; | ||
| 26 | |||
| 27 | __PACKAGE__->_set_element_form_qualified(1); | ||
| 28 | |||
| 29 | sub get_xmlns {'http://schemas.xmlsoap.org/soap/envelope/'}; | ||
| 30 | |||
| 31 | our $XML_ATTRIBUTE_CLASS; | ||
| 32 | undef $XML_ATTRIBUTE_CLASS; | ||
| 33 | |||
| 34 | sub __get_attr_class { | ||
| 35 | return $XML_ATTRIBUTE_CLASS; | ||
| 36 | } | ||
| 37 | |||
| 38 | sub AUTOMETHOD { | ||
| 39 | my ($self, $ident) = @_; | ||
| 40 | my $method_name = $_; | ||
| 41 | |||
| 42 | # Storing any exception into ApiExceptionFault property. | ||
| 43 | if ($method_name =~ /^(set_|add_)\w+$/) { | ||
| 44 | return sub { | ||
| 45 | my ($self, $exception) = @_; | ||
| 46 | $self->set_ApiExceptionFault($exception); | ||
| 47 | }; | ||
| 48 | } | ||
| 49 | # Retrieving any exception from the ApiExceptionFault property. | ||
| 50 | if ($method_name =~ /^(get_)\w+$/) { | ||
| 51 | return sub { | ||
| 52 | my ($self) = @_; | ||
| 53 | $self->get_ApiExceptionFault(); | ||
| 54 | }; | ||
| 55 | } | ||
| 56 | } | ||
| 57 | |||
| 58 | Class::Std::initialize(); | ||
| 59 | |||
| 60 | { # BLOCK to scope variables | ||
| 61 | |||
| 62 | my %ApiExceptionFault_of :ATTR(:get<ApiExceptionFault>); | ||
| 63 | |||
| 64 | __PACKAGE__->_factory( | ||
| 65 | [qw(exception)], | ||
| 66 | {'ApiExceptionFault' => \%ApiExceptionFault_of}, | ||
| 67 | {'ApiExceptionFault' => 'SOAP::WSDL::XSD::Typelib::ComplexType'}, | ||
| 68 | {'ApiExceptionFault' => 'ApiExceptionFault'}); | ||
| 69 | |||
| 70 | } # end BLOCK | ||
| 71 | |||
| 72 | 1; | ||
| 73 | |||
| 74 | =pod | ||
| 75 | |||
| 76 | =head1 NAME | ||
| 77 | |||
| 78 | Google::Ads::AdWords::FaultDetail | ||
| 79 | |||
| 80 | =head1 SYNOPSIS | ||
| 81 | |||
| 82 | Class that wraps API exceptions and it is accesible through | ||
| 83 | C<SOAP::WSDL::SOAP::Typelib::Fault11->get_detail()>. | ||
| 84 | |||
| 85 | =head1 DESCRIPTION | ||
| 86 | |||
| 87 | This class holds full API exception objects. | ||
| 88 | |||
| 89 | =head1 ATTRIBUTES | ||
| 90 | |||
| 91 | =head2 exception | ||
| 92 | |||
| 93 | The API exception(s) object returned by the service. | ||
| 94 | |||
| 95 | =head1 LICENSE AND COPYRIGHT | ||
| 96 | |||
| 97 | Copyright 2011 Google Inc. | ||
| 98 | |||
| 99 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 100 | you may not use this file except in compliance with the License. | ||
| 101 | You may obtain a copy of the License at | ||
| 102 | |||
| 103 | http://www.apache.org/licenses/LICENSE-2.0 | ||
| 104 | |||
| 105 | Unless required by applicable law or agreed to in writing, software | ||
| 106 | distributed under the License is distributed on an "AS IS" BASIS, | ||
| 107 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 108 | See the License for the specific language governing permissions and | ||
| 109 | limitations under the License. | ||
| 110 | |||
| 111 | =head1 AUTHOR | ||
| 112 | |||
| 113 | David Torres E<lt>api.davidtorres at gmail.comE<gt> | ||
| 114 | |||
| 115 | =head1 REPOSITORY INFORMATION | ||
| 116 | |||
| 117 | $Rev: $ | ||
| 118 | $LastChangedBy: $ | ||
| 119 | $Id: $ | ||
| 120 | |||
| 121 | =cut |