File Coverage

lib/Google/Ads/AdWords/FaultDetail.pm
Criterion Covered Total %
statement 15 27 55.5
branch 0 4 0.0
condition n/a
subroutine 5 10 50.0
pod 0 2 0.0
total 20 43 46.5


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