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   1389 use warnings;
  14         23  
  14         284  
20 14     14   47 use version;
  14         28  
  14         268  
21 14     14   331  
  14         1339  
  14         51  
22             use File::HomeDir;
23 14     14   5928 use File::Spec::Functions;
  14         56875  
  14         733  
24 14     14   4743  
  14         8431  
  14         1453  
25             # Main version number that the rest of the modules pick up off of.
26             our $VERSION = qv("12.0.0");
27              
28             use constant DEFAULT_PROPERTIES_FILE =>
29 14         58 catfile(File::HomeDir->my_home, "googleads.properties");
30 14     14   80  
  14         19  
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   1151  
  14         20  
  14         525  
35             # The Google OAuth2 service base URL.
36             use constant OAUTH2_BASE_URL => "https://accounts.google.com/o/oauth2";
37 14     14   57  
  14         18  
  14         694  
38             # The Google OAuth2 tokeninfo endpoint.
39             use constant OAUTH2_TOKEN_INFO_URL => "https://oauth2.googleapis.com/tokeninfo";
40 14     14   68  
  14         19  
  14         518  
41             # Default OAuth2 scope for Google Ads API.
42             use constant DEFAULT_OAUTH2_SCOPE => "https://www.googleapis.com/auth/adwords";
43 14     14   72  
  14         18  
  14         807  
44             # The error message when the auth handlers are not set up properly.
45             use constant NO_AUTH_HANDLER_SETUP_MESSAGE =>
46 14         615 "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   62  
  14         26  
50             # Default Google Ads API service address.
51             use constant DEFAULT_SERVICE_ADDRESS => "https://googleads.googleapis.com";
52 14     14   60  
  14         30  
  14         681  
53             # Default user-agent header for HTTP request.
54             use constant DEFAULT_USER_AGENT => "gl-perl/" . substr($^V, 1);
55 14     14   57  
  14         37  
  14         944  
56             # Default LWP::UserAgent timeout in seconds.
57             use constant DEFAULT_HTTP_TIMEOUT => 3600;
58 14     14   67  
  14         23  
  14         497  
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   56  
  14         17  
  14         491  
63             # The LongRunning.OperationSerivce version.
64             use constant OPERATION_SERVICE_VERSION => "V11";
65 14     14   56  
  14         33  
  14         475  
66             # The LongRunning.OperationSerivce name.
67             use constant OPERATION_SERVICE_NAME => "OperationService";
68 14     14   53  
  14         14  
  14         446  
69             # The LongRunning.OperationSerivce class name.
70             use constant OPERATION_SERVICE_CLASS_NAME =>
71 14         515 "Google::Ads::GoogleAds::LongRunning::OperationService";
72 14     14   78  
  14         21  
73             # The Google Ads services class name template.
74             use constant GOOGLE_ADS_SERVICES_CLASS_NAME =>
75 14         477 "Google::Ads::GoogleAds::%s::Services::%s";
76 14     14   57  
  14         18  
77             # The GoogleAdsFailure class name template.
78             use constant GOOGLE_ADS_FAILURE_CLASS_NAME =>
79 14         636 "Google::Ads::GoogleAds::V%d::Errors::GoogleAdsFailure";
80 14     14   67  
  14         17  
81             # The GoogleAdsError class name template.
82             use constant GOOGLE_ADS_ERROR_CLASS_NAME =>
83 14         556 "Google::Ads::GoogleAds::V%d::Errors::GoogleAdsError";
84 14     14   55  
  14         20  
85             # The environment variables that override the loaded config values if set.
86             use constant ENV_VAR_CONFIGURATION_FILE_PATH =>
87 14         533 "GOOGLE_ADS_CONFIGURATION_FILE_PATH";
88 14     14   63 use constant ENV_VAR_DEVELOPER_TOKEN => "GOOGLE_ADS_DEVELOPER_TOKEN";
  14         18  
89 14     14   59 use constant ENV_VAR_LOGIN_CUSTOMER_ID => "GOOGLE_ADS_LOGIN_CUSTOMER_ID";
  14         20  
  14         464  
90 14     14   55 use constant ENV_VAR_LINKED_CUSTOMER_ID => "GOOGLE_ADS_LINKED_CUSTOMER_ID";
  14         19  
  14         532  
91 14     14   60 use constant ENV_VAR_ENDPOINT => "GOOGLE_ADS_ENDPOINT";
  14         15  
  14         614  
92 14     14   57 use constant ENV_VAR_CLIENT_ID => "GOOGLE_ADS_CLIENT_ID";
  14         15  
  14         485  
93 14     14   52 use constant ENV_VAR_CLIENT_SECRET => "GOOGLE_ADS_CLIENT_SECRET";
  14         21  
  14         454  
94 14     14   66 use constant ENV_VAR_REFRESH_TOKEN => "GOOGLE_ADS_REFRESH_TOKEN";
  14         19  
  14         467  
95 14     14   57 use constant ENV_VAR_JSON_KEY_FILE_PATH => "GOOGLE_ADS_JSON_KEY_FILE_PATH";
  14         18  
  14         605  
96 14     14   63 use constant ENV_VAR_IMPERSONATED_EMAIL => "GOOGLE_ADS_IMPERSONATED_EMAIL";
  14         28  
  14         483  
97 14     14   69 use constant ENV_VAR_USER_AGENT => "GOOGLE_ADS_PERL_USER_AGENT";
  14         16  
  14         438  
98 14     14   53 use constant ENV_VAR_PROXY => "GOOGLE_ADS_PERL_PROXY";
  14         23  
  14         469  
99 14     14   56  
  14         23  
  14         616  
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