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   1639 use warnings;
  14         23  
  14         328  
20 14     14   55 use version;
  14         31  
  14         296  
21 14     14   395  
  14         1591  
  14         55  
22             use File::HomeDir;
23 14     14   6744 use File::Spec::Functions;
  14         65368  
  14         759  
24 14     14   5326  
  14         9271  
  14         1377  
25             # Main version number that the rest of the modules pick up off of.
26             our $VERSION = qv("13.1.0");
27              
28             use constant DEFAULT_PROPERTIES_FILE =>
29 14         63 catfile(File::HomeDir->my_home, "googleads.properties");
30 14     14   82  
  14         22  
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   1325  
  14         24  
  14         649  
35             # The Google OAuth2 service base URL.
36             use constant OAUTH2_BASE_URL => "https://accounts.google.com/o/oauth2";
37 14     14   68  
  14         23  
  14         782  
38             # The Google OAuth2 tokeninfo endpoint.
39             use constant OAUTH2_TOKEN_INFO_URL => "https://oauth2.googleapis.com/tokeninfo";
40 14     14   75  
  14         20  
  14         610  
41             # Default OAuth2 scope for Google Ads API.
42             use constant DEFAULT_OAUTH2_SCOPE => "https://www.googleapis.com/auth/adwords";
43 14     14   104  
  14         21  
  14         760  
44             # The error message when the auth handlers are not set up properly.
45             use constant NO_AUTH_HANDLER_SETUP_MESSAGE =>
46 14         799 "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   68  
  14         27  
50             # Default Google Ads API service address.
51             use constant DEFAULT_SERVICE_ADDRESS => "https://googleads.googleapis.com";
52 14     14   70  
  14         18  
  14         777  
53             # Default user-agent header for HTTP request.
54             use constant DEFAULT_USER_AGENT => "gl-perl/" . substr($^V, 1);
55 14     14   66  
  14         26  
  14         1118  
56             # Default LWP::UserAgent timeout in seconds.
57             use constant DEFAULT_HTTP_TIMEOUT => 3600;
58 14     14   71  
  14         26  
  14         606  
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         24  
  14         587  
63             # The LongRunning.OperationSerivce version.
64             use constant OPERATION_SERVICE_VERSION => "V11";
65 14     14   64  
  14         34  
  14         598  
66             # The LongRunning.OperationSerivce name.
67             use constant OPERATION_SERVICE_NAME => "OperationService";
68 14     14   61  
  14         20  
  14         545  
69             # The LongRunning.OperationSerivce class name.
70             use constant OPERATION_SERVICE_CLASS_NAME =>
71 14         579 "Google::Ads::GoogleAds::LongRunning::OperationService";
72 14     14   63  
  14         28  
73             # The Google Ads services class name template.
74             use constant GOOGLE_ADS_SERVICES_CLASS_NAME =>
75 14         685 "Google::Ads::GoogleAds::%s::Services::%s";
76 14     14   62  
  14         29  
77             # The GoogleAdsFailure class name template.
78             use constant GOOGLE_ADS_FAILURE_CLASS_NAME =>
79 14         606 "Google::Ads::GoogleAds::V%d::Errors::GoogleAdsFailure";
80 14     14   65  
  14         32  
81             # The GoogleAdsError class name template.
82             use constant GOOGLE_ADS_ERROR_CLASS_NAME =>
83 14         637 "Google::Ads::GoogleAds::V%d::Errors::GoogleAdsError";
84 14     14   63  
  14         18  
85             # The environment variables that override the loaded config values if set.
86             use constant ENV_VAR_CONFIGURATION_FILE_PATH =>
87 14         611 "GOOGLE_ADS_CONFIGURATION_FILE_PATH";
88 14     14   64 use constant ENV_VAR_DEVELOPER_TOKEN => "GOOGLE_ADS_DEVELOPER_TOKEN";
  14         28  
89 14     14   68 use constant ENV_VAR_LOGIN_CUSTOMER_ID => "GOOGLE_ADS_LOGIN_CUSTOMER_ID";
  14         17  
  14         505  
90 14     14   58 use constant ENV_VAR_LINKED_CUSTOMER_ID => "GOOGLE_ADS_LINKED_CUSTOMER_ID";
  14         19  
  14         641  
91 14     14   68 use constant ENV_VAR_ENDPOINT => "GOOGLE_ADS_ENDPOINT";
  14         18  
  14         567  
92 14     14   64 use constant ENV_VAR_CLIENT_ID => "GOOGLE_ADS_CLIENT_ID";
  14         20  
  14         518  
93 14     14   63 use constant ENV_VAR_CLIENT_SECRET => "GOOGLE_ADS_CLIENT_SECRET";
  14         18  
  14         545  
94 14     14   65 use constant ENV_VAR_REFRESH_TOKEN => "GOOGLE_ADS_REFRESH_TOKEN";
  14         35  
  14         575  
95 14     14   67 use constant ENV_VAR_JSON_KEY_FILE_PATH => "GOOGLE_ADS_JSON_KEY_FILE_PATH";
  14         26  
  14         713  
96 14     14   69 use constant ENV_VAR_IMPERSONATED_EMAIL => "GOOGLE_ADS_IMPERSONATED_EMAIL";
  14         20  
  14         573  
97 14     14   65 use constant ENV_VAR_USER_AGENT => "GOOGLE_ADS_PERL_USER_AGENT";
  14         19  
  14         547  
98 14     14   73 use constant ENV_VAR_PROXY => "GOOGLE_ADS_PERL_PROXY";
  14         28  
  14         550  
99 14     14   63  
  14         21  
  14         727  
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