| 1 | # Copyright 2011, 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 | # Module to store package-level constants and default values. | ||
| 16 | |||
| 17 | package Google::Ads::AdWords::Constants; | ||
| 18 | |||
| 19 | 9 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 20 | 9 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 21 | |||
| 22 | 9 | ▶ | use File::HomeDir; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 23 | 9 | ▶ | use File::Spec::Functions; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | |||
| 25 | # Main version number that the rest of the modules pick up off of. | ||
| 26 | 9 | our $VERSION = qv("2.15.0"); | |
| 27 | |||
| 28 | 9 | ▶ | use constant DEFAULT_PROPERTIES_FILE => catfile(File::HomeDir->my_home, |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 29 | 9 | "adwords.properties"); | |
| 30 | |||
| 31 | # In this format string, the first %s is the URL prefix, the second is the | ||
| 32 | # version, and the third is service name. | ||
| 33 | 9 | ▶ | use constant PROXY_FORMAT_STRING => "%s/api/adwords/%s/%s/%s"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | |||
| 35 | # Default current version used if the client is created without the version | ||
| 36 | # parameter. | ||
| 37 | 9 | ▶ | use constant DEFAULT_VERSION => "v201402"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 38 | |||
| 39 | # Default alternate URL that points to production servers. | ||
| 40 | 9 | ▶ | use constant DEFAULT_ALTERNATE_URL => "https://adwords.google.com"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 41 | |||
| 42 | # Default validation header value passed to the servers. | ||
| 43 | 9 | ▶ | use constant DEFAULT_VALIDATE_ONLY => "false"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | |||
| 45 | # Maximum number of request stats to keep in memory, any overflow will result | ||
| 46 | # on droppping older requests stats out of memory. | ||
| 47 | 9 | ▶ | use constant MAX_NUM_OF_REQUEST_STATS => 500; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 48 | |||
| 49 | # Mapping of services to namespace group, required to figure out the service | ||
| 50 | # url endpoints. | ||
| 51 | 9 | our %SERVICE_TO_GROUP = ( | |
| 52 | AdExtensionOverrideService => "cm", | ||
| 53 | AdGroupAdService => "cm", | ||
| 54 | AdGroupBidModifierService => "cm", | ||
| 55 | AdGroupCriterionService => "cm", | ||
| 56 | AdGroupFeedService => "cm", | ||
| 57 | AdGroupService => "cm", | ||
| 58 | AdParamService => "cm", | ||
| 59 | AdwordsUserListService => "rm", | ||
| 60 | AlertService => "mcm", | ||
| 61 | BiddingStrategyService => "cm", | ||
| 62 | BudgetOrderService => "billing", | ||
| 63 | BudgetService => "cm", | ||
| 64 | CampaignAdExtensionService => "cm", | ||
| 65 | CampaignCriterionService => "cm", | ||
| 66 | CampaignFeedService => "cm", | ||
| 67 | CampaignService => "cm", | ||
| 68 | CampaignSharedSetService => "cm", | ||
| 69 | CampaignTargetService => "cm", | ||
| 70 | ConstantDataService => "cm", | ||
| 71 | ConversionTrackerService => "cm", | ||
| 72 | CustomerService => "mcm", | ||
| 73 | CustomerFeedService => "cm", | ||
| 74 | CustomerSyncService => "ch", | ||
| 75 | DataService => "cm", | ||
| 76 | ExperimentService => "cm", | ||
| 77 | FeedItemService => "cm", | ||
| 78 | FeedMappingService => "cm", | ||
| 79 | FeedService => "cm", | ||
| 80 | GeoLocationService => "cm", | ||
| 81 | LocationCriterionService => "cm", | ||
| 82 | ManagedCustomerService => "mcm", | ||
| 83 | MediaService => "cm", | ||
| 84 | MutateJobService => "cm", | ||
| 85 | OfflineConversionFeedService => "cm", | ||
| 86 | ReportDefinitionService => "cm", | ||
| 87 | SharedCriterionService => "cm", | ||
| 88 | SharedSetService => "cm", | ||
| 89 | TargetingIdeaService => "o", | ||
| 90 | TrafficEstimatorService => "o", | ||
| 91 | ); | ||
| 92 | |||
| 93 | # Useful constant to translate micros to dollars and viceversa. | ||
| 94 | 9 | ▶ | use constant MICROS_PER_DOLLAR => 1000000; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 95 | |||
| 96 | # Last version of the API to support the ClientLogin auth method. | ||
| 97 | 9 | ▶ | use constant LAST_SUPPORTED_CLIENT_LOGIN_VERSION => "v201309"; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 98 | |||
| 99 | 9 | return 1; | |