google-adwords-api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +178 -0
- data/Rakefile +117 -0
- data/adwords_api.yml +21 -0
- data/examples/v200909/add_ad_extension_override.rb +91 -0
- data/examples/v200909/add_ad_group.rb +98 -0
- data/examples/v200909/add_ad_group_criteria.rb +117 -0
- data/examples/v200909/add_ads.rb +129 -0
- data/examples/v200909/add_campaign.rb +101 -0
- data/examples/v200909/add_campaign_ad_extension.rb +130 -0
- data/examples/v200909/add_negative_campaign_criterion.rb +96 -0
- data/examples/v200909/check_campaigns.rb +132 -0
- data/examples/v200909/delete_ad.rb +94 -0
- data/examples/v200909/delete_ad_group.rb +86 -0
- data/examples/v200909/delete_ad_group_criterion.rb +95 -0
- data/examples/v200909/delete_campaign.rb +87 -0
- data/examples/v200909/get_all_active_ad_group_criteria.rb +93 -0
- data/examples/v200909/get_all_ad_extension_overrides.rb +91 -0
- data/examples/v200909/get_all_ad_group_criteria.rb +91 -0
- data/examples/v200909/get_all_ad_groups.rb +88 -0
- data/examples/v200909/get_all_ad_params.rb +89 -0
- data/examples/v200909/get_all_ads.rb +88 -0
- data/examples/v200909/get_all_campaign_ad_extensions.rb +90 -0
- data/examples/v200909/get_all_campaign_targets.rb +83 -0
- data/examples/v200909/get_all_campaigns.rb +83 -0
- data/examples/v200909/get_all_disapproved_ads.rb +94 -0
- data/examples/v200909/get_all_paused_campaigns.rb +86 -0
- data/examples/v200909/get_conversion_optimizer_eligibility.rb +112 -0
- data/examples/v200909/get_geo_location_info.rb +108 -0
- data/examples/v200909/get_method_cost.rb +96 -0
- data/examples/v200909/get_operation_count.rb +88 -0
- data/examples/v200909/get_related_keywords.rb +115 -0
- data/examples/v200909/get_related_placements.rb +114 -0
- data/examples/v200909/get_total_usage_units_per_month.rb +83 -0
- data/examples/v200909/get_unit_count.rb +88 -0
- data/examples/v200909/perform_bulk_mutate_job.rb +221 -0
- data/examples/v200909/set_ad_params.rb +124 -0
- data/examples/v200909/set_campaign_targets.rb +125 -0
- data/examples/v200909/update_ad.rb +95 -0
- data/examples/v200909/update_ad_group.rb +90 -0
- data/examples/v200909/update_ad_group_criterion.rb +108 -0
- data/examples/v200909/update_campaign.rb +93 -0
- data/examples/v201003/add_ad_extension_override.rb +91 -0
- data/examples/v201003/add_ad_group.rb +98 -0
- data/examples/v201003/add_ad_group_criteria.rb +117 -0
- data/examples/v201003/add_ads.rb +182 -0
- data/examples/v201003/add_campaign.rb +101 -0
- data/examples/v201003/add_campaign_ad_extension.rb +130 -0
- data/examples/v201003/add_keywords_performance_report_definition.rb +108 -0
- data/examples/v201003/add_negative_campaign_criterion.rb +96 -0
- data/examples/v201003/check_campaigns.rb +132 -0
- data/examples/v201003/delete_ad.rb +94 -0
- data/examples/v201003/delete_ad_group.rb +86 -0
- data/examples/v201003/delete_ad_group_criterion.rb +95 -0
- data/examples/v201003/delete_campaign.rb +87 -0
- data/examples/v201003/download_report.rb +71 -0
- data/examples/v201003/get_all_active_ad_group_criteria.rb +93 -0
- data/examples/v201003/get_all_ad_extension_overrides.rb +91 -0
- data/examples/v201003/get_all_ad_group_criteria.rb +91 -0
- data/examples/v201003/get_all_ad_groups.rb +88 -0
- data/examples/v201003/get_all_ad_params.rb +89 -0
- data/examples/v201003/get_all_ads.rb +91 -0
- data/examples/v201003/get_all_campaign_ad_extensions.rb +90 -0
- data/examples/v201003/get_all_campaign_targets.rb +83 -0
- data/examples/v201003/get_all_campaigns.rb +83 -0
- data/examples/v201003/get_all_disapproved_ads.rb +94 -0
- data/examples/v201003/get_all_images.rb +88 -0
- data/examples/v201003/get_all_paused_campaigns.rb +86 -0
- data/examples/v201003/get_all_report_definitions.rb +84 -0
- data/examples/v201003/get_all_videos.rb +85 -0
- data/examples/v201003/get_conversion_optimizer_eligibility.rb +112 -0
- data/examples/v201003/get_criterion_bid_landscape.rb +105 -0
- data/examples/v201003/get_geo_location_info.rb +108 -0
- data/examples/v201003/get_method_cost.rb +96 -0
- data/examples/v201003/get_operation_count.rb +88 -0
- data/examples/v201003/get_related_keywords.rb +115 -0
- data/examples/v201003/get_related_placements.rb +114 -0
- data/examples/v201003/get_report_fields.rb +81 -0
- data/examples/v201003/get_total_usage_units_per_month.rb +83 -0
- data/examples/v201003/get_unit_count.rb +88 -0
- data/examples/v201003/perform_bulk_mutate_job.rb +221 -0
- data/examples/v201003/set_ad_params.rb +124 -0
- data/examples/v201003/set_campaign_targets.rb +125 -0
- data/examples/v201003/update_ad.rb +95 -0
- data/examples/v201003/update_ad_group.rb +90 -0
- data/examples/v201003/update_ad_group_criterion.rb +108 -0
- data/examples/v201003/update_campaign.rb +92 -0
- data/examples/v201003/upload_image.rb +97 -0
- data/examples/v201008/add_ad_extension_override.rb +91 -0
- data/examples/v201008/add_ad_group.rb +98 -0
- data/examples/v201008/add_ad_group_criteria.rb +117 -0
- data/examples/v201008/add_ads.rb +182 -0
- data/examples/v201008/add_campaign.rb +101 -0
- data/examples/v201008/add_campaign_ad_extension.rb +130 -0
- data/examples/v201008/add_experiment.rb +162 -0
- data/examples/v201008/add_keywords_performance_report_definition.rb +108 -0
- data/examples/v201008/add_negative_campaign_criterion.rb +96 -0
- data/examples/v201008/add_user_list.rb +96 -0
- data/examples/v201008/check_campaigns.rb +132 -0
- data/examples/v201008/delete_ad.rb +94 -0
- data/examples/v201008/delete_ad_group.rb +86 -0
- data/examples/v201008/delete_ad_group_criterion.rb +95 -0
- data/examples/v201008/delete_bulk_mutate_job.rb +96 -0
- data/examples/v201008/delete_campaign.rb +87 -0
- data/examples/v201008/delete_experiment.rb +87 -0
- data/examples/v201008/delete_user_list.rb +87 -0
- data/examples/v201008/download_report.rb +71 -0
- data/examples/v201008/get_account_hierarchy.rb +112 -0
- data/examples/v201008/get_all_account_changes.rb +144 -0
- data/examples/v201008/get_all_active_ad_group_criteria.rb +93 -0
- data/examples/v201008/get_all_ad_extension_overrides.rb +91 -0
- data/examples/v201008/get_all_ad_group_criteria.rb +91 -0
- data/examples/v201008/get_all_ad_groups.rb +88 -0
- data/examples/v201008/get_all_ad_params.rb +89 -0
- data/examples/v201008/get_all_ads.rb +91 -0
- data/examples/v201008/get_all_campaign_ad_extensions.rb +90 -0
- data/examples/v201008/get_all_campaign_targets.rb +83 -0
- data/examples/v201008/get_all_campaigns.rb +83 -0
- data/examples/v201008/get_all_disapproved_ads.rb +94 -0
- data/examples/v201008/get_all_experiments.rb +93 -0
- data/examples/v201008/get_all_images.rb +88 -0
- data/examples/v201008/get_all_paused_campaigns.rb +86 -0
- data/examples/v201008/get_all_report_definitions.rb +84 -0
- data/examples/v201008/get_all_user_lists.rb +84 -0
- data/examples/v201008/get_all_videos.rb +85 -0
- data/examples/v201008/get_bulk_mutate_job.rb +106 -0
- data/examples/v201008/get_campaign_alerts.rb +103 -0
- data/examples/v201008/get_conversion_optimizer_eligibility.rb +97 -0
- data/examples/v201008/get_criterion_bid_landscape.rb +105 -0
- data/examples/v201008/get_geo_location_info.rb +108 -0
- data/examples/v201008/get_method_cost.rb +96 -0
- data/examples/v201008/get_operation_count.rb +88 -0
- data/examples/v201008/get_related_keywords.rb +115 -0
- data/examples/v201008/get_related_placements.rb +114 -0
- data/examples/v201008/get_report_fields.rb +81 -0
- data/examples/v201008/get_total_usage_units_per_month.rb +83 -0
- data/examples/v201008/get_traffic_estimates.rb +156 -0
- data/examples/v201008/get_unit_count.rb +88 -0
- data/examples/v201008/handle_partial_failures.rb +135 -0
- data/examples/v201008/handle_policy_violation_error.rb +146 -0
- data/examples/v201008/perform_bulk_mutate_job.rb +221 -0
- data/examples/v201008/promote_experiment.rb +88 -0
- data/examples/v201008/set_ad_params.rb +124 -0
- data/examples/v201008/set_campaign_targets.rb +125 -0
- data/examples/v201008/update_ad.rb +95 -0
- data/examples/v201008/update_ad_group.rb +90 -0
- data/examples/v201008/update_ad_group_criterion.rb +108 -0
- data/examples/v201008/update_campaign.rb +93 -0
- data/examples/v201008/update_user_list.rb +91 -0
- data/examples/v201008/upload_image.rb +97 -0
- data/examples/v201101/add_ad_extension_override.rb +91 -0
- data/examples/v201101/add_ad_group.rb +98 -0
- data/examples/v201101/add_ad_group_criteria.rb +117 -0
- data/examples/v201101/add_ads.rb +182 -0
- data/examples/v201101/add_campaign.rb +108 -0
- data/examples/v201101/add_campaign_ad_extension.rb +130 -0
- data/examples/v201101/add_experiment.rb +162 -0
- data/examples/v201101/add_keywords_performance_report_definition.rb +108 -0
- data/examples/v201101/add_mcc_report_definition.rb +103 -0
- data/examples/v201101/add_negative_campaign_criterion.rb +96 -0
- data/examples/v201101/add_user_list.rb +96 -0
- data/examples/v201101/check_campaigns.rb +132 -0
- data/examples/v201101/delete_ad.rb +94 -0
- data/examples/v201101/delete_ad_group.rb +86 -0
- data/examples/v201101/delete_ad_group_criterion.rb +95 -0
- data/examples/v201101/delete_bulk_mutate_job.rb +96 -0
- data/examples/v201101/delete_campaign.rb +87 -0
- data/examples/v201101/delete_experiment.rb +87 -0
- data/examples/v201101/delete_user_list.rb +87 -0
- data/examples/v201101/download_mcc_report.rb +93 -0
- data/examples/v201101/download_report.rb +71 -0
- data/examples/v201101/get_account_hierarchy.rb +112 -0
- data/examples/v201101/get_ad_group_bid_landscape.rb +103 -0
- data/examples/v201101/get_all_account_changes.rb +146 -0
- data/examples/v201101/get_all_active_ad_group_criteria.rb +106 -0
- data/examples/v201101/get_all_ad_extension_overrides.rb +91 -0
- data/examples/v201101/get_all_ad_group_criteria.rb +97 -0
- data/examples/v201101/get_all_ad_groups.rb +94 -0
- data/examples/v201101/get_all_ad_params.rb +89 -0
- data/examples/v201101/get_all_ads.rb +99 -0
- data/examples/v201101/get_all_campaign_ad_extensions.rb +96 -0
- data/examples/v201101/get_all_campaign_targets.rb +83 -0
- data/examples/v201101/get_all_campaigns.rb +86 -0
- data/examples/v201101/get_all_disapproved_ads.rb +102 -0
- data/examples/v201101/get_all_experiments.rb +98 -0
- data/examples/v201101/get_all_images.rb +90 -0
- data/examples/v201101/get_all_paused_campaigns.rb +92 -0
- data/examples/v201101/get_all_report_definitions.rb +84 -0
- data/examples/v201101/get_all_user_lists.rb +87 -0
- data/examples/v201101/get_all_videos.rb +87 -0
- data/examples/v201101/get_bulk_mutate_job.rb +106 -0
- data/examples/v201101/get_campaign_alerts.rb +103 -0
- data/examples/v201101/get_conversion_optimizer_eligibility.rb +102 -0
- data/examples/v201101/get_criterion_bid_landscape.rb +102 -0
- data/examples/v201101/get_geo_location_info.rb +108 -0
- data/examples/v201101/get_method_cost.rb +96 -0
- data/examples/v201101/get_operation_count.rb +88 -0
- data/examples/v201101/get_related_keywords.rb +115 -0
- data/examples/v201101/get_related_placements.rb +114 -0
- data/examples/v201101/get_report_fields.rb +81 -0
- data/examples/v201101/get_total_usage_units_per_month.rb +83 -0
- data/examples/v201101/get_traffic_estimates.rb +157 -0
- data/examples/v201101/get_unit_count.rb +88 -0
- data/examples/v201101/handle_partial_failures.rb +135 -0
- data/examples/v201101/handle_policy_violation_error.rb +146 -0
- data/examples/v201101/perform_bulk_mutate_job.rb +221 -0
- data/examples/v201101/promote_experiment.rb +88 -0
- data/examples/v201101/set_ad_params.rb +124 -0
- data/examples/v201101/set_campaign_targets.rb +111 -0
- data/examples/v201101/update_ad.rb +95 -0
- data/examples/v201101/update_ad_group.rb +90 -0
- data/examples/v201101/update_ad_group_criterion.rb +108 -0
- data/examples/v201101/update_campaign.rb +93 -0
- data/examples/v201101/update_user_list.rb +91 -0
- data/examples/v201101/upload_image.rb +97 -0
- data/lib/adwords_api.rb +273 -0
- data/lib/adwords_api/api_config.rb +270 -0
- data/lib/adwords_api/auth/v13_login_handler.rb +36 -0
- data/lib/adwords_api/credential_handler.rb +111 -0
- data/lib/adwords_api/errors.rb +85 -0
- data/lib/adwords_api/extensions.rb +245 -0
- data/lib/adwords_api/soap4r_response_handler.rb +121 -0
- data/lib/adwords_api/utils.rb +80 -0
- data/lib/adwords_api/v13/AccountService.rb +321 -0
- data/lib/adwords_api/v13/AccountServiceDriver.rb +87 -0
- data/lib/adwords_api/v13/AccountServiceMappingRegistry.rb +337 -0
- data/lib/adwords_api/v13/AccountServiceWrapper.rb +407 -0
- data/lib/adwords_api/v13/ReportService.rb +328 -0
- data/lib/adwords_api/v13/ReportServiceDriver.rb +103 -0
- data/lib/adwords_api/v13/ReportServiceMappingRegistry.rb +298 -0
- data/lib/adwords_api/v13/ReportServiceWrapper.rb +500 -0
- data/lib/adwords_api/v13/TrafficEstimatorService.rb +414 -0
- data/lib/adwords_api/v13/TrafficEstimatorServiceDriver.rb +79 -0
- data/lib/adwords_api/v13/TrafficEstimatorServiceMappingRegistry.rb +491 -0
- data/lib/adwords_api/v13/TrafficEstimatorServiceWrapper.rb +402 -0
- data/lib/adwords_api/v200909/AdExtensionOverrideService.rb +1105 -0
- data/lib/adwords_api/v200909/AdExtensionOverrideServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/AdExtensionOverrideServiceMappingRegistry.rb +1265 -0
- data/lib/adwords_api/v200909/AdExtensionOverrideServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/AdGroupAdService.rb +2603 -0
- data/lib/adwords_api/v200909/AdGroupAdServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/AdGroupAdServiceMappingRegistry.rb +2755 -0
- data/lib/adwords_api/v200909/AdGroupAdServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/AdGroupCriterionService.rb +1577 -0
- data/lib/adwords_api/v200909/AdGroupCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/AdGroupCriterionServiceMappingRegistry.rb +1821 -0
- data/lib/adwords_api/v200909/AdGroupCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/AdGroupService.rb +1251 -0
- data/lib/adwords_api/v200909/AdGroupServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/AdGroupServiceMappingRegistry.rb +1395 -0
- data/lib/adwords_api/v200909/AdGroupServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/AdParamService.rb +765 -0
- data/lib/adwords_api/v200909/AdParamServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/AdParamServiceMappingRegistry.rb +927 -0
- data/lib/adwords_api/v200909/AdParamServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/BulkMutateJobService.rb +4778 -0
- data/lib/adwords_api/v200909/BulkMutateJobServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/BulkMutateJobServiceMappingRegistry.rb +5077 -0
- data/lib/adwords_api/v200909/BulkMutateJobServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/CampaignAdExtensionService.rb +1065 -0
- data/lib/adwords_api/v200909/CampaignAdExtensionServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/CampaignAdExtensionServiceMappingRegistry.rb +1273 -0
- data/lib/adwords_api/v200909/CampaignAdExtensionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/CampaignCriterionService.rb +1019 -0
- data/lib/adwords_api/v200909/CampaignCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/CampaignCriterionServiceMappingRegistry.rb +1237 -0
- data/lib/adwords_api/v200909/CampaignCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/CampaignService.rb +1633 -0
- data/lib/adwords_api/v200909/CampaignServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/CampaignServiceMappingRegistry.rb +1785 -0
- data/lib/adwords_api/v200909/CampaignServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/CampaignTargetService.rb +1435 -0
- data/lib/adwords_api/v200909/CampaignTargetServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/CampaignTargetServiceMappingRegistry.rb +1569 -0
- data/lib/adwords_api/v200909/CampaignTargetServiceWrapper.rb +332 -0
- data/lib/adwords_api/v200909/GeoLocationService.rb +611 -0
- data/lib/adwords_api/v200909/GeoLocationServiceDriver.rb +55 -0
- data/lib/adwords_api/v200909/GeoLocationServiceMappingRegistry.rb +771 -0
- data/lib/adwords_api/v200909/GeoLocationServiceWrapper.rb +303 -0
- data/lib/adwords_api/v200909/InfoService.rb +605 -0
- data/lib/adwords_api/v200909/InfoServiceDriver.rb +55 -0
- data/lib/adwords_api/v200909/InfoServiceMappingRegistry.rb +764 -0
- data/lib/adwords_api/v200909/InfoServiceWrapper.rb +303 -0
- data/lib/adwords_api/v200909/TargetingIdeaService.rb +2253 -0
- data/lib/adwords_api/v200909/TargetingIdeaServiceDriver.rb +63 -0
- data/lib/adwords_api/v200909/TargetingIdeaServiceMappingRegistry.rb +2688 -0
- data/lib/adwords_api/v200909/TargetingIdeaServiceWrapper.rb +335 -0
- data/lib/adwords_api/v201003/AdExtensionOverrideService.rb +1301 -0
- data/lib/adwords_api/v201003/AdExtensionOverrideServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/AdExtensionOverrideServiceMappingRegistry.rb +1468 -0
- data/lib/adwords_api/v201003/AdExtensionOverrideServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/AdGroupAdService.rb +2909 -0
- data/lib/adwords_api/v201003/AdGroupAdServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/AdGroupAdServiceMappingRegistry.rb +2970 -0
- data/lib/adwords_api/v201003/AdGroupAdServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/AdGroupCriterionService.rb +1762 -0
- data/lib/adwords_api/v201003/AdGroupCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/AdGroupCriterionServiceMappingRegistry.rb +1978 -0
- data/lib/adwords_api/v201003/AdGroupCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/AdGroupService.rb +1421 -0
- data/lib/adwords_api/v201003/AdGroupServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/AdGroupServiceMappingRegistry.rb +1546 -0
- data/lib/adwords_api/v201003/AdGroupServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/AdParamService.rb +859 -0
- data/lib/adwords_api/v201003/AdParamServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/AdParamServiceMappingRegistry.rb +1002 -0
- data/lib/adwords_api/v201003/AdParamServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/BidLandscapeService.rb +847 -0
- data/lib/adwords_api/v201003/BidLandscapeServiceDriver.rb +55 -0
- data/lib/adwords_api/v201003/BidLandscapeServiceMappingRegistry.rb +958 -0
- data/lib/adwords_api/v201003/BidLandscapeServiceWrapper.rb +306 -0
- data/lib/adwords_api/v201003/BulkMutateJobService.rb +5401 -0
- data/lib/adwords_api/v201003/BulkMutateJobServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/BulkMutateJobServiceMappingRegistry.rb +5600 -0
- data/lib/adwords_api/v201003/BulkMutateJobServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/CampaignAdExtensionService.rb +1255 -0
- data/lib/adwords_api/v201003/CampaignAdExtensionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/CampaignAdExtensionServiceMappingRegistry.rb +1452 -0
- data/lib/adwords_api/v201003/CampaignAdExtensionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/CampaignCriterionService.rb +1145 -0
- data/lib/adwords_api/v201003/CampaignCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/CampaignCriterionServiceMappingRegistry.rb +1344 -0
- data/lib/adwords_api/v201003/CampaignCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/CampaignService.rb +1901 -0
- data/lib/adwords_api/v201003/CampaignServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/CampaignServiceMappingRegistry.rb +2010 -0
- data/lib/adwords_api/v201003/CampaignServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/CampaignTargetService.rb +1642 -0
- data/lib/adwords_api/v201003/CampaignTargetServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/CampaignTargetServiceMappingRegistry.rb +1754 -0
- data/lib/adwords_api/v201003/CampaignTargetServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/GeoLocationService.rb +692 -0
- data/lib/adwords_api/v201003/GeoLocationServiceDriver.rb +55 -0
- data/lib/adwords_api/v201003/GeoLocationServiceMappingRegistry.rb +840 -0
- data/lib/adwords_api/v201003/GeoLocationServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201003/InfoService.rb +687 -0
- data/lib/adwords_api/v201003/InfoServiceDriver.rb +55 -0
- data/lib/adwords_api/v201003/InfoServiceMappingRegistry.rb +833 -0
- data/lib/adwords_api/v201003/InfoServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201003/MediaService.rb +1192 -0
- data/lib/adwords_api/v201003/MediaServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/MediaServiceMappingRegistry.rb +1290 -0
- data/lib/adwords_api/v201003/MediaServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201003/ReportDefinitionService.rb +905 -0
- data/lib/adwords_api/v201003/ReportDefinitionServiceDriver.rb +71 -0
- data/lib/adwords_api/v201003/ReportDefinitionServiceMappingRegistry.rb +1036 -0
- data/lib/adwords_api/v201003/ReportDefinitionServiceWrapper.rb +378 -0
- data/lib/adwords_api/v201003/TargetingIdeaService.rb +2517 -0
- data/lib/adwords_api/v201003/TargetingIdeaServiceDriver.rb +63 -0
- data/lib/adwords_api/v201003/TargetingIdeaServiceMappingRegistry.rb +2925 -0
- data/lib/adwords_api/v201003/TargetingIdeaServiceWrapper.rb +335 -0
- data/lib/adwords_api/v201008/AdExtensionOverrideService.rb +1383 -0
- data/lib/adwords_api/v201008/AdExtensionOverrideServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/AdExtensionOverrideServiceMappingRegistry.rb +1563 -0
- data/lib/adwords_api/v201008/AdExtensionOverrideServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/AdGroupAdService.rb +2928 -0
- data/lib/adwords_api/v201008/AdGroupAdServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/AdGroupAdServiceMappingRegistry.rb +2969 -0
- data/lib/adwords_api/v201008/AdGroupAdServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/AdGroupCriterionService.rb +1981 -0
- data/lib/adwords_api/v201008/AdGroupCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/AdGroupCriterionServiceMappingRegistry.rb +2229 -0
- data/lib/adwords_api/v201008/AdGroupCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/AdGroupService.rb +1548 -0
- data/lib/adwords_api/v201008/AdGroupServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/AdGroupServiceMappingRegistry.rb +1687 -0
- data/lib/adwords_api/v201008/AdGroupServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/AdParamService.rb +889 -0
- data/lib/adwords_api/v201008/AdParamServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/AdParamServiceMappingRegistry.rb +1041 -0
- data/lib/adwords_api/v201008/AdParamServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/AlertService.rb +743 -0
- data/lib/adwords_api/v201008/AlertServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/AlertServiceMappingRegistry.rb +836 -0
- data/lib/adwords_api/v201008/AlertServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201008/BidLandscapeService.rb +928 -0
- data/lib/adwords_api/v201008/BidLandscapeServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/BidLandscapeServiceMappingRegistry.rb +1059 -0
- data/lib/adwords_api/v201008/BidLandscapeServiceWrapper.rb +306 -0
- data/lib/adwords_api/v201008/BulkMutateJobService.rb +6063 -0
- data/lib/adwords_api/v201008/BulkMutateJobServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/BulkMutateJobServiceMappingRegistry.rb +6265 -0
- data/lib/adwords_api/v201008/BulkMutateJobServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/CampaignAdExtensionService.rb +1594 -0
- data/lib/adwords_api/v201008/CampaignAdExtensionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/CampaignAdExtensionServiceMappingRegistry.rb +1789 -0
- data/lib/adwords_api/v201008/CampaignAdExtensionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/CampaignCriterionService.rb +1243 -0
- data/lib/adwords_api/v201008/CampaignCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/CampaignCriterionServiceMappingRegistry.rb +1467 -0
- data/lib/adwords_api/v201008/CampaignCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/CampaignService.rb +1979 -0
- data/lib/adwords_api/v201008/CampaignServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/CampaignServiceMappingRegistry.rb +2089 -0
- data/lib/adwords_api/v201008/CampaignServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/CampaignTargetService.rb +1651 -0
- data/lib/adwords_api/v201008/CampaignTargetServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/CampaignTargetServiceMappingRegistry.rb +1757 -0
- data/lib/adwords_api/v201008/CampaignTargetServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/CustomerSyncService.rb +693 -0
- data/lib/adwords_api/v201008/CustomerSyncServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/CustomerSyncServiceMappingRegistry.rb +820 -0
- data/lib/adwords_api/v201008/CustomerSyncServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201008/ExperimentService.rb +1124 -0
- data/lib/adwords_api/v201008/ExperimentServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/ExperimentServiceMappingRegistry.rb +1281 -0
- data/lib/adwords_api/v201008/ExperimentServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/GeoLocationService.rb +695 -0
- data/lib/adwords_api/v201008/GeoLocationServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/GeoLocationServiceMappingRegistry.rb +843 -0
- data/lib/adwords_api/v201008/GeoLocationServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201008/InfoService.rb +690 -0
- data/lib/adwords_api/v201008/InfoServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/InfoServiceMappingRegistry.rb +836 -0
- data/lib/adwords_api/v201008/InfoServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201008/MediaService.rb +1144 -0
- data/lib/adwords_api/v201008/MediaServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/MediaServiceMappingRegistry.rb +1241 -0
- data/lib/adwords_api/v201008/MediaServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201008/ReportDefinitionService.rb +976 -0
- data/lib/adwords_api/v201008/ReportDefinitionServiceDriver.rb +71 -0
- data/lib/adwords_api/v201008/ReportDefinitionServiceMappingRegistry.rb +1115 -0
- data/lib/adwords_api/v201008/ReportDefinitionServiceWrapper.rb +378 -0
- data/lib/adwords_api/v201008/ServicedAccountService.rb +630 -0
- data/lib/adwords_api/v201008/ServicedAccountServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/ServicedAccountServiceMappingRegistry.rb +752 -0
- data/lib/adwords_api/v201008/ServicedAccountServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201008/TargetingIdeaService.rb +2645 -0
- data/lib/adwords_api/v201008/TargetingIdeaServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/TargetingIdeaServiceMappingRegistry.rb +3080 -0
- data/lib/adwords_api/v201008/TargetingIdeaServiceWrapper.rb +335 -0
- data/lib/adwords_api/v201008/TrafficEstimatorService.rb +1833 -0
- data/lib/adwords_api/v201008/TrafficEstimatorServiceDriver.rb +55 -0
- data/lib/adwords_api/v201008/TrafficEstimatorServiceMappingRegistry.rb +2124 -0
- data/lib/adwords_api/v201008/TrafficEstimatorServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201008/UserListService.rb +846 -0
- data/lib/adwords_api/v201008/UserListServiceDriver.rb +63 -0
- data/lib/adwords_api/v201008/UserListServiceMappingRegistry.rb +915 -0
- data/lib/adwords_api/v201008/UserListServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/AdExtensionOverrideService.rb +1399 -0
- data/lib/adwords_api/v201101/AdExtensionOverrideServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/AdExtensionOverrideServiceMappingRegistry.rb +1573 -0
- data/lib/adwords_api/v201101/AdExtensionOverrideServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/AdGroupAdService.rb +2585 -0
- data/lib/adwords_api/v201101/AdGroupAdServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/AdGroupAdServiceMappingRegistry.rb +2583 -0
- data/lib/adwords_api/v201101/AdGroupAdServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/AdGroupCriterionService.rb +2099 -0
- data/lib/adwords_api/v201101/AdGroupCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/AdGroupCriterionServiceMappingRegistry.rb +2327 -0
- data/lib/adwords_api/v201101/AdGroupCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/AdGroupService.rb +1610 -0
- data/lib/adwords_api/v201101/AdGroupServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/AdGroupServiceMappingRegistry.rb +1765 -0
- data/lib/adwords_api/v201101/AdGroupServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/AdParamService.rb +922 -0
- data/lib/adwords_api/v201101/AdParamServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/AdParamServiceMappingRegistry.rb +1077 -0
- data/lib/adwords_api/v201101/AdParamServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/AlertService.rb +747 -0
- data/lib/adwords_api/v201101/AlertServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/AlertServiceMappingRegistry.rb +838 -0
- data/lib/adwords_api/v201101/AlertServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/BulkMutateJobService.rb +6208 -0
- data/lib/adwords_api/v201101/BulkMutateJobServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/BulkMutateJobServiceMappingRegistry.rb +6433 -0
- data/lib/adwords_api/v201101/BulkMutateJobServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/CampaignAdExtensionService.rb +1677 -0
- data/lib/adwords_api/v201101/CampaignAdExtensionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/CampaignAdExtensionServiceMappingRegistry.rb +1855 -0
- data/lib/adwords_api/v201101/CampaignAdExtensionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/CampaignCriterionService.rb +1388 -0
- data/lib/adwords_api/v201101/CampaignCriterionServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/CampaignCriterionServiceMappingRegistry.rb +1601 -0
- data/lib/adwords_api/v201101/CampaignCriterionServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/CampaignService.rb +2188 -0
- data/lib/adwords_api/v201101/CampaignServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/CampaignServiceMappingRegistry.rb +2301 -0
- data/lib/adwords_api/v201101/CampaignServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/CampaignTargetService.rb +1629 -0
- data/lib/adwords_api/v201101/CampaignTargetServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/CampaignTargetServiceMappingRegistry.rb +1725 -0
- data/lib/adwords_api/v201101/CampaignTargetServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/CustomerSyncService.rb +694 -0
- data/lib/adwords_api/v201101/CustomerSyncServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/CustomerSyncServiceMappingRegistry.rb +820 -0
- data/lib/adwords_api/v201101/CustomerSyncServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/DataService.rb +1079 -0
- data/lib/adwords_api/v201101/DataServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/DataServiceMappingRegistry.rb +1177 -0
- data/lib/adwords_api/v201101/DataServiceWrapper.rb +338 -0
- data/lib/adwords_api/v201101/ExperimentService.rb +1256 -0
- data/lib/adwords_api/v201101/ExperimentServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/ExperimentServiceMappingRegistry.rb +1417 -0
- data/lib/adwords_api/v201101/ExperimentServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/GeoLocationService.rb +695 -0
- data/lib/adwords_api/v201101/GeoLocationServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/GeoLocationServiceMappingRegistry.rb +843 -0
- data/lib/adwords_api/v201101/GeoLocationServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/InfoService.rb +690 -0
- data/lib/adwords_api/v201101/InfoServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/InfoServiceMappingRegistry.rb +836 -0
- data/lib/adwords_api/v201101/InfoServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/MediaService.rb +1247 -0
- data/lib/adwords_api/v201101/MediaServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/MediaServiceMappingRegistry.rb +1357 -0
- data/lib/adwords_api/v201101/MediaServiceWrapper.rb +332 -0
- data/lib/adwords_api/v201101/ReportDefinitionService.rb +1121 -0
- data/lib/adwords_api/v201101/ReportDefinitionServiceDriver.rb +71 -0
- data/lib/adwords_api/v201101/ReportDefinitionServiceMappingRegistry.rb +1263 -0
- data/lib/adwords_api/v201101/ReportDefinitionServiceWrapper.rb +364 -0
- data/lib/adwords_api/v201101/ServicedAccountService.rb +636 -0
- data/lib/adwords_api/v201101/ServicedAccountServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/ServicedAccountServiceMappingRegistry.rb +756 -0
- data/lib/adwords_api/v201101/ServicedAccountServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/TargetingIdeaService.rb +2827 -0
- data/lib/adwords_api/v201101/TargetingIdeaServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/TargetingIdeaServiceMappingRegistry.rb +3262 -0
- data/lib/adwords_api/v201101/TargetingIdeaServiceWrapper.rb +335 -0
- data/lib/adwords_api/v201101/TrafficEstimatorService.rb +1839 -0
- data/lib/adwords_api/v201101/TrafficEstimatorServiceDriver.rb +55 -0
- data/lib/adwords_api/v201101/TrafficEstimatorServiceMappingRegistry.rb +2128 -0
- data/lib/adwords_api/v201101/TrafficEstimatorServiceWrapper.rb +303 -0
- data/lib/adwords_api/v201101/UserListService.rb +1206 -0
- data/lib/adwords_api/v201101/UserListServiceDriver.rb +63 -0
- data/lib/adwords_api/v201101/UserListServiceMappingRegistry.rb +1323 -0
- data/lib/adwords_api/v201101/UserListServiceWrapper.rb +332 -0
- metadata +649 -0
@@ -0,0 +1,270 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
+
#
|
7
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
+
# implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
# Helper methods for loading and managing the available services in the AdWords
|
21
|
+
# API.
|
22
|
+
|
23
|
+
require 'ads_common/api_config'
|
24
|
+
|
25
|
+
module AdwordsApi
|
26
|
+
|
27
|
+
# Contains helper methods for loading and managing the available services.
|
28
|
+
module ApiConfig
|
29
|
+
|
30
|
+
# Inherit from AdsCommon::ApiConfig
|
31
|
+
class << ApiConfig
|
32
|
+
include AdsCommon::ApiConfig
|
33
|
+
end
|
34
|
+
|
35
|
+
# Set defaults
|
36
|
+
DEFAULT_VERSION = :v201101
|
37
|
+
DEFAULT_ENVIRONMENT = :PRODUCTION
|
38
|
+
LATEST_VERSION = :v201101
|
39
|
+
|
40
|
+
# Set other constants
|
41
|
+
API_NAME = 'AdwordsApi'
|
42
|
+
API_PATH = 'adwords_api'
|
43
|
+
CLIENT_LIB_VERSION = '0.1.0'
|
44
|
+
|
45
|
+
# Configure the services available to each version
|
46
|
+
@@service_config = {
|
47
|
+
:v13 => [:AccountService, :ReportService, :TrafficEstimatorService],
|
48
|
+
:v200909 => [:AdExtensionOverrideService, :AdGroupAdService,
|
49
|
+
:AdGroupCriterionService, :AdGroupService, :AdParamService,
|
50
|
+
:BulkMutateJobService, :CampaignAdExtensionService,
|
51
|
+
:CampaignCriterionService, :CampaignService,
|
52
|
+
:CampaignTargetService, :GeoLocationService, :InfoService,
|
53
|
+
:TargetingIdeaService],
|
54
|
+
:v201003 => [:AdExtensionOverrideService, :AdGroupAdService,
|
55
|
+
:AdGroupCriterionService, :AdGroupService, :AdParamService,
|
56
|
+
:BidLandscapeService, :BulkMutateJobService,
|
57
|
+
:CampaignAdExtensionService, :CampaignCriterionService,
|
58
|
+
:CampaignService, :CampaignTargetService,
|
59
|
+
:GeoLocationService, :InfoService, :MediaService,
|
60
|
+
:ReportDefinitionService, :TargetingIdeaService],
|
61
|
+
:v201008 => [:AdExtensionOverrideService, :AdGroupAdService,
|
62
|
+
:AdGroupCriterionService, :AdGroupService, :AdParamService,
|
63
|
+
:AlertService, :BidLandscapeService, :BulkMutateJobService,
|
64
|
+
:CampaignAdExtensionService, :CampaignCriterionService,
|
65
|
+
:CampaignService, :CampaignTargetService,
|
66
|
+
:CustomerSyncService, :ExperimentService,
|
67
|
+
:GeoLocationService, :InfoService, :MediaService,
|
68
|
+
:ReportDefinitionService, :ServicedAccountService,
|
69
|
+
:TargetingIdeaService, :TrafficEstimatorService,
|
70
|
+
:UserListService],
|
71
|
+
:v201101 => [:AdExtensionOverrideService, :AdGroupAdService,
|
72
|
+
:AdGroupCriterionService, :AdGroupService, :AdParamService,
|
73
|
+
:AlertService, :BulkMutateJobService,
|
74
|
+
:CampaignAdExtensionService, :CampaignCriterionService,
|
75
|
+
:CampaignService, :CampaignTargetService,
|
76
|
+
:CustomerSyncService, :DataService, :ExperimentService,
|
77
|
+
:GeoLocationService, :InfoService, :MediaService,
|
78
|
+
:ReportDefinitionService, :ServicedAccountService,
|
79
|
+
:TargetingIdeaService, :TrafficEstimatorService,
|
80
|
+
:UserListService]
|
81
|
+
}
|
82
|
+
|
83
|
+
# Configure the different environments, with the base URL for each one
|
84
|
+
@@environment_config = {
|
85
|
+
:PRODUCTION => {
|
86
|
+
:v13 => 'https://adwords.google.com/api/adwords/',
|
87
|
+
:v200909 => 'https://adwords.google.com/api/adwords/',
|
88
|
+
:v201003 => 'https://adwords.google.com/api/adwords/',
|
89
|
+
:v201008 => 'https://adwords.google.com/api/adwords/',
|
90
|
+
:v201101 => 'https://adwords.google.com/api/adwords/'
|
91
|
+
},
|
92
|
+
:SANDBOX => {
|
93
|
+
:v13 => 'https://sandbox.google.com/api/adwords/',
|
94
|
+
:v200909 => 'https://adwords-sandbox.google.com/api/adwords/',
|
95
|
+
:v201003 => 'https://adwords-sandbox.google.com/api/adwords/',
|
96
|
+
:v201008 => 'https://adwords-sandbox.google.com/api/adwords/',
|
97
|
+
:v201101 => 'https://adwords-sandbox.google.com/api/adwords/'
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
# Configure the subdirectories for each version / service pair.
|
102
|
+
# A missing pair means that only the base URL is used.
|
103
|
+
@@subdir_config = {
|
104
|
+
# v13
|
105
|
+
[:v13, :AccountService] => '',
|
106
|
+
[:v13, :ReportService] => '',
|
107
|
+
[:v13, :TrafficEstimatorService] => '',
|
108
|
+
# v200909
|
109
|
+
[:v200909, :AdExtensionOverrideService] => 'cm/',
|
110
|
+
[:v200909, :AdGroupAdService] => 'cm/',
|
111
|
+
[:v200909, :AdGroupCriterionService] => 'cm/',
|
112
|
+
[:v200909, :AdGroupService] => 'cm/',
|
113
|
+
[:v200909, :AdParamService] => 'cm/',
|
114
|
+
[:v200909, :BulkMutateJobService] => 'job/',
|
115
|
+
[:v200909, :CampaignAdExtensionService] => 'cm/',
|
116
|
+
[:v200909, :CampaignCriterionService] => 'cm/',
|
117
|
+
[:v200909, :CampaignService] => 'cm/',
|
118
|
+
[:v200909, :CampaignTargetService] => 'cm/',
|
119
|
+
[:v200909, :GeoLocationService] => 'cm/',
|
120
|
+
[:v200909, :InfoService] => 'info/',
|
121
|
+
[:v200909, :TargetingIdeaService] => 'o/',
|
122
|
+
# v201003
|
123
|
+
[:v201003, :AdExtensionOverrideService] => 'cm/',
|
124
|
+
[:v201003, :AdGroupAdService] => 'cm/',
|
125
|
+
[:v201003, :AdGroupCriterionService] => 'cm/',
|
126
|
+
[:v201003, :AdGroupService] => 'cm/',
|
127
|
+
[:v201003, :AdParamService] => 'cm/',
|
128
|
+
[:v201003, :BidLandscapeService] => 'cm/',
|
129
|
+
[:v201003, :BulkMutateJobService] => 'job/',
|
130
|
+
[:v201003, :CampaignAdExtensionService] => 'cm/',
|
131
|
+
[:v201003, :CampaignCriterionService] => 'cm/',
|
132
|
+
[:v201003, :CampaignService] => 'cm/',
|
133
|
+
[:v201003, :CampaignTargetService] => 'cm/',
|
134
|
+
[:v201003, :GeoLocationService] => 'cm/',
|
135
|
+
[:v201003, :InfoService] => 'info/',
|
136
|
+
[:v201003, :MediaService] => 'cm/',
|
137
|
+
[:v201003, :ReportDefinitionService] => 'cm/',
|
138
|
+
[:v201003, :TargetingIdeaService] => 'o/',
|
139
|
+
# v201008
|
140
|
+
[:v201008, :AdExtensionOverrideService] => 'cm/',
|
141
|
+
[:v201008, :AdGroupAdService] => 'cm/',
|
142
|
+
[:v201008, :AdGroupCriterionService] => 'cm/',
|
143
|
+
[:v201008, :AdGroupService] => 'cm/',
|
144
|
+
[:v201008, :AdParamService] => 'cm/',
|
145
|
+
[:v201008, :AlertService] => 'mcm/',
|
146
|
+
[:v201008, :BidLandscapeService] => 'cm/',
|
147
|
+
[:v201008, :BulkMutateJobService] => 'job/',
|
148
|
+
[:v201008, :CampaignAdExtensionService] => 'cm/',
|
149
|
+
[:v201008, :CampaignCriterionService] => 'cm/',
|
150
|
+
[:v201008, :CampaignService] => 'cm/',
|
151
|
+
[:v201008, :CampaignTargetService] => 'cm/',
|
152
|
+
[:v201008, :CustomerSyncService] => 'ch/',
|
153
|
+
[:v201008, :ExperimentService] => 'cm/',
|
154
|
+
[:v201008, :GeoLocationService] => 'cm/',
|
155
|
+
[:v201008, :InfoService] => 'info/',
|
156
|
+
[:v201008, :MediaService] => 'cm/',
|
157
|
+
[:v201008, :ReportDefinitionService] => 'cm/',
|
158
|
+
[:v201008, :ServicedAccountService] => 'mcm/',
|
159
|
+
[:v201008, :TargetingIdeaService] => 'o/',
|
160
|
+
[:v201008, :TrafficEstimatorService] => 'o/',
|
161
|
+
[:v201008, :UserListService] => 'cm/',
|
162
|
+
# v201101
|
163
|
+
[:v201101, :AdExtensionOverrideService] => 'cm/',
|
164
|
+
[:v201101, :AdGroupAdService] => 'cm/',
|
165
|
+
[:v201101, :AdGroupCriterionService] => 'cm/',
|
166
|
+
[:v201101, :AdGroupService] => 'cm/',
|
167
|
+
[:v201101, :AdParamService] => 'cm/',
|
168
|
+
[:v201101, :AlertService] => 'mcm/',
|
169
|
+
[:v201101, :BulkMutateJobService] => 'job/',
|
170
|
+
[:v201101, :CampaignAdExtensionService] => 'cm/',
|
171
|
+
[:v201101, :CampaignCriterionService] => 'cm/',
|
172
|
+
[:v201101, :CampaignService] => 'cm/',
|
173
|
+
[:v201101, :CampaignTargetService] => 'cm/',
|
174
|
+
[:v201101, :CustomerSyncService] => 'ch/',
|
175
|
+
[:v201101, :DataService] => 'cm/',
|
176
|
+
[:v201101, :ExperimentService] => 'cm/',
|
177
|
+
[:v201101, :GeoLocationService] => 'cm/',
|
178
|
+
[:v201101, :InfoService] => 'info/',
|
179
|
+
[:v201101, :MediaService] => 'cm/',
|
180
|
+
[:v201101, :ReportDefinitionService] => 'cm/',
|
181
|
+
[:v201101, :ServicedAccountService] => 'mcm/',
|
182
|
+
[:v201101, :TargetingIdeaService] => 'o/',
|
183
|
+
[:v201101, :TrafficEstimatorService] => 'o/',
|
184
|
+
[:v201101, :UserListService] => 'cm/'
|
185
|
+
}
|
186
|
+
|
187
|
+
# Configure the auth servers to use for each environment
|
188
|
+
@@auth_server_config = {
|
189
|
+
:PRODUCTION => 'https://www.google.com',
|
190
|
+
:SANDBOX => 'https://www.google.com'
|
191
|
+
}
|
192
|
+
|
193
|
+
public
|
194
|
+
|
195
|
+
# Getters for constants and module variables.
|
196
|
+
def self.default_version
|
197
|
+
DEFAULT_VERSION
|
198
|
+
end
|
199
|
+
|
200
|
+
def self.default_environment
|
201
|
+
DEFAULT_ENVIRONMENT
|
202
|
+
end
|
203
|
+
|
204
|
+
def self.latest_version
|
205
|
+
LATEST_VERSION
|
206
|
+
end
|
207
|
+
|
208
|
+
def self.api_name
|
209
|
+
API_NAME
|
210
|
+
end
|
211
|
+
|
212
|
+
def self.api_path
|
213
|
+
API_PATH
|
214
|
+
end
|
215
|
+
|
216
|
+
def self.service_config
|
217
|
+
@@service_config
|
218
|
+
end
|
219
|
+
|
220
|
+
def self.environment_config
|
221
|
+
@@environment_config
|
222
|
+
end
|
223
|
+
|
224
|
+
def self.subdir_config
|
225
|
+
@@subdir_config
|
226
|
+
end
|
227
|
+
|
228
|
+
def self.auth_server_config
|
229
|
+
@@auth_server_config
|
230
|
+
end
|
231
|
+
|
232
|
+
# Returns the full interface class name for a given service. Overriding this
|
233
|
+
# method from ads_common to fix odd behaviour with v13 class names.
|
234
|
+
#
|
235
|
+
# Args:
|
236
|
+
# - version: the API version (as an integer)
|
237
|
+
# - service: the service name (as a string)
|
238
|
+
#
|
239
|
+
# Returns:
|
240
|
+
# The full interface class name for the given service (as a string)
|
241
|
+
#
|
242
|
+
def self.interface_name(version, service)
|
243
|
+
version = version.to_sym
|
244
|
+
service = service.to_sym
|
245
|
+
service_str = service.to_s
|
246
|
+
service_str = service_str.sub(/Service$/, '') if version == :v13
|
247
|
+
return module_name(version, service) + "::#{service_str}Interface"
|
248
|
+
end
|
249
|
+
|
250
|
+
# Get the download URL for reports.
|
251
|
+
#
|
252
|
+
# Args:
|
253
|
+
# - environment: the service environment to be used (as a string)
|
254
|
+
# - version: the API version (as an integer)
|
255
|
+
#
|
256
|
+
# Returns:
|
257
|
+
# The endpoint URL (as a string)
|
258
|
+
#
|
259
|
+
def self.report_download_url(environment, version)
|
260
|
+
version = version.to_sym
|
261
|
+
base = get_wsdl_base(environment.to_sym, version)
|
262
|
+
if base
|
263
|
+
path = service_config[version].include?(:ReportDefinitionService) ?
|
264
|
+
'reportdownload' : nil
|
265
|
+
base += path.to_s
|
266
|
+
end
|
267
|
+
return base
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
+
#
|
7
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
+
# implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
# Handles v13 authentication.
|
21
|
+
|
22
|
+
require 'ads_common/auth/base_handler'
|
23
|
+
|
24
|
+
module AdwordsApi
|
25
|
+
module Auth
|
26
|
+
class V13LoginHandler < AdsCommon::Auth::BaseHandler
|
27
|
+
|
28
|
+
# Ensure that clientEmail and clientCustomerId are always present
|
29
|
+
def header_list(credentials)
|
30
|
+
creds = credentials.keys.dup
|
31
|
+
creds << :clientEmail unless creds.include? :clientEmail
|
32
|
+
creds << :clientCustomerId unless creds.include? :clientCustomerId
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
+
#
|
7
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
+
# implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
# AdWords-specific credential handler.
|
21
|
+
|
22
|
+
require 'ads_common/credential_handler'
|
23
|
+
require 'adwords_api/api_config'
|
24
|
+
|
25
|
+
module AdwordsApi
|
26
|
+
class CredentialHandler < AdsCommon::CredentialHandler
|
27
|
+
SERVICE_NAME = 'adwords'
|
28
|
+
|
29
|
+
# Whether we're making MCC-level requests.
|
30
|
+
attr_accessor :use_mcc
|
31
|
+
# Whether we're making validate-only requests.
|
32
|
+
attr_accessor :validate_only
|
33
|
+
# Whether we're making partial failure requests.
|
34
|
+
attr_accessor :partial_failure
|
35
|
+
|
36
|
+
def initialize(config)
|
37
|
+
super
|
38
|
+
@use_mcc = false
|
39
|
+
@validate_only = false
|
40
|
+
@partial_failure = false
|
41
|
+
end
|
42
|
+
|
43
|
+
# Create the list of credentials to be used by the auth handler for header
|
44
|
+
# generation.
|
45
|
+
def credentials(version = nil)
|
46
|
+
validate_headers_for_server
|
47
|
+
result = {}
|
48
|
+
client_lib = 'Ruby-AwApi-%s|' % AdwordsApi::ApiConfig::CLIENT_LIB_VERSION
|
49
|
+
user_agent = @credentials[:user_agent]
|
50
|
+
user_agent = $0 if user_agent.nil?
|
51
|
+
user_agent = client_lib + user_agent
|
52
|
+
if (version == :v13)
|
53
|
+
result[:useragent] = user_agent
|
54
|
+
else
|
55
|
+
result[:userAgent] = user_agent
|
56
|
+
end
|
57
|
+
result[:email] = @credentials[:email]
|
58
|
+
result[:password] = @credentials[:password]
|
59
|
+
result[:developerToken] = @credentials[:developer_token]
|
60
|
+
unless @use_mcc
|
61
|
+
if @credentials[:client_email]
|
62
|
+
result[:clientEmail] = @credentials[:client_email]
|
63
|
+
elsif @credentials[:client_customer_id]
|
64
|
+
result[:clientCustomerId] = @credentials[:client_customer_id]
|
65
|
+
end
|
66
|
+
end
|
67
|
+
if version != :v13 and @validate_only
|
68
|
+
result[:validateOnly] = 'true'
|
69
|
+
end
|
70
|
+
if version != :v13 and @partial_failure
|
71
|
+
result[:partialFailure] = 'true'
|
72
|
+
end
|
73
|
+
return result
|
74
|
+
end
|
75
|
+
|
76
|
+
private
|
77
|
+
|
78
|
+
# Validates that the right credentials are being used for the chosen
|
79
|
+
# environment.
|
80
|
+
#
|
81
|
+
# Raises:
|
82
|
+
# Adwordsapi::Error::EnvironmentMismatchError if sandbox credentials are
|
83
|
+
# being used for production or vice-versa.
|
84
|
+
#
|
85
|
+
def validate_headers_for_server
|
86
|
+
email = @credentials[:email]
|
87
|
+
token = @credentials[:developer_token]
|
88
|
+
client = @credentials[:client_email]
|
89
|
+
environment = @config.read('service.environment').to_s.upcase
|
90
|
+
|
91
|
+
sandbox_token = (token =~ /#{Regexp.escape(email)}\+\+[a-zA-Z]{3}/)
|
92
|
+
sandbox_client = (client =~ /client_[1-5]\+#{Regexp.escape(email)}/)
|
93
|
+
|
94
|
+
# Only check the token, because 'client_n+x@y.tld' may be a valid client
|
95
|
+
# email for some customers.
|
96
|
+
if environment == 'PRODUCTION' and sandbox_token
|
97
|
+
raise AdsCommon::Errors::EnvironmentMismatchError,
|
98
|
+
'Attempting to connect to production with sandbox credentials.'
|
99
|
+
# Check if either the token or client email do not follow the correct
|
100
|
+
# format. Client email may not exist, though.
|
101
|
+
elsif environment == 'SANDBOX' and (!sandbox_token or
|
102
|
+
(client.length > 0 and !sandbox_client))
|
103
|
+
raise AdsCommon::Errors::EnvironmentMismatchError,
|
104
|
+
'Attempting to connect to the sandbox with malformatted ' +
|
105
|
+
'credentials. Please check ' +
|
106
|
+
'http://code.google.com/apis/adwords/docs/developer/' +
|
107
|
+
'adwords_api_sandbox.html#requestheaders for details.'
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# Authors:: api.sgomes@gmail.com (Sérgio Gomes)
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
+
#
|
7
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
+
# implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
# Specific error handling for the AdWords API.
|
21
|
+
|
22
|
+
require 'ads_common/errors'
|
23
|
+
|
24
|
+
module AdwordsApi
|
25
|
+
module Errors
|
26
|
+
|
27
|
+
# This class encapsulates a v13 or v20xx exception. Errors are stored in an
|
28
|
+
# array, with each error being a hash, rather than a Ruby object. This is
|
29
|
+
# for the purpose of making the errors independent from the SOAP toolkit
|
30
|
+
# being used.
|
31
|
+
class ApiException < AdsCommon::Errors::ApiException
|
32
|
+
attr_reader :code, :errors, :trigger
|
33
|
+
|
34
|
+
def initialize(message = nil, errors = nil, code = nil, trigger = nil)
|
35
|
+
@message, @errors, @code, @trigger = message, errors, code, trigger
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns the source operation index for an error
|
39
|
+
#
|
40
|
+
# Args:
|
41
|
+
# - error: the error to be analyzed
|
42
|
+
#
|
43
|
+
# Returns:
|
44
|
+
# - index for the source operation, nil if none
|
45
|
+
#
|
46
|
+
def operation_index_for_error(error)
|
47
|
+
if error and error.include? :field_path and error[:field_path]
|
48
|
+
parts = error[:field_path].split('.')
|
49
|
+
if parts.length > 0
|
50
|
+
match = parts.first.match(/operations\[(\d)\]/)
|
51
|
+
return match ? match[1].to_i : nil
|
52
|
+
end
|
53
|
+
end
|
54
|
+
return nil
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Creates an ApiException given a SOAPFault and a service wrapper.
|
59
|
+
def self.create_api_exception(fault, wrapper)
|
60
|
+
# Get the inner fault.
|
61
|
+
inner_fault = nil
|
62
|
+
if fault and fault.detail
|
63
|
+
if fault.detail.respond_to? :apiExceptionFault
|
64
|
+
inner_fault = fault.detail.apiExceptionFault
|
65
|
+
elsif fault.detail.respond_to? :fault
|
66
|
+
inner_fault = fault.detail.fault
|
67
|
+
end
|
68
|
+
end
|
69
|
+
if inner_fault
|
70
|
+
# Convert error objects to hashes.
|
71
|
+
errors = nil
|
72
|
+
if inner_fault.errors
|
73
|
+
errors = inner_fault.errors.map do |error_object|
|
74
|
+
wrapper.convert_from_object(error_object)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
code = inner_fault.respond_to?(:code) ? inner_fault.code : nil
|
78
|
+
trigger = inner_fault.respond_to?(:trigger) ? inner_fault.trigger : nil
|
79
|
+
return ApiException.new(inner_fault.message, errors, code, trigger)
|
80
|
+
else
|
81
|
+
return ApiException.new
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|