Module: DfpApi::ApiConfig

Defined in:
lib/dfp_api/api_config.rb,
lib/dfp_api/version.rb

Overview

Contains helper methods for loading and managing the available services.

Defined Under Namespace

Classes: ApiConfig

Constant Summary collapse

CLIENT_LIB_VERSION =
'1.2.0'
DEFAULT_VERSION =

Set defaults

:v201802
LATEST_VERSION =
:v201802
API_NAME =

Set other constants

'DfpApi'
DEFAULT_CONFIG_FILENAME =
'dfp_api.yml'
@@service_config =

Configure the services available to each version

{
  :v201705 => [:ActivityGroupService, :ActivityService,
               :AdExclusionRuleService, :AdRuleService,
               :AudienceSegmentService, :BaseRateService, :CompanyService,
               :ContactService, :ContentBundleService,
               :ContentMetadataKeyHierarchyService, :ContentService,
               :CreativeService, :CreativeSetService,
               :CreativeTemplateService, :CreativeWrapperService,
               :CustomFieldService, :CustomTargetingService,
               :ExchangeRateService, :ForecastService, :InventoryService,
               :LabelService, :LineItemCreativeAssociationService,
               :LineItemService, :LineItemTemplateService,
               :LiveStreamEventService, :MobileApplicationService,
               :NativeStyleService, :NetworkService, :OrderService,
               :PackageService, :ProductPackageService,
               :ProductPackageItemService, :PlacementService,
               :PremiumRateService, :ProductService,
               :ProductTemplateService, :ProposalLineItemService,
               :ProposalService, :PublisherQueryLanguageService,
               :RateCardService, :ReconciliationOrderReportService,
               :ReconciliationLineItemReportService,
               :ReconciliationReportRowService,
               :ReconciliationReportService, :ReportService,
               :SuggestedAdUnitService, :TeamService, :UserService,
               :UserTeamAssociationService, :WorkflowRequestService],
  :v201708 => [:ActivityGroupService, :ActivityService,
               :AdExclusionRuleService, :AdRuleService,
               :AudienceSegmentService, :BaseRateService, :CompanyService,
               :ContactService, :ContentBundleService,
               :ContentMetadataKeyHierarchyService, :ContentService,
               :CreativeService, :CreativeSetService,
               :CreativeTemplateService, :CreativeWrapperService,
               :CustomFieldService, :CustomTargetingService,
               :ExchangeRateService, :ForecastService, :InventoryService,
               :LabelService, :LineItemCreativeAssociationService,
               :LineItemService, :LineItemTemplateService,
               :LiveStreamEventService, :MobileApplicationService,
               :NativeStyleService, :NetworkService, :OrderService,
               :PackageService, :ProductPackageService,
               :ProductPackageItemService, :PlacementService,
               :PremiumRateService, :ProductService,
               :ProductTemplateService, :ProposalLineItemService,
               :ProposalService, :PublisherQueryLanguageService,
               :RateCardService, :ReconciliationOrderReportService,
               :ReconciliationLineItemReportService,
               :ReconciliationReportRowService,
               :ReconciliationReportService, :ReportService,
               :SuggestedAdUnitService, :TeamService, :UserService,
               :UserTeamAssociationService, :WorkflowRequestService],
  :v201711 => [:ActivityGroupService, :ActivityService,
               :AdExclusionRuleService, :AdRuleService,
               :AudienceSegmentService, :BaseRateService, :CompanyService,
               :CdnConfigurationService, :ContactService,
               :ContentBundleService, :ContentMetadataKeyHierarchyService,
               :ContentService, :CreativeService, :CreativeSetService,
               :CreativeTemplateService, :CreativeWrapperService,
               :CustomFieldService, :CustomTargetingService,
               :ExchangeRateService, :ForecastService, :InventoryService,
               :LabelService, :LineItemCreativeAssociationService,
               :LineItemService, :LineItemTemplateService,
               :LiveStreamEventService, :MobileApplicationService,
               :NativeStyleService, :NetworkService, :OrderService,
               :PackageService, :ProductPackageService,
               :ProductPackageItemService, :PlacementService,
               :PremiumRateService, :ProductService,
               :ProductTemplateService, :ProposalLineItemService,
               :ProposalService, :PublisherQueryLanguageService,
               :RateCardService, :ReconciliationOrderReportService,
               :ReconciliationLineItemReportService,
               :ReconciliationReportRowService,
               :ReconciliationReportService, :ReportService,
               :SuggestedAdUnitService, :TeamService, :UserService,
               :UserTeamAssociationService, :WorkflowRequestService],
  :v201802 => [:ActivityGroupService, :ActivityService,
               :AdExclusionRuleService, :AdRuleService,
               :AudienceSegmentService, :BaseRateService, :CompanyService,
               :CdnConfigurationService, :ContactService,
               :ContentBundleService, :ContentMetadataKeyHierarchyService,
               :ContentService, :CreativeService, :CreativeSetService,
               :CreativeTemplateService, :CreativeWrapperService,
               :CustomFieldService, :CustomTargetingService,
               :ExchangeRateService, :ForecastService, :InventoryService,
               :LabelService, :LineItemCreativeAssociationService,
               :LineItemService, :LineItemTemplateService,
               :LiveStreamEventService, :MobileApplicationService,
               :NativeStyleService, :NetworkService, :OrderService,
               :PackageService, :ProductPackageService,
               :ProductPackageItemService, :PlacementService,
               :PremiumRateService, :ProductService,
               :ProductTemplateService, :ProposalLineItemService,
               :ProposalService, :PublisherQueryLanguageService,
               :RateCardService, :ReconciliationOrderReportService,
               :ReconciliationLineItemReportService,
               :ReconciliationReportRowService,
               :ReconciliationReportService, :ReportService,
               :SuggestedAdUnitService, :TeamService, :UserService,
               :UserTeamAssociationService, :WorkflowRequestService]
}
@@config =

Configure the base URL for each version and scope.

{
  :oauth_scope => 'https://www.googleapis.com/auth/dfp',
  :header_ns => 'https://www.google.com/apis/ads/publisher/',
  :v201705 => 'https://ads.google.com/apis/ads/publisher/',
  :v201708 => 'https://ads.google.com/apis/ads/publisher/',
  :v201711 => 'https://ads.google.com/apis/ads/publisher/',
  :v201802 => 'https://ads.google.com/apis/ads/publisher/'
}

Class Method Summary collapse

Class Method Details

.api_name ⇒ Object



162
163
164
# File 'lib/dfp_api/api_config.rb', line 162

def self.api_name
  API_NAME
end

.config(key) ⇒ Object



170
171
172
# File 'lib/dfp_api/api_config.rb', line 170

def self.config(key)
  @@config[key]
end

.default_config_filename ⇒ Object



178
179
180
# File 'lib/dfp_api/api_config.rb', line 178

def self.default_config_filename
  DEFAULT_CONFIG_FILENAME
end

.default_version ⇒ Object

Getters for constants and module variables.



154
155
156
# File 'lib/dfp_api/api_config.rb', line 154

def self.default_version
  DEFAULT_VERSION
end

.latest_version ⇒ Object



158
159
160
# File 'lib/dfp_api/api_config.rb', line 158

def self.latest_version
  LATEST_VERSION
end

.service_config ⇒ Object



166
167
168
# File 'lib/dfp_api/api_config.rb', line 166

def self.service_config
  @@service_config
end

.subdir_config ⇒ Object



174
175
176
# File 'lib/dfp_api/api_config.rb', line 174

def self.subdir_config
  nil
end