google-adwords-api 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +0 -0
- data/ChangeLog +5 -0
- data/README.md +0 -0
- data/adwords_api.yml +0 -0
- data/lib/adwords_api.rb +14 -0
- data/lib/adwords_api/api_config.rb +0 -92
- data/lib/adwords_api/batch_job_utils.rb +0 -0
- data/lib/adwords_api/credential_handler.rb +0 -0
- data/lib/adwords_api/errors.rb +0 -0
- data/lib/adwords_api/incremental_upload_helper.rb +0 -0
- data/lib/adwords_api/query_utils/query_builder.rb +41 -0
- data/lib/adwords_api/query_utils/report_query.rb +30 -0
- data/lib/adwords_api/query_utils/report_query_builder.rb +82 -0
- data/lib/adwords_api/query_utils/service_query.rb +61 -0
- data/lib/adwords_api/query_utils/service_query_builder.rb +83 -0
- data/lib/adwords_api/query_utils/where_builder.rb +97 -0
- data/lib/adwords_api/report_header_handler.rb +0 -0
- data/lib/adwords_api/report_stream.rb +0 -0
- data/lib/adwords_api/report_utils.rb +0 -0
- data/lib/adwords_api/utils.rb +0 -0
- data/lib/adwords_api/utils_reporter.rb +12 -0
- data/lib/adwords_api/v201705/account_label_service.rb +0 -0
- data/lib/adwords_api/v201705/account_label_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_customizer_feed_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_customizer_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_ad_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_ad_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_bid_modifier_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_bid_modifier_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_criterion_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_feed_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_group_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/ad_param_service.rb +0 -0
- data/lib/adwords_api/v201705/ad_param_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/adwords_user_list_service.rb +0 -0
- data/lib/adwords_api/v201705/adwords_user_list_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/batch_job_service.rb +0 -0
- data/lib/adwords_api/v201705/batch_job_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/bidding_strategy_service.rb +0 -0
- data/lib/adwords_api/v201705/bidding_strategy_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/budget_order_service.rb +0 -0
- data/lib/adwords_api/v201705/budget_order_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/budget_service.rb +0 -0
- data/lib/adwords_api/v201705/budget_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_bid_modifier_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_bid_modifier_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_criterion_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_feed_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_group_performance_target_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_group_performance_target_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_group_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_group_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/campaign_shared_set_service.rb +0 -0
- data/lib/adwords_api/v201705/campaign_shared_set_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/constant_data_service.rb +0 -0
- data/lib/adwords_api/v201705/constant_data_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/conversion_tracker_service.rb +0 -0
- data/lib/adwords_api/v201705/conversion_tracker_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/customer_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201705/customer_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/customer_feed_service.rb +0 -0
- data/lib/adwords_api/v201705/customer_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/customer_service.rb +0 -0
- data/lib/adwords_api/v201705/customer_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/customer_sync_service.rb +0 -0
- data/lib/adwords_api/v201705/customer_sync_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/data_service.rb +0 -0
- data/lib/adwords_api/v201705/data_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/draft_async_error_service.rb +0 -0
- data/lib/adwords_api/v201705/draft_async_error_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/draft_service.rb +0 -0
- data/lib/adwords_api/v201705/draft_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/feed_item_service.rb +0 -0
- data/lib/adwords_api/v201705/feed_item_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/feed_mapping_service.rb +0 -0
- data/lib/adwords_api/v201705/feed_mapping_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/feed_service.rb +0 -0
- data/lib/adwords_api/v201705/feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/label_service.rb +0 -0
- data/lib/adwords_api/v201705/label_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/location_criterion_service.rb +0 -0
- data/lib/adwords_api/v201705/location_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/managed_customer_service.rb +0 -0
- data/lib/adwords_api/v201705/managed_customer_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/media_service.rb +0 -0
- data/lib/adwords_api/v201705/media_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/offline_call_conversion_feed_service.rb +0 -0
- data/lib/adwords_api/v201705/offline_call_conversion_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/offline_conversion_feed_service.rb +0 -0
- data/lib/adwords_api/v201705/offline_conversion_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/report_definition_service.rb +0 -0
- data/lib/adwords_api/v201705/report_definition_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/shared_criterion_service.rb +0 -0
- data/lib/adwords_api/v201705/shared_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/shared_set_service.rb +0 -0
- data/lib/adwords_api/v201705/shared_set_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/targeting_idea_service.rb +0 -0
- data/lib/adwords_api/v201705/targeting_idea_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/traffic_estimator_service.rb +0 -0
- data/lib/adwords_api/v201705/traffic_estimator_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/trial_async_error_service.rb +0 -0
- data/lib/adwords_api/v201705/trial_async_error_service_registry.rb +0 -0
- data/lib/adwords_api/v201705/trial_service.rb +0 -0
- data/lib/adwords_api/v201705/trial_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/account_label_service.rb +0 -0
- data/lib/adwords_api/v201708/account_label_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_customizer_feed_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_customizer_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_ad_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_ad_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_bid_modifier_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_bid_modifier_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_criterion_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_feed_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_group_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/ad_param_service.rb +0 -0
- data/lib/adwords_api/v201708/ad_param_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/adwords_user_list_service.rb +0 -0
- data/lib/adwords_api/v201708/adwords_user_list_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/batch_job_service.rb +0 -0
- data/lib/adwords_api/v201708/batch_job_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/bidding_strategy_service.rb +0 -0
- data/lib/adwords_api/v201708/bidding_strategy_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/budget_order_service.rb +0 -0
- data/lib/adwords_api/v201708/budget_order_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/budget_service.rb +0 -0
- data/lib/adwords_api/v201708/budget_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_bid_modifier_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_bid_modifier_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_criterion_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_feed_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_group_performance_target_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_group_performance_target_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_group_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_group_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/campaign_shared_set_service.rb +0 -0
- data/lib/adwords_api/v201708/campaign_shared_set_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/constant_data_service.rb +0 -0
- data/lib/adwords_api/v201708/constant_data_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/conversion_tracker_service.rb +0 -0
- data/lib/adwords_api/v201708/conversion_tracker_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/customer_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201708/customer_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/customer_feed_service.rb +0 -0
- data/lib/adwords_api/v201708/customer_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/customer_service.rb +0 -0
- data/lib/adwords_api/v201708/customer_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/customer_sync_service.rb +0 -0
- data/lib/adwords_api/v201708/customer_sync_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/data_service.rb +0 -0
- data/lib/adwords_api/v201708/data_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/draft_async_error_service.rb +0 -0
- data/lib/adwords_api/v201708/draft_async_error_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/draft_service.rb +0 -0
- data/lib/adwords_api/v201708/draft_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/feed_item_service.rb +0 -0
- data/lib/adwords_api/v201708/feed_item_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/feed_mapping_service.rb +0 -0
- data/lib/adwords_api/v201708/feed_mapping_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/feed_service.rb +0 -0
- data/lib/adwords_api/v201708/feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/label_service.rb +0 -0
- data/lib/adwords_api/v201708/label_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/location_criterion_service.rb +0 -0
- data/lib/adwords_api/v201708/location_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/managed_customer_service.rb +0 -0
- data/lib/adwords_api/v201708/managed_customer_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/media_service.rb +0 -0
- data/lib/adwords_api/v201708/media_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/offline_call_conversion_feed_service.rb +0 -0
- data/lib/adwords_api/v201708/offline_call_conversion_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/offline_conversion_feed_service.rb +0 -0
- data/lib/adwords_api/v201708/offline_conversion_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/offline_data_upload_service.rb +0 -0
- data/lib/adwords_api/v201708/offline_data_upload_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/report_definition_service.rb +0 -0
- data/lib/adwords_api/v201708/report_definition_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/shared_criterion_service.rb +0 -0
- data/lib/adwords_api/v201708/shared_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/shared_set_service.rb +0 -0
- data/lib/adwords_api/v201708/shared_set_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/targeting_idea_service.rb +0 -0
- data/lib/adwords_api/v201708/targeting_idea_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/traffic_estimator_service.rb +0 -0
- data/lib/adwords_api/v201708/traffic_estimator_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/trial_async_error_service.rb +0 -0
- data/lib/adwords_api/v201708/trial_async_error_service_registry.rb +0 -0
- data/lib/adwords_api/v201708/trial_service.rb +0 -0
- data/lib/adwords_api/v201708/trial_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/account_label_service.rb +0 -0
- data/lib/adwords_api/v201710/account_label_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_customizer_feed_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_customizer_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_ad_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_ad_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_bid_modifier_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_bid_modifier_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_criterion_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_feed_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_group_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/ad_param_service.rb +0 -0
- data/lib/adwords_api/v201710/ad_param_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/adwords_user_list_service.rb +0 -0
- data/lib/adwords_api/v201710/adwords_user_list_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/batch_job_service.rb +0 -0
- data/lib/adwords_api/v201710/batch_job_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/bidding_strategy_service.rb +0 -0
- data/lib/adwords_api/v201710/bidding_strategy_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/budget_order_service.rb +0 -0
- data/lib/adwords_api/v201710/budget_order_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/budget_service.rb +0 -0
- data/lib/adwords_api/v201710/budget_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_bid_modifier_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_bid_modifier_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_criterion_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_feed_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_group_performance_target_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_group_performance_target_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_group_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_group_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/campaign_shared_set_service.rb +0 -0
- data/lib/adwords_api/v201710/campaign_shared_set_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/constant_data_service.rb +0 -0
- data/lib/adwords_api/v201710/constant_data_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/conversion_tracker_service.rb +0 -0
- data/lib/adwords_api/v201710/conversion_tracker_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/customer_extension_setting_service.rb +0 -0
- data/lib/adwords_api/v201710/customer_extension_setting_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/customer_feed_service.rb +0 -0
- data/lib/adwords_api/v201710/customer_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/customer_negative_criterion_service.rb +0 -0
- data/lib/adwords_api/v201710/customer_negative_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/customer_service.rb +0 -0
- data/lib/adwords_api/v201710/customer_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/customer_sync_service.rb +0 -0
- data/lib/adwords_api/v201710/customer_sync_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/data_service.rb +0 -0
- data/lib/adwords_api/v201710/data_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/draft_async_error_service.rb +0 -0
- data/lib/adwords_api/v201710/draft_async_error_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/draft_service.rb +0 -0
- data/lib/adwords_api/v201710/draft_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/feed_item_service.rb +0 -0
- data/lib/adwords_api/v201710/feed_item_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/feed_mapping_service.rb +0 -0
- data/lib/adwords_api/v201710/feed_mapping_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/feed_service.rb +0 -0
- data/lib/adwords_api/v201710/feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/label_service.rb +0 -0
- data/lib/adwords_api/v201710/label_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/location_criterion_service.rb +0 -0
- data/lib/adwords_api/v201710/location_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/managed_customer_service.rb +0 -0
- data/lib/adwords_api/v201710/managed_customer_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/media_service.rb +0 -0
- data/lib/adwords_api/v201710/media_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/offline_call_conversion_feed_service.rb +0 -0
- data/lib/adwords_api/v201710/offline_call_conversion_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/offline_conversion_feed_service.rb +0 -0
- data/lib/adwords_api/v201710/offline_conversion_feed_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/offline_data_upload_service.rb +0 -0
- data/lib/adwords_api/v201710/offline_data_upload_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/report_definition_service.rb +0 -0
- data/lib/adwords_api/v201710/report_definition_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/shared_criterion_service.rb +0 -0
- data/lib/adwords_api/v201710/shared_criterion_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/shared_set_service.rb +0 -0
- data/lib/adwords_api/v201710/shared_set_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/targeting_idea_service.rb +0 -0
- data/lib/adwords_api/v201710/targeting_idea_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/traffic_estimator_service.rb +0 -0
- data/lib/adwords_api/v201710/traffic_estimator_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/trial_async_error_service.rb +0 -0
- data/lib/adwords_api/v201710/trial_async_error_service_registry.rb +0 -0
- data/lib/adwords_api/v201710/trial_service.rb +0 -0
- data/lib/adwords_api/v201710/trial_service_registry.rb +0 -0
- data/lib/adwords_api/version.rb +1 -1
- metadata +8 -96
- data/lib/adwords_api/v201702/account_label_service.rb +0 -46
- data/lib/adwords_api/v201702/account_label_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_customizer_feed_service.rb +0 -46
- data/lib/adwords_api/v201702/ad_customizer_feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_group_ad_service.rb +0 -70
- data/lib/adwords_api/v201702/ad_group_ad_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_group_bid_modifier_service.rb +0 -54
- data/lib/adwords_api/v201702/ad_group_bid_modifier_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_group_criterion_service.rb +0 -62
- data/lib/adwords_api/v201702/ad_group_criterion_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_group_extension_setting_service.rb +0 -54
- data/lib/adwords_api/v201702/ad_group_extension_setting_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_group_feed_service.rb +0 -54
- data/lib/adwords_api/v201702/ad_group_feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_group_service.rb +0 -62
- data/lib/adwords_api/v201702/ad_group_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/ad_param_service.rb +0 -46
- data/lib/adwords_api/v201702/ad_param_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/adwords_user_list_service.rb +0 -62
- data/lib/adwords_api/v201702/adwords_user_list_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/batch_job_service.rb +0 -54
- data/lib/adwords_api/v201702/batch_job_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/bidding_strategy_service.rb +0 -54
- data/lib/adwords_api/v201702/bidding_strategy_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/budget_order_service.rb +0 -54
- data/lib/adwords_api/v201702/budget_order_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/budget_service.rb +0 -54
- data/lib/adwords_api/v201702/budget_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/campaign_criterion_service.rb +0 -54
- data/lib/adwords_api/v201702/campaign_criterion_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/campaign_extension_setting_service.rb +0 -54
- data/lib/adwords_api/v201702/campaign_extension_setting_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/campaign_feed_service.rb +0 -54
- data/lib/adwords_api/v201702/campaign_feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/campaign_service.rb +0 -62
- data/lib/adwords_api/v201702/campaign_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/campaign_shared_set_service.rb +0 -54
- data/lib/adwords_api/v201702/campaign_shared_set_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/constant_data_service.rb +0 -110
- data/lib/adwords_api/v201702/constant_data_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/conversion_tracker_service.rb +0 -54
- data/lib/adwords_api/v201702/conversion_tracker_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/customer_extension_setting_service.rb +0 -54
- data/lib/adwords_api/v201702/customer_extension_setting_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/customer_feed_service.rb +0 -54
- data/lib/adwords_api/v201702/customer_feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/customer_service.rb +0 -62
- data/lib/adwords_api/v201702/customer_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/customer_sync_service.rb +0 -38
- data/lib/adwords_api/v201702/customer_sync_service_registry.rb +0 -47
- data/lib/adwords_api/v201702/data_service.rb +0 -94
- data/lib/adwords_api/v201702/data_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/draft_async_error_service.rb +0 -46
- data/lib/adwords_api/v201702/draft_async_error_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/draft_service.rb +0 -54
- data/lib/adwords_api/v201702/draft_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/feed_item_service.rb +0 -54
- data/lib/adwords_api/v201702/feed_item_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/feed_mapping_service.rb +0 -54
- data/lib/adwords_api/v201702/feed_mapping_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/feed_service.rb +0 -54
- data/lib/adwords_api/v201702/feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/label_service.rb +0 -54
- data/lib/adwords_api/v201702/label_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/location_criterion_service.rb +0 -46
- data/lib/adwords_api/v201702/location_criterion_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/managed_customer_service.rb +0 -78
- data/lib/adwords_api/v201702/managed_customer_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/media_service.rb +0 -54
- data/lib/adwords_api/v201702/media_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/offline_call_conversion_feed_service.rb +0 -38
- data/lib/adwords_api/v201702/offline_call_conversion_feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/offline_conversion_feed_service.rb +0 -38
- data/lib/adwords_api/v201702/offline_conversion_feed_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/report_definition_service.rb +0 -38
- data/lib/adwords_api/v201702/report_definition_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/shared_criterion_service.rb +0 -54
- data/lib/adwords_api/v201702/shared_criterion_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/shared_set_service.rb +0 -54
- data/lib/adwords_api/v201702/shared_set_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/targeting_idea_service.rb +0 -38
- data/lib/adwords_api/v201702/targeting_idea_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/traffic_estimator_service.rb +0 -38
- data/lib/adwords_api/v201702/traffic_estimator_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/trial_async_error_service.rb +0 -46
- data/lib/adwords_api/v201702/trial_async_error_service_registry.rb +0 -46
- data/lib/adwords_api/v201702/trial_service.rb +0 -54
- data/lib/adwords_api/v201702/trial_service_registry.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d7cb94ca2d32367dc495517785a534f443f2571
|
4
|
+
data.tar.gz: 3ace7373eeb42580acb914556cb6479a3a93b9ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3058ad324f73b0db96ec1e0839fd3bb30db34d15e6472c6bb2b3f8c27c0dbdaf663da97674e9a5711db6578033b92f9bb2358bbe6d86c73faf4e0e8e4ebd211
|
7
|
+
data.tar.gz: 67d37401dd0c7d560167332aa39a7955608cc45eeffa4e8ac9bc4eadf0ae054fc314a9dcc47b2d76d6e07e19e7b49f3c785111a0b99482de700e6501dc730350
|
data/COPYING
CHANGED
File without changes
|
data/ChangeLog
CHANGED
data/README.md
CHANGED
File without changes
|
data/adwords_api.yml
CHANGED
File without changes
|
data/lib/adwords_api.rb
CHANGED
@@ -25,6 +25,8 @@ require 'adwords_api/errors'
|
|
25
25
|
require 'adwords_api/report_utils'
|
26
26
|
require 'adwords_api/batch_job_utils'
|
27
27
|
require 'adwords_api/utils_reporter'
|
28
|
+
require 'adwords_api/query_utils/report_query_builder'
|
29
|
+
require 'adwords_api/query_utils/service_query_builder'
|
28
30
|
|
29
31
|
# Main namespace for all the client library's modules and classes.
|
30
32
|
module AdwordsApi
|
@@ -206,6 +208,18 @@ module AdwordsApi
|
|
206
208
|
return AdwordsApi::BatchJobUtils.new(self, version)
|
207
209
|
end
|
208
210
|
|
211
|
+
# Returns an instance of ReportQueryBuilder to aid in generating AWQL for
|
212
|
+
# reports.
|
213
|
+
def report_query_builder(&block)
|
214
|
+
return AdwordsApi::ReportQueryBuilder.new(self, &block)
|
215
|
+
end
|
216
|
+
|
217
|
+
# Returns an instance of ServiceQueryBuilder to aid in generating AWQL for
|
218
|
+
# service queries.
|
219
|
+
def service_query_builder(&block)
|
220
|
+
return AdwordsApi::ServiceQueryBuilder.new(self, &block)
|
221
|
+
end
|
222
|
+
|
209
223
|
private
|
210
224
|
|
211
225
|
# Executes block with a temporary flag set to a given value. Returns block
|
@@ -42,52 +42,6 @@ module AdwordsApi
|
|
42
42
|
|
43
43
|
# Configure the services available to each version
|
44
44
|
@@service_config = {
|
45
|
-
:v201702 => [
|
46
|
-
:AccountLabelService,
|
47
|
-
:AdCustomizerFeedService,
|
48
|
-
:AdGroupAdService,
|
49
|
-
:AdGroupBidModifierService,
|
50
|
-
:AdGroupCriterionService,
|
51
|
-
:AdGroupExtensionSettingService,
|
52
|
-
:AdGroupFeedService,
|
53
|
-
:AdGroupService,
|
54
|
-
:AdParamService,
|
55
|
-
:AdwordsUserListService,
|
56
|
-
:BatchJobService,
|
57
|
-
:BiddingStrategyService,
|
58
|
-
:BudgetOrderService,
|
59
|
-
:BudgetService,
|
60
|
-
:CampaignCriterionService,
|
61
|
-
:CampaignExtensionSettingService,
|
62
|
-
:CampaignFeedService,
|
63
|
-
:CampaignService,
|
64
|
-
:CampaignSharedSetService,
|
65
|
-
:ConstantDataService,
|
66
|
-
:ConversionTrackerService,
|
67
|
-
:CustomerExtensionSettingService,
|
68
|
-
:CustomerFeedService,
|
69
|
-
:CustomerService,
|
70
|
-
:CustomerSyncService,
|
71
|
-
:DataService,
|
72
|
-
:DraftService,
|
73
|
-
:DraftAsyncErrorService,
|
74
|
-
:FeedItemService,
|
75
|
-
:FeedMappingService,
|
76
|
-
:FeedService,
|
77
|
-
:LabelService,
|
78
|
-
:LocationCriterionService,
|
79
|
-
:ManagedCustomerService,
|
80
|
-
:MediaService,
|
81
|
-
:OfflineCallConversionFeedService,
|
82
|
-
:OfflineConversionFeedService,
|
83
|
-
:ReportDefinitionService,
|
84
|
-
:SharedCriterionService,
|
85
|
-
:SharedSetService,
|
86
|
-
:TargetingIdeaService,
|
87
|
-
:TrafficEstimatorService,
|
88
|
-
:TrialService,
|
89
|
-
:TrialAsyncErrorService
|
90
|
-
],
|
91
45
|
:v201705 => [
|
92
46
|
:AccountLabelService,
|
93
47
|
:AdCustomizerFeedService,
|
@@ -244,7 +198,6 @@ module AdwordsApi
|
|
244
198
|
@@config = {
|
245
199
|
:oauth_scope => 'https://www.googleapis.com/auth/adwords',
|
246
200
|
:header_ns => 'https://adwords.google.com/api/adwords/cm/',
|
247
|
-
:v201702 => 'https://adwords.google.com/api/adwords/',
|
248
201
|
:v201705 => 'https://adwords.google.com/api/adwords/',
|
249
202
|
:v201708 => 'https://adwords.google.com/api/adwords/',
|
250
203
|
:v201710 => 'https://adwords.google.com/api/adwords/'
|
@@ -253,51 +206,6 @@ module AdwordsApi
|
|
253
206
|
# Configure the subdirectories for each version / service pair.
|
254
207
|
# A missing pair means that only the base URL is used.
|
255
208
|
@@subdir_config = {
|
256
|
-
# v201702
|
257
|
-
[:v201702, :AccountLabelService] => 'mcm/',
|
258
|
-
[:v201702, :AdCustomizerFeedService] => 'cm/',
|
259
|
-
[:v201702, :AdGroupAdService] => 'cm/',
|
260
|
-
[:v201702, :AdGroupBidModifierService] => 'cm/',
|
261
|
-
[:v201702, :AdGroupCriterionService] => 'cm/',
|
262
|
-
[:v201702, :AdGroupExtensionSettingService] => 'cm/',
|
263
|
-
[:v201702, :AdGroupFeedService] => 'cm/',
|
264
|
-
[:v201702, :AdGroupService] => 'cm/',
|
265
|
-
[:v201702, :AdParamService] => 'cm/',
|
266
|
-
[:v201702, :BatchJobService] => 'cm/',
|
267
|
-
[:v201702, :BudgetOrderService] => 'billing/',
|
268
|
-
[:v201702, :CampaignCriterionService] => 'cm/',
|
269
|
-
[:v201702, :CampaignExtensionSettingService] => 'cm/',
|
270
|
-
[:v201702, :CampaignFeedService] => 'cm/',
|
271
|
-
[:v201702, :CampaignService] => 'cm/',
|
272
|
-
[:v201702, :CampaignSharedSetService] => 'cm/',
|
273
|
-
[:v201702, :ConstantDataService] => 'cm/',
|
274
|
-
[:v201702, :ConversionTrackerService] => 'cm/',
|
275
|
-
[:v201702, :CustomerExtensionSettingService] => 'cm/',
|
276
|
-
[:v201702, :CustomerSyncService] => 'ch/',
|
277
|
-
[:v201702, :DataService] => 'cm/',
|
278
|
-
[:v201702, :FeedItemService] => 'cm/',
|
279
|
-
[:v201702, :FeedMappingService] => 'cm/',
|
280
|
-
[:v201702, :FeedService] => 'cm/',
|
281
|
-
[:v201702, :LocationCriterionService] => 'cm/',
|
282
|
-
[:v201702, :MediaService] => 'cm/',
|
283
|
-
[:v201702, :OfflineCallConversionFeedService] => 'cm/',
|
284
|
-
[:v201702, :OfflineConversionFeedService] => 'cm/',
|
285
|
-
[:v201702, :ReportDefinitionService] => 'cm/',
|
286
|
-
[:v201702, :SharedCriterionService] => 'cm/',
|
287
|
-
[:v201702, :SharedSetService] => 'cm/',
|
288
|
-
[:v201702, :TargetingIdeaService] => 'o/',
|
289
|
-
[:v201702, :TrafficEstimatorService] => 'o/',
|
290
|
-
[:v201702, :ManagedCustomerService] => 'mcm/',
|
291
|
-
[:v201702, :CustomerService] => 'mcm/',
|
292
|
-
[:v201702, :CustomerFeedService] => 'cm/',
|
293
|
-
[:v201702, :BudgetService] => 'cm/',
|
294
|
-
[:v201702, :BiddingStrategyService] => 'cm/',
|
295
|
-
[:v201702, :AdwordsUserListService] => 'rm/',
|
296
|
-
[:v201702, :LabelService] => 'cm/',
|
297
|
-
[:v201702, :DraftService] => 'cm/',
|
298
|
-
[:v201702, :DraftAsyncErrorService] => 'cm/',
|
299
|
-
[:v201702, :TrialService] => 'cm/',
|
300
|
-
[:v201702, :TrialAsyncErrorService] => 'cm/',
|
301
209
|
# v201705
|
302
210
|
[:v201705, :AccountLabelService] => 'mcm/',
|
303
211
|
[:v201705, :AdCustomizerFeedService] => 'cm/',
|
File without changes
|
File without changes
|
data/lib/adwords_api/errors.rb
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright:: Copyright 2018, Google Inc. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
14
|
+
# implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# Base class with common methods used across both report and service queries.
|
19
|
+
|
20
|
+
require 'adwords_api/query_utils/where_builder'
|
21
|
+
|
22
|
+
module AdwordsApi
|
23
|
+
class QueryBuilder
|
24
|
+
def initialize(api)
|
25
|
+
@api = api
|
26
|
+
@where = []
|
27
|
+
end
|
28
|
+
|
29
|
+
def where(field)
|
30
|
+
clause = WhereBuilder.new(field)
|
31
|
+
@where << clause
|
32
|
+
return clause
|
33
|
+
end
|
34
|
+
|
35
|
+
def build_where()
|
36
|
+
return '' if @where.empty?
|
37
|
+
wheres = @where.map {|w| w.awql}
|
38
|
+
return sprintf(' WHERE %s', wheres.join(' AND '))
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright:: Copyright 2018, Google Inc. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
14
|
+
# implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# Class to hold a generated AWQL query for reports.
|
19
|
+
|
20
|
+
module AdwordsApi
|
21
|
+
class ReportQuery
|
22
|
+
def initialize(query)
|
23
|
+
@query = query
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_s()
|
27
|
+
return @query
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright:: Copyright 2018, Google Inc. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
14
|
+
# implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# Class with methods to aid in building AWQL for reports.
|
19
|
+
|
20
|
+
require 'adwords_api/query_utils/query_builder'
|
21
|
+
require 'adwords_api/query_utils/report_query'
|
22
|
+
|
23
|
+
module AdwordsApi
|
24
|
+
class ReportQueryBuilder < QueryBuilder
|
25
|
+
def initialize(api)
|
26
|
+
super(api)
|
27
|
+
@select = nil
|
28
|
+
@from = nil
|
29
|
+
@during_range = nil
|
30
|
+
@during_start = nil
|
31
|
+
@during_end = nil
|
32
|
+
yield self if block_given?
|
33
|
+
end
|
34
|
+
|
35
|
+
def configure()
|
36
|
+
yield self
|
37
|
+
end
|
38
|
+
|
39
|
+
def select(*fields)
|
40
|
+
@select = fields
|
41
|
+
end
|
42
|
+
|
43
|
+
def from(report_name)
|
44
|
+
@from = report_name
|
45
|
+
end
|
46
|
+
|
47
|
+
def during_date_range(date_range)
|
48
|
+
@during_range = date_range
|
49
|
+
end
|
50
|
+
|
51
|
+
def during(start_date, end_date)
|
52
|
+
@during_start = start_date
|
53
|
+
@during_end = end_date
|
54
|
+
end
|
55
|
+
|
56
|
+
def build()
|
57
|
+
raise ArgumentError,
|
58
|
+
'Must specify SELECT clause for valid AWQL' if @select.nil?
|
59
|
+
raise ArgumentError,
|
60
|
+
'Must specify FROM clause for valid AWQL' if @from.nil?
|
61
|
+
if !@during_range.nil? && (!@during_start.nil? || !@during_end.nil?)
|
62
|
+
raise ArgumentError,
|
63
|
+
'Cannot specify both date range and start/end dates.'
|
64
|
+
end
|
65
|
+
result = sprintf('SELECT %s', @select.join(', '))
|
66
|
+
result += sprintf(' FROM %s', @from)
|
67
|
+
result += build_where()
|
68
|
+
if !@during_range.nil?
|
69
|
+
result += sprintf(' DURING %s', @during_range)
|
70
|
+
elsif !@during_start.nil? || !@during_end.nil?
|
71
|
+
if @during_start.nil?
|
72
|
+
raise ArgumentError, 'Cannot specify end date without start date.'
|
73
|
+
elsif @during_end.nil?
|
74
|
+
raise ArgumentError, 'Cannot specify start date without end date.'
|
75
|
+
end
|
76
|
+
result += sprintf(' DURING %s,%s', @during_start, @during_end)
|
77
|
+
end
|
78
|
+
@api.utils_reporter.report_query_builder_used()
|
79
|
+
return ReportQuery.new(result)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright:: Copyright 2018, Google Inc. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
14
|
+
# implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# Class to hold a generated AWQL query and aid in paging for services.
|
19
|
+
|
20
|
+
module AdwordsApi
|
21
|
+
class ServiceQuery
|
22
|
+
def initialize(query, start_index, page_size)
|
23
|
+
@query = query
|
24
|
+
@start_index = start_index
|
25
|
+
@page_size = page_size
|
26
|
+
end
|
27
|
+
|
28
|
+
def has_next(page)
|
29
|
+
raise ArgumentError,
|
30
|
+
'Cannot page through query with no LIMIT clause.' if @start_index.nil?
|
31
|
+
return @start_index + @page_size < page[:total_num_entries]
|
32
|
+
end
|
33
|
+
|
34
|
+
# Determining whether another page exists when dealing with bid landscapes
|
35
|
+
# is different from other types of queries. Use this method for those cases.
|
36
|
+
def has_next_landscape_page(page)
|
37
|
+
raise ArgumentError,
|
38
|
+
'Cannot page through query with no LIMIT clause.' if @start_index.nil?
|
39
|
+
total_landscape_points_in_page = 0
|
40
|
+
page[:entries].each do |landscape|
|
41
|
+
total_landscape_points_in_page += landscape[:landscape_points].size
|
42
|
+
end
|
43
|
+
return total_landscape_points_in_page >= @page_size
|
44
|
+
end
|
45
|
+
|
46
|
+
def next_page()
|
47
|
+
raise ArgumentError,
|
48
|
+
'Cannot page through query with no LIMIT clause.' if @start_index.nil?
|
49
|
+
@start_index += @page_size
|
50
|
+
return self
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_s()
|
54
|
+
query = @query
|
55
|
+
unless @start_index.nil?
|
56
|
+
query += sprintf(' LIMIT %s,%s', @start_index, @page_size)
|
57
|
+
end
|
58
|
+
return query
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
#
|
3
|
+
# Copyright:: Copyright 2018, Google Inc. All Rights Reserved.
|
4
|
+
#
|
5
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
14
|
+
# implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
# Class with methods to aid in building AWQL for services.
|
19
|
+
|
20
|
+
require 'adwords_api/query_utils/query_builder'
|
21
|
+
require 'adwords_api/query_utils/service_query'
|
22
|
+
require 'set'
|
23
|
+
|
24
|
+
module AdwordsApi
|
25
|
+
class ServiceQueryBuilder < QueryBuilder
|
26
|
+
def initialize(api)
|
27
|
+
super(api)
|
28
|
+
@select = nil
|
29
|
+
@order = []
|
30
|
+
@start_index = nil
|
31
|
+
@page_size = nil
|
32
|
+
yield self if block_given?
|
33
|
+
end
|
34
|
+
|
35
|
+
def configure()
|
36
|
+
yield self
|
37
|
+
end
|
38
|
+
|
39
|
+
def select(*fields)
|
40
|
+
@select = Set[*fields]
|
41
|
+
end
|
42
|
+
|
43
|
+
def order_by_asc(field)
|
44
|
+
@order << {
|
45
|
+
:field => field,
|
46
|
+
:direction => 'ASC'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def order_by_desc(field)
|
51
|
+
@order << {
|
52
|
+
:field => field,
|
53
|
+
:direction => 'DESC'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
def limit(start_index, page_size)
|
58
|
+
@start_index = start_index
|
59
|
+
@page_size = page_size
|
60
|
+
end
|
61
|
+
|
62
|
+
def build()
|
63
|
+
raise ArgumentError,
|
64
|
+
'Must specify SELECT clause for valid AWQL' if @select.nil?
|
65
|
+
if !@start_index.nil? && @page_size.nil?
|
66
|
+
raise ArgumentError, 'Cannot specify start index without page size.'
|
67
|
+
end
|
68
|
+
if !@page_size.nil? && @start_index.nil?
|
69
|
+
raise ArgumentError, 'Cannot specify page size without start index.'
|
70
|
+
end
|
71
|
+
result = sprintf('SELECT %s', @select.to_a.join(', '))
|
72
|
+
result += build_where()
|
73
|
+
unless @order.empty?
|
74
|
+
orders = @order.map do |o|
|
75
|
+
sprintf('%s %s', o[:field], o[:direction])
|
76
|
+
end
|
77
|
+
result += sprintf(' ORDER BY %s', orders.join(', '))
|
78
|
+
end
|
79
|
+
@api.utils_reporter.service_query_builder_used()
|
80
|
+
return ServiceQuery.new(result, @start_index, @page_size)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|