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