lib/Google/Ads/Common/OAuthApplicationsHandlerInterface.pm

filter: Statementstmt 78.5% 11 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 76.1% 16 / 21 CC 1 SCAR 2.0
CC
1
Cov
79%
issue_access_token
2.0
get_authorization_url
1.1
BEGIN
1.0
CRAP 1.2
« lib/Google/Ads/AdWords/v201809/ReportDefinitionService/getReportFieldsResponse.pm ↑ Summary lib/Google/Ads/Common/CaptchaRequiredError.pm »
1 # Copyright 2013, 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::OAuthApplicationsHandlerInterface;
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 base qw(Google::Ads::Common::AuthHandlerInterface);
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 # Method to retrieve an authorization URL for the user to put in a
22 # browser and authorize a request token.
23 # Meant to be implemented by a concrete class, which should issue a request
24 # token and return a valid URL for the user to authorize the token.
25 # The implementor must save the request token in the token attribute for later
26 # use by the upgrade_token method.
27 # A callback URL can be passed to re-direct the user after the token is
28 # authorized.
29 0 ▶sub get_authorization_url {
Subroutine get_authorization_url: not called CC=1 SCAR=1.2
Pod documented
30 1 my ($self, $callback) = @_;
31 0 die "Needs to be implemented by subclass";
32 }
33  
34 # Method to issue an access token given an authorization code. After calling
35 # this method the auth handler should be prepared to prepare HTTP requests
36 # against protected resources.
37 0 ▶sub issue_access_token {
Subroutine issue_access_token: not called CC=1 SCAR=6.9
Pod documented
38 0 my ($self, $auth_code) = @_;
39 0 die "Needs to be implemented by subclass";
40 }
41  
42 1 1;
43  
44 =pod
45  
46 =head1 NAME
47  
48 Google::Ads::Common::OAuthApplicationsHandlerInterface
49  
50 =head1 DESCRIPTION
51  
52 Abstract interface for oauth flows that require user interaction.
53  
54 Meant be implemented by concrete OAuth handlers that require user intervention
55 for authorizing requests against the API.
56  
57 =head1 METHODS
58  
59 =head2 get_authorization_url
60  
61 Meant to be implemented by a concrete class, which should return a valid URL
62 for the user to authorize the access to the API.
63  
64 =head3 Returns
65  
66 The URL for the user to authorize access to his account. The user first must
67 login in the account that want to grant access to.
68  
69 =head2 issue_access_token
70  
71 Method to upgrade/obtain an authorized access token.
72  
73 =head3 Parameters
74  
75 =over
76  
77 =item *
78  
79 The verifier code returned to your callback page or printed out if using 'oob'
80 special callback URL.
81  
82 =back
83  
84 =head1 LICENSE AND COPYRIGHT
85  
86 Copyright 2013 Google Inc.
87  
88 Licensed under the Apache License, Version 2.0 (the "License");
89 you may not use this file except in compliance with the License.
90 You may obtain a copy of the License at
91  
92 http://www.apache.org/licenses/LICENSE-2.0
93  
94 Unless required by applicable law or agreed to in writing, software
95 distributed under the License is distributed on an "AS IS" BASIS,
96 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97 See the License for the specific language governing permissions and
98 limitations under the License.
99  
100 =head1 REPOSITORY INFORMATION
101  
102 $Rev: $
103 $LastChangedBy: $
104 $Id: $
105  
106 =cut
« lib/Google/Ads/AdWords/v201809/ReportDefinitionService/getReportFieldsResponse.pm ↑ Summary lib/Google/Ads/Common/CaptchaRequiredError.pm »