File Coverage

blib/lib/Google/Ads/GoogleAds/Constants.pm
Criterion Covered Total %
statement 99 99 100.0
branch n/a
condition n/a
subroutine 33 33 100.0
pod n/a
total 132 132 100.0


line stmt bran cond sub pod time code
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             # Module to store package-level constants and default values.
16              
17              
18             use strict;
19 14     14   1726 use warnings;
  14         27  
  14         311  
20 14     14   55 use version;
  14         27  
  14         294  
21 14     14   410  
  14         1601  
  14         55  
22             use File::HomeDir;
23 14     14   6865 use File::Spec::Functions;
  14         64132  
  14         728  
24 14     14   5388  
  14         9109  
  14         1343  
25             # Main version number that the rest of the modules pick up off of.
26             our $VERSION = qv("13.0.0");
27              
28             use constant DEFAULT_PROPERTIES_FILE =>
29 14         67 catfile(File::HomeDir->my_home, "googleads.properties");
30 14     14   80  
  14         51  
31             # Default Google Ads API version used if the API client is created without a
32             # specified version.
33             use constant DEFAULT_API_VERSION => "V11";
34 14     14   1253  
  14         20  
  14         617  
35             # The Google OAuth2 service base URL.
36             use constant OAUTH2_BASE_URL => "https://accounts.google.com/o/oauth2";
37 14     14   72  
  14         19  
  14         788  
38             # The Google OAuth2 tokeninfo endpoint.
39             use constant OAUTH2_TOKEN_INFO_URL => "https://oauth2.googleapis.com/tokeninfo";
40 14     14   77  
  14         16  
  14         603  
41             # Default OAuth2 scope for Google Ads API.
42             use constant DEFAULT_OAUTH2_SCOPE => "https://www.googleapis.com/auth/adwords";
43 14     14   74  
  14         19  
  14         717  
44             # The error message when the auth handlers are not set up properly.
45             use constant NO_AUTH_HANDLER_SETUP_MESSAGE =>
46 14         728 "The library couldn't find any authorization mechanism set up to properly " .
47             "sign the requests against the API. Please read the guide for OAuth2 from " .
48             "https://github.com/googleads/google-ads-perl#getting-started";
49 14     14   71  
  14         16  
50             # Default Google Ads API service address.
51             use constant DEFAULT_SERVICE_ADDRESS => "https://googleads.googleapis.com";
52 14     14   93  
  14         18  
  14         702  
53             # Default user-agent header for HTTP request.
54             use constant DEFAULT_USER_AGENT => "gl-perl/" . substr($^V, 1);
55 14     14   67  
  14         31  
  14         1044  
56             # Default LWP::UserAgent timeout in seconds.
57             use constant DEFAULT_HTTP_TIMEOUT => 3600;
58 14     14   68  
  14         20  
  14         610  
59             # Default retry timing for LWP::UserAgent::Determined. The string controls how
60             # many times it should retry, and how long the pauses should be in seconds.
61             use constant DEFAULT_HTTP_RETRY_TIMING => "5,10,15";
62 14     14   66  
  14         32  
  14         605  
63             # The LongRunning.OperationSerivce version.
64             use constant OPERATION_SERVICE_VERSION => "V11";
65 14     14   66  
  14         41  
  14         544  
66             # The LongRunning.OperationSerivce name.
67             use constant OPERATION_SERVICE_NAME => "OperationService";
68 14     14   61  
  14         25  
  14         518  
69             # The LongRunning.OperationSerivce class name.
70             use constant OPERATION_SERVICE_CLASS_NAME =>
71 14         574 "Google::Ads::GoogleAds::LongRunning::OperationService";
72 14     14   62  
  14         18  
73             # The Google Ads services class name template.
74             use constant GOOGLE_ADS_SERVICES_CLASS_NAME =>
75 14         598 "Google::Ads::GoogleAds::%s::Services::%s";
76 14     14   66  
  14         18  
77             # The GoogleAdsFailure class name template.
78             use constant GOOGLE_ADS_FAILURE_CLASS_NAME =>
79 14         519 "Google::Ads::GoogleAds::V%d::Errors::GoogleAdsFailure";
80 14     14   68  
  14         15  
81             # The GoogleAdsError class name template.
82             use constant GOOGLE_ADS_ERROR_CLASS_NAME =>
83 14         597 "Google::Ads::GoogleAds::V%d::Errors::GoogleAdsError";
84 14     14   58  
  14         32  
85             # The environment variables that override the loaded config values if set.
86             use constant ENV_VAR_CONFIGURATION_FILE_PATH =>
87 14         634 "GOOGLE_ADS_CONFIGURATION_FILE_PATH";
88 14     14   65 use constant ENV_VAR_DEVELOPER_TOKEN => "GOOGLE_ADS_DEVELOPER_TOKEN";
  14         18  
89 14     14   67 use constant ENV_VAR_LOGIN_CUSTOMER_ID => "GOOGLE_ADS_LOGIN_CUSTOMER_ID";
  14         19  
  14         532  
90 14     14   61 use constant ENV_VAR_LINKED_CUSTOMER_ID => "GOOGLE_ADS_LINKED_CUSTOMER_ID";
  14         18  
  14         642  
91 14     14   74 use constant ENV_VAR_ENDPOINT => "GOOGLE_ADS_ENDPOINT";
  14         24  
  14         521  
92 14     14   58 use constant ENV_VAR_CLIENT_ID => "GOOGLE_ADS_CLIENT_ID";
  14         19  
  14         526  
93 14     14   61 use constant ENV_VAR_CLIENT_SECRET => "GOOGLE_ADS_CLIENT_SECRET";
  14         18  
  14         519  
94 14     14   88 use constant ENV_VAR_REFRESH_TOKEN => "GOOGLE_ADS_REFRESH_TOKEN";
  14         18  
  14         561  
95 14     14   59 use constant ENV_VAR_JSON_KEY_FILE_PATH => "GOOGLE_ADS_JSON_KEY_FILE_PATH";
  14         20  
  14         586  
96 14     14   74 use constant ENV_VAR_IMPERSONATED_EMAIL => "GOOGLE_ADS_IMPERSONATED_EMAIL";
  14         18  
  14         588  
97 14     14   64 use constant ENV_VAR_USER_AGENT => "GOOGLE_ADS_PERL_USER_AGENT";
  14         22  
  14         536  
98 14     14   64 use constant ENV_VAR_PROXY => "GOOGLE_ADS_PERL_PROXY";
  14         24  
  14         529  
99 14     14   63  
  14         21  
  14         676  
100             1;
101              
102             =pod
103              
104             =head1 NAME
105              
106             Google::Ads::GoogleAds::Constants
107              
108             =head1 DESCRIPTION
109              
110             Module to store package-level constants and default values.
111              
112             =head1 LICENSE AND COPYRIGHT
113              
114             Copyright 2019 Google LLC
115              
116             Licensed under the Apache License, Version 2.0 (the "License");
117             you may not use this file except in compliance with the License.
118             You may obtain a copy of the License at
119              
120             http://www.apache.org/licenses/LICENSE-2.0
121              
122             Unless required by applicable law or agreed to in writing, software
123             distributed under the License is distributed on an "AS IS" BASIS,
124             WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125             See the License for the specific language governing permissions and
126             limitations under the License.
127              
128             =head1 REPOSITORY INFORMATION
129              
130             $Rev: $
131             $LastChangedBy: $
132             $Id: $
133              
134             =cut