google-dfp-api 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +7 -0
- data/examples/{v201403 → v201502}/activity_group_service/create_activity_groups.rb +1 -1
- data/examples/{v201403 → v201502}/activity_group_service/get_active_activity_groups.rb +18 -27
- data/examples/{v201403 → v201502}/activity_group_service/get_all_activity_groups.rb +13 -23
- data/examples/{v201403 → v201502}/activity_group_service/update_activity_groups.rb +11 -9
- data/examples/{v201403 → v201502}/activity_service/create_activities.rb +1 -1
- data/examples/{v201403 → v201502}/activity_service/get_active_activities.rb +15 -27
- data/examples/{v201403 → v201502}/activity_service/get_all_activities.rb +10 -21
- data/examples/{v201403 → v201502}/activity_service/update_activities.rb +9 -7
- data/examples/{v201403 → v201502}/audience_segment_service/create_audience_segments.rb +1 -1
- data/examples/{v201403 → v201502}/audience_segment_service/get_all_audience_segments.rb +10 -19
- data/examples/{v201403 → v201502}/audience_segment_service/get_first_party_audience_segments.rb +14 -21
- data/examples/{v201403 → v201502}/audience_segment_service/populate_first_party_audience_segments.rb +16 -14
- data/examples/{v201403 → v201502}/audience_segment_service/update_audience_segments.rb +12 -11
- data/examples/{v201403 → v201502}/common/error_handling.rb +1 -1
- data/examples/{v201403 → v201502}/common/oauth2_jwt_handling.rb +9 -17
- data/examples/{v201403 → v201502}/common/setup_oauth2.rb +1 -1
- data/examples/{v201403 → v201502}/company_service/create_companies.rb +1 -1
- data/examples/{v201403 → v201502}/company_service/get_all_companies.rb +10 -18
- data/examples/{v201403 → v201502}/company_service/get_companies_by_statement.rb +21 -16
- data/examples/{v201403 → v201502}/company_service/update_companies.rb +13 -10
- data/examples/{v201403 → v201502}/contact_service/create_contacts.rb +1 -1
- data/examples/{v201403 → v201502}/contact_service/get_all_contacts.rb +11 -19
- data/examples/{v201403 → v201502}/contact_service/get_uninvited_contacts.rb +18 -22
- data/examples/{v201403 → v201502}/contact_service/update_contacts.rb +9 -7
- data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb +1 -1
- data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb +11 -8
- data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb +8 -18
- data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb +9 -7
- data/examples/{v201403 → v201502}/content_service/get_all_content.rb +9 -18
- data/examples/{v201403 → v201502}/content_service/get_content_by_category.rb +18 -28
- data/examples/{v201403 → v201502}/creative_service/copy_image_creatives.rb +7 -7
- data/examples/{v201403 → v201502}/creative_service/create_creative_from_template.rb +1 -1
- data/examples/{v201403 → v201502}/creative_service/create_creatives.rb +1 -1
- data/examples/{v201403 → v201502}/creative_service/create_custom_creative.rb +1 -1
- data/examples/{v201403 → v201502}/creative_service/get_all_creatives.rb +8 -17
- data/examples/{v201403 → v201502}/creative_service/get_creatives_by_statement.rb +18 -13
- data/examples/{v201403 → v201502}/creative_service/update_creatives.rb +16 -11
- data/examples/{v201403 → v201502}/creative_set_service/associate_creative_set_to_line_item.rb +1 -1
- data/examples/{v201403 → v201502}/creative_set_service/create_creative_set.rb +1 -1
- data/examples/{v201403 → v201502}/creative_set_service/get_all_creative_sets.rb +9 -17
- data/examples/{v201403 → v201502}/creative_set_service/get_creative_sets_by_statement.rb +20 -14
- data/examples/{v201403 → v201502}/creative_set_service/update_creative_sets.rb +10 -7
- data/examples/{v201403 → v201502}/creative_template_service/get_all_creative_templates.rb +9 -17
- data/examples/{v201403/creative_template_service/get_creative_templates_by_statement.rb → v201502/creative_template_service/get_system_defined_creative_templates.rb} +24 -13
- data/examples/{v201403 → v201502}/creative_wrapper_service/create_creative_wrappers.rb +1 -1
- data/examples/{v201403 → v201502}/creative_wrapper_service/deactivate_creative_wrapper.rb +9 -7
- data/examples/{v201403 → v201502}/creative_wrapper_service/get_all_creative_wrappers.rb +10 -18
- data/examples/{v201403 → v201502}/creative_wrapper_service/get_creative_wrappers_by_statement.rb +17 -12
- data/examples/{v201403 → v201502}/creative_wrapper_service/update_creative_wrappers.rb +10 -7
- data/examples/{v201403 → v201502}/custom_field_service/create_custom_field_options.rb +1 -1
- data/examples/{v201403 → v201502}/custom_field_service/create_custom_fields.rb +1 -1
- data/examples/{v201403 → v201502}/custom_field_service/deactivate_all_line_item_custom_fields.rb +13 -23
- data/examples/{v201403 → v201502}/custom_field_service/get_all_custom_fields.rb +11 -19
- data/examples/{v201403 → v201502}/custom_field_service/get_all_line_item_custom_fields.rb +19 -14
- data/examples/{v201403 → v201502}/custom_field_service/set_line_item_custom_field_value.rb +24 -19
- data/examples/{v201403 → v201502}/custom_field_service/update_custom_fields.rb +10 -7
- data/examples/{v201403 → v201502}/custom_targeting_service/create_custom_targeting_keys_and_values.rb +1 -1
- data/examples/{v201403 → v201502}/custom_targeting_service/delete_custom_targeting_keys.rb +16 -20
- data/examples/{v201403 → v201502}/custom_targeting_service/delete_custom_targeting_values.rb +23 -21
- data/examples/{v201403 → v201502}/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +15 -36
- data/examples/{v201403 → v201502}/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +20 -16
- data/examples/{v201403 → v201502}/custom_targeting_service/get_custom_targeting_values_by_statement.rb +19 -15
- data/examples/{v201403 → v201502}/custom_targeting_service/update_custom_targeting_keys.rb +4 -3
- data/examples/{v201403 → v201502}/custom_targeting_service/update_custom_targeting_values.rb +34 -30
- data/examples/{v201403/forecast_service/get_forecast.rb → v201502/forecast_service/get_availability_forecast.rb} +39 -15
- data/examples/{v201403/forecast_service/get_forecast_by_id.rb → v201502/forecast_service/get_availability_forecast_for_line_item.rb} +18 -11
- data/examples/v201502/forecast_service/get_delivery_forecast_for_line_items.rb +81 -0
- data/examples/{v201403 → v201502}/inventory_service/create_ad_units.rb +1 -1
- data/examples/{v201403 → v201502}/inventory_service/create_mobile_ad_unit.rb +1 -1
- data/examples/{v201403 → v201502}/inventory_service/create_video_ad_unit.rb +1 -1
- data/examples/{v201403 → v201502}/inventory_service/deactivate_ad_units.rb +19 -23
- data/examples/{v201403 → v201502}/inventory_service/get_ad_unit_sizes.rb +7 -14
- data/examples/{v201403 → v201502}/inventory_service/get_ad_units_by_statement.rb +18 -13
- data/examples/{v201403 → v201502}/inventory_service/get_all_ad_units.rb +8 -17
- data/examples/{v201403 → v201502}/inventory_service/update_ad_units.rb +23 -11
- data/examples/{v201403 → v201502}/label_service/create_labels.rb +1 -1
- data/examples/{v201403 → v201502}/label_service/deactivate_labels.rb +15 -22
- data/examples/{v201403 → v201502}/label_service/get_all_labels.rb +9 -18
- data/examples/{v201403 → v201502}/label_service/get_labels_by_statement.rb +16 -11
- data/examples/{v201403 → v201502}/label_service/update_labels.rb +24 -26
- data/examples/{v201403 → v201502}/line_item_creative_association_service/create_licas.rb +1 -1
- data/examples/{v201403 → v201502}/line_item_creative_association_service/deactivate_licas.rb +15 -24
- data/examples/{v201403 → v201502}/line_item_creative_association_service/get_all_licas.rb +8 -17
- data/examples/{v201403 → v201502}/line_item_creative_association_service/get_licas_by_statement.rb +10 -8
- data/examples/{v201403 → v201502}/line_item_creative_association_service/update_licas.rb +16 -7
- data/examples/{v201403 → v201502}/line_item_service/activate_line_items.rb +13 -21
- data/examples/{v201403 → v201502}/line_item_service/create_line_items.rb +6 -3
- data/examples/{v201403 → v201502}/line_item_service/create_video_line_item.rb +8 -2
- data/examples/{v201403 → v201502}/line_item_service/get_all_line_items.rb +9 -17
- data/examples/{v201403 → v201502}/line_item_service/get_line_items_by_statement.rb +19 -17
- data/examples/{v201403 → v201502}/line_item_service/get_recently_updated_line_items.rb +19 -13
- data/examples/{v201403 → v201502}/line_item_service/target_custom_criteria.rb +9 -7
- data/examples/{v201403 → v201502}/line_item_service/update_line_items.rb +9 -9
- data/examples/{v201403 → v201502}/network_service/get_all_networks.rb +1 -1
- data/examples/{v201403 → v201502}/network_service/get_current_network.rb +1 -1
- data/examples/{v201403 → v201502}/network_service/make_test_network.rb +1 -1
- data/examples/{v201403 → v201502}/order_service/approve_orders.rb +16 -24
- data/examples/{v201403 → v201502}/order_service/create_orders.rb +1 -1
- data/examples/{v201403 → v201502}/order_service/get_all_orders.rb +8 -17
- data/examples/{v201403 → v201502}/order_service/get_orders_by_statement.rb +18 -14
- data/examples/{v201403 → v201502}/order_service/update_orders.rb +15 -7
- data/examples/{v201403 → v201502}/placement_service/create_placements.rb +4 -2
- data/examples/{v201403 → v201502}/placement_service/deactivate_placements.rb +14 -22
- data/examples/{v201403 → v201502}/placement_service/get_all_placements.rb +9 -17
- data/examples/{v201403 → v201502}/placement_service/get_placements_by_statement.rb +18 -13
- data/examples/{v201403 → v201502}/placement_service/update_placements.rb +16 -6
- data/examples/{v201403 → v201502}/publisher_query_language_service/fetch_match_tables.rb +8 -11
- data/examples/{v201403 → v201502}/publisher_query_language_service/get_all_line_items.rb +8 -9
- data/examples/{v201403 → v201502}/publisher_query_language_service/get_geo_targets.rb +10 -10
- data/examples/{v201403 → v201502}/publisher_query_language_service/get_line_items_named_like.rb +10 -10
- data/examples/{v201403 → v201502}/report_service/display_report.rb +1 -1
- data/examples/{v201403 → v201502}/report_service/download_report.rb +1 -1
- data/examples/{v201403 → v201502}/report_service/run_delivery_report.rb +1 -1
- data/examples/{v201403 → v201502}/report_service/run_inventory_report.rb +4 -4
- data/examples/{v201403 → v201502}/report_service/run_reach_report.rb +1 -1
- data/examples/{v201403/report_service/run_merged_delivery_report.rb → v201502/report_service/run_report_with_custom_fields.rb} +12 -14
- data/examples/{v201403 → v201502}/report_service/run_sales_report.rb +1 -1
- data/examples/{v201403 → v201502}/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +25 -21
- data/examples/{v201403 → v201502}/suggested_ad_unit_service/get_all_suggested_ad_units.rb +9 -18
- data/examples/{v201403 → v201502}/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb +24 -21
- data/examples/{v201403 → v201502}/team_service/create_teams.rb +1 -1
- data/examples/{v201403 → v201502}/team_service/get_all_teams.rb +8 -17
- data/examples/{v201403 → v201502}/team_service/get_teams_by_statement.rb +15 -11
- data/examples/{v201403 → v201502}/team_service/update_teams.rb +4 -3
- data/examples/{v201403 → v201502}/user_service/create_users.rb +1 -1
- data/examples/{v201403 → v201502}/user_service/deactivate_users.rb +7 -7
- data/examples/{v201403 → v201502}/user_service/get_all_roles.rb +1 -1
- data/examples/{v201403 → v201502}/user_service/get_all_users.rb +8 -18
- data/examples/{v201403 → v201502}/user_service/get_current_user.rb +1 -1
- data/examples/{v201403 → v201502}/user_service/get_users_by_statement.rb +17 -12
- data/examples/{v201403 → v201502}/user_service/update_users.rb +15 -6
- data/examples/{v201403 → v201502}/user_team_association_service/create_user_team_associations.rb +1 -1
- data/examples/{v201403 → v201502}/user_team_association_service/delete_user_team_associations.rb +13 -21
- data/examples/{v201403 → v201502}/user_team_association_service/get_all_user_team_associations.rb +10 -17
- data/examples/{v201403 → v201502}/user_team_association_service/get_user_team_associations_by_statement.rb +20 -16
- data/examples/{v201403 → v201502}/user_team_association_service/update_user_team_associations.rb +8 -7
- data/lib/dfp_api.rb +0 -10
- data/lib/dfp_api/api_config.rb +22 -67
- data/lib/dfp_api/{v201308 → v201502}/activity_group_service.rb +6 -18
- data/lib/dfp_api/v201502/activity_group_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/activity_service.rb +6 -18
- data/lib/dfp_api/v201502/activity_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/ad_exclusion_rule_service.rb +46 -0
- data/lib/dfp_api/v201502/ad_exclusion_rule_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/ad_rule_service.rb +6 -18
- data/lib/dfp_api/v201502/ad_rule_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/audience_segment_service.rb +6 -6
- data/lib/dfp_api/v201502/audience_segment_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/base_rate_service.rb +6 -18
- data/lib/dfp_api/v201502/base_rate_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/company_service.rb +6 -18
- data/lib/dfp_api/v201502/company_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/contact_service.rb +6 -18
- data/lib/dfp_api/v201502/contact_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/content_bundle_service.rb +6 -18
- data/lib/dfp_api/v201502/content_bundle_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/content_metadata_key_hierarchy_service.rb +46 -0
- data/lib/dfp_api/v201502/content_metadata_key_hierarchy_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/content_service.rb +6 -6
- data/lib/dfp_api/v201502/content_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/creative_service.rb +6 -18
- data/lib/dfp_api/v201502/creative_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/creative_set_service.rb +6 -10
- data/lib/dfp_api/v201502/creative_set_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/creative_template_service.rb +6 -10
- data/lib/dfp_api/v201502/creative_template_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/creative_wrapper_service.rb +6 -18
- data/lib/dfp_api/v201502/creative_wrapper_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/custom_field_service.rb +6 -26
- data/lib/dfp_api/v201502/custom_field_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/custom_targeting_service.rb +6 -6
- data/lib/dfp_api/v201502/custom_targeting_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/exchange_rate_service.rb +6 -10
- data/lib/dfp_api/v201502/exchange_rate_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/forecast_service.rb +46 -0
- data/lib/dfp_api/v201502/forecast_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/inventory_service.rb +6 -18
- data/lib/dfp_api/v201502/inventory_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/label_service.rb +6 -18
- data/lib/dfp_api/v201502/label_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/line_item_creative_association_service.rb +6 -18
- data/lib/dfp_api/v201502/line_item_creative_association_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/line_item_service.rb +6 -18
- data/lib/dfp_api/v201502/line_item_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/line_item_template_service.rb +6 -6
- data/lib/dfp_api/v201502/line_item_template_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/live_stream_event_service.rb +46 -0
- data/lib/dfp_api/v201502/live_stream_event_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/network_service.rb +6 -6
- data/lib/dfp_api/v201502/network_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/order_service.rb +6 -18
- data/lib/dfp_api/v201502/order_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/package_service.rb +46 -0
- data/lib/dfp_api/v201502/package_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/placement_service.rb +6 -18
- data/lib/dfp_api/v201502/placement_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/premium_rate_service.rb +42 -0
- data/lib/dfp_api/v201502/premium_rate_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/product_package_item_service.rb +46 -0
- data/lib/dfp_api/v201502/product_package_item_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/product_package_service.rb +46 -0
- data/lib/dfp_api/v201502/product_package_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/product_service.rb +6 -14
- data/lib/dfp_api/v201502/product_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/product_template_service.rb +6 -18
- data/lib/dfp_api/v201502/product_template_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/proposal_line_item_service.rb +6 -18
- data/lib/dfp_api/v201502/proposal_line_item_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/proposal_service.rb +6 -18
- data/lib/dfp_api/v201502/proposal_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/publisher_query_language_service.rb +6 -6
- data/lib/dfp_api/v201502/publisher_query_language_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/rate_card_service.rb +6 -18
- data/lib/dfp_api/v201502/rate_card_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/reconciliation_order_report_service.rb +6 -10
- data/lib/dfp_api/v201502/reconciliation_order_report_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/reconciliation_report_row_service.rb +6 -6
- data/lib/dfp_api/v201502/reconciliation_report_row_service_registry.rb +45 -0
- data/lib/dfp_api/{v201306 → v201502}/reconciliation_report_service.rb +6 -14
- data/lib/dfp_api/v201502/reconciliation_report_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/report_service.rb +6 -6
- data/lib/dfp_api/v201502/report_service_registry.rb +45 -0
- data/lib/dfp_api/v201502/shared_ad_unit_service.rb +38 -0
- data/lib/dfp_api/v201502/shared_ad_unit_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/suggested_ad_unit_service.rb +6 -10
- data/lib/dfp_api/v201502/suggested_ad_unit_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/team_service.rb +6 -18
- data/lib/dfp_api/v201502/team_service_registry.rb +45 -0
- data/lib/dfp_api/{v201308 → v201502}/user_service.rb +6 -18
- data/lib/dfp_api/v201502/user_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/user_team_association_service.rb +6 -18
- data/lib/dfp_api/v201502/user_team_association_service_registry.rb +45 -0
- data/lib/dfp_api/{v201311 → v201502}/workflow_request_service.rb +6 -6
- data/lib/dfp_api/v201502/workflow_request_service_registry.rb +45 -0
- data/lib/dfp_api/version.rb +1 -1
- metadata +909 -1057
- checksums.yaml +0 -15
- data/examples/v201403/creative_template_service/get_creative_template.rb +0 -74
- data/examples/v201403/line_item_service/create_mobile_line_item.rb +0 -135
- data/examples/v201403/report_service/run_report_with_custom_fields.rb +0 -135
- data/examples/v201403/suggested_ad_unit_service/get_suggested_ad_unit.rb +0 -75
- data/lib/dfp_api/client_login_header_handler.rb +0 -52
- data/lib/dfp_api/v201306/activity_group_service.rb +0 -54
- data/lib/dfp_api/v201306/activity_group_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/activity_service.rb +0 -54
- data/lib/dfp_api/v201306/activity_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/ad_rule_service.rb +0 -58
- data/lib/dfp_api/v201306/ad_rule_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/audience_segment_service.rb +0 -34
- data/lib/dfp_api/v201306/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/base_rate_service.rb +0 -58
- data/lib/dfp_api/v201306/base_rate_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/company_service.rb +0 -54
- data/lib/dfp_api/v201306/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/contact_service.rb +0 -54
- data/lib/dfp_api/v201306/contact_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/content_bundle_service.rb +0 -58
- data/lib/dfp_api/v201306/content_bundle_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/content_service.rb +0 -38
- data/lib/dfp_api/v201306/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/creative_service.rb +0 -54
- data/lib/dfp_api/v201306/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/creative_set_service.rb +0 -46
- data/lib/dfp_api/v201306/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/creative_wrapper_service.rb +0 -58
- data/lib/dfp_api/v201306/creative_wrapper_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/custom_field_service.rb +0 -78
- data/lib/dfp_api/v201306/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/forecast_service.rb +0 -38
- data/lib/dfp_api/v201306/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/inventory_service.rb +0 -62
- data/lib/dfp_api/v201306/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/label_service.rb +0 -58
- data/lib/dfp_api/v201306/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/line_item_creative_association_service.rb +0 -62
- data/lib/dfp_api/v201306/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/line_item_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/network_service.rb +0 -46
- data/lib/dfp_api/v201306/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/placement_service.rb +0 -58
- data/lib/dfp_api/v201306/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/product_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/product_template_service.rb +0 -58
- data/lib/dfp_api/v201306/product_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/proposal_line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/proposal_service.rb +0 -58
- data/lib/dfp_api/v201306/proposal_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/rate_card_customization_service.rb +0 -58
- data/lib/dfp_api/v201306/rate_card_customization_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/rate_card_service.rb +0 -58
- data/lib/dfp_api/v201306/rate_card_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/reconciliation_order_report_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/reconciliation_report_row_service.rb +0 -38
- data/lib/dfp_api/v201306/reconciliation_report_row_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/reconciliation_report_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/report_service.rb +0 -46
- data/lib/dfp_api/v201306/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/suggested_ad_unit_service.rb +0 -42
- data/lib/dfp_api/v201306/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/team_service.rb +0 -54
- data/lib/dfp_api/v201306/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/user_service.rb +0 -66
- data/lib/dfp_api/v201306/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/user_team_association_service.rb +0 -58
- data/lib/dfp_api/v201306/user_team_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201306/workflow_action_service.rb +0 -38
- data/lib/dfp_api/v201306/workflow_action_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/activity_group_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/activity_service.rb +0 -54
- data/lib/dfp_api/v201308/activity_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/ad_rule_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/audience_segment_service.rb +0 -46
- data/lib/dfp_api/v201308/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/base_rate_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/company_service.rb +0 -54
- data/lib/dfp_api/v201308/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/contact_service.rb +0 -54
- data/lib/dfp_api/v201308/contact_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/content_bundle_service.rb +0 -58
- data/lib/dfp_api/v201308/content_bundle_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/creative_service.rb +0 -54
- data/lib/dfp_api/v201308/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/creative_set_service.rb +0 -46
- data/lib/dfp_api/v201308/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/creative_template_service.rb +0 -38
- data/lib/dfp_api/v201308/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/creative_wrapper_service.rb +0 -58
- data/lib/dfp_api/v201308/creative_wrapper_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/custom_targeting_service.rb +0 -62
- data/lib/dfp_api/v201308/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/forecast_service.rb +0 -38
- data/lib/dfp_api/v201308/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/label_service.rb +0 -58
- data/lib/dfp_api/v201308/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/line_item_service.rb +0 -58
- data/lib/dfp_api/v201308/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/line_item_template_service.rb +0 -34
- data/lib/dfp_api/v201308/line_item_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/order_service.rb +0 -58
- data/lib/dfp_api/v201308/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/product_service.rb +0 -50
- data/lib/dfp_api/v201308/product_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/product_template_service.rb +0 -58
- data/lib/dfp_api/v201308/product_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/proposal_line_item_service.rb +0 -58
- data/lib/dfp_api/v201308/proposal_line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/proposal_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/publisher_query_language_service.rb +0 -34
- data/lib/dfp_api/v201308/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/rate_card_customization_service.rb +0 -58
- data/lib/dfp_api/v201308/rate_card_customization_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/rate_card_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/reconciliation_order_report_service.rb +0 -42
- data/lib/dfp_api/v201308/reconciliation_order_report_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/reconciliation_report_row_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/reconciliation_report_service.rb +0 -46
- data/lib/dfp_api/v201308/reconciliation_report_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/report_service.rb +0 -46
- data/lib/dfp_api/v201308/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/suggested_ad_unit_service.rb +0 -42
- data/lib/dfp_api/v201308/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/team_service.rb +0 -54
- data/lib/dfp_api/v201308/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/user_team_association_service.rb +0 -58
- data/lib/dfp_api/v201308/user_team_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201308/workflow_action_service.rb +0 -38
- data/lib/dfp_api/v201308/workflow_action_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/activity_group_service.rb +0 -54
- data/lib/dfp_api/v201311/activity_group_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/activity_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/ad_rule_service.rb +0 -58
- data/lib/dfp_api/v201311/ad_rule_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/base_rate_service.rb +0 -58
- data/lib/dfp_api/v201311/base_rate_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/contact_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/content_bundle_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/content_metadata_key_hierarchy_service.rb +0 -34
- data/lib/dfp_api/v201311/content_metadata_key_hierarchy_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/content_service.rb +0 -38
- data/lib/dfp_api/v201311/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/creative_template_service.rb +0 -38
- data/lib/dfp_api/v201311/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/creative_wrapper_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/custom_field_service.rb +0 -78
- data/lib/dfp_api/v201311/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/custom_targeting_service.rb +0 -62
- data/lib/dfp_api/v201311/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/exchange_rate_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/forecast_service.rb +0 -38
- data/lib/dfp_api/v201311/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/inventory_service.rb +0 -62
- data/lib/dfp_api/v201311/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/line_item_creative_association_service.rb +0 -62
- data/lib/dfp_api/v201311/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/line_item_service.rb +0 -58
- data/lib/dfp_api/v201311/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/line_item_template_service.rb +0 -34
- data/lib/dfp_api/v201311/line_item_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/network_service.rb +0 -46
- data/lib/dfp_api/v201311/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/order_service.rb +0 -58
- data/lib/dfp_api/v201311/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/placement_service.rb +0 -58
- data/lib/dfp_api/v201311/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/product_service.rb +0 -50
- data/lib/dfp_api/v201311/product_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/product_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/proposal_line_item_service.rb +0 -58
- data/lib/dfp_api/v201311/proposal_line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/proposal_service.rb +0 -58
- data/lib/dfp_api/v201311/proposal_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/publisher_query_language_service.rb +0 -34
- data/lib/dfp_api/v201311/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/rate_card_customization_service.rb +0 -58
- data/lib/dfp_api/v201311/rate_card_customization_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/rate_card_service.rb +0 -58
- data/lib/dfp_api/v201311/rate_card_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/reconciliation_order_report_service.rb +0 -42
- data/lib/dfp_api/v201311/reconciliation_order_report_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/reconciliation_report_row_service.rb +0 -38
- data/lib/dfp_api/v201311/reconciliation_report_row_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/reconciliation_report_service.rb +0 -46
- data/lib/dfp_api/v201311/reconciliation_report_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/user_service.rb +0 -66
- data/lib/dfp_api/v201311/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/user_team_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201311/workflow_request_service_registry.rb +0 -46
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
ZDBlMGYxMDlkY2Q2YWFkYzNlNDIzNDRiYjhlZGVjN2U4OGVmYzA2Nw==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
Njk3ZTRmODEzNDQwN2E2NzNiY2FlYWRlNzcyNDY5ZTU1ODU0ZjJkNA==
|
7
|
-
SHA512:
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
M2YwODAzMmY1Nzc0MDA2NTZiZjU5NTM5NTc4ZmQwMmFkYzIwODIxYWFlMTk4
|
10
|
-
YzU3NGM1ZDM1ZGY5YmI3ODc4ZmVjNWE2N2Y2MGU5OTY3YmRiYWYxY2UxZThh
|
11
|
-
ZTM5YTI1YjU4YWE5ZjVhNmJmODU4MzNhMjIxMmE5MDIzMDQ3NWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OGYwNjRiN2Q5ODgxYmJiNjdhZjE2ZDhlMTE1ZDE2YmQ5Yzg0YTk1NDM1ODdj
|
14
|
-
YWFjYTdlMjA5ZDVmMzc2NDUzM2JiOTVlNzRlZWJhNjk5NDg4ZDdlZjFiMjRm
|
15
|
-
MjFlODM1OWUzYzBhMzU0MzAwMzMxM2NkZTUwZmM1NzM4YWU4MWQ=
|
@@ -1,74 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: utf-8
|
3
|
-
#
|
4
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
5
|
-
#
|
6
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
17
|
-
# implied.
|
18
|
-
# See the License for the specific language governing permissions and
|
19
|
-
# limitations under the License.
|
20
|
-
#
|
21
|
-
# This example gets a creative template by its ID. To determine which creative
|
22
|
-
# templates exist, run get_all_creative_templates.rb.
|
23
|
-
#
|
24
|
-
# Tags: CreativeTemplateService.getCreativeTemplate
|
25
|
-
|
26
|
-
require 'dfp_api'
|
27
|
-
|
28
|
-
API_VERSION = :v201403
|
29
|
-
|
30
|
-
def get_creative_template()
|
31
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
32
|
-
dfp = DfpApi::Api.new
|
33
|
-
|
34
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
35
|
-
# the configuration file or provide your own logger:
|
36
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
37
|
-
|
38
|
-
# Get the CreativeTemplateService.
|
39
|
-
creative_template_service = dfp.service(:CreativeTemplateService, API_VERSION)
|
40
|
-
|
41
|
-
# Set the ID of the creative_template to get.
|
42
|
-
creative_template_id = 'INSERT_CREATIVE_ID_HERE'.to_i
|
43
|
-
|
44
|
-
# Get the creative_template.
|
45
|
-
creative_template =
|
46
|
-
creative_template_service.get_creative_template(creative_template_id)
|
47
|
-
|
48
|
-
if creative_template
|
49
|
-
puts "Creative template with ID: %d, name: '%s' and type: '%s' was found." %
|
50
|
-
[creative_template[:id], creative_template[:name],
|
51
|
-
creative_template[:type]]
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
if __FILE__ == $0
|
56
|
-
begin
|
57
|
-
get_creative_template()
|
58
|
-
|
59
|
-
# HTTP errors.
|
60
|
-
rescue AdsCommon::Errors::HttpError => e
|
61
|
-
puts "HTTP Error: %s" % e
|
62
|
-
|
63
|
-
# API errors.
|
64
|
-
rescue DfpApi::Errors::ApiException => e
|
65
|
-
puts "Message: %s" % e.message
|
66
|
-
puts 'Errors:'
|
67
|
-
e.errors.each_with_index do |error, index|
|
68
|
-
puts "\tError [%d]:" % (index + 1)
|
69
|
-
error.each do |field, value|
|
70
|
-
puts "\t\t%s: %s" % [field, value]
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,135 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: utf-8
|
3
|
-
#
|
4
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
5
|
-
#
|
6
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
17
|
-
# implied.
|
18
|
-
# See the License for the specific language governing permissions and
|
19
|
-
# limitations under the License.
|
20
|
-
#
|
21
|
-
# This example create a new line item to serve to the mobile platform. To
|
22
|
-
# determine which line items exist, run get_all_line_items.rb. To determine
|
23
|
-
# which orders exist, run get_all_orders.rb. To create a mobile ad unit, run
|
24
|
-
# create_mobile_ad_unit.rb. To determine which placements exist, run
|
25
|
-
# get_all_placements.rb.
|
26
|
-
#
|
27
|
-
# Mobile features needs to be enabled in your account to use mobile targeting.
|
28
|
-
#
|
29
|
-
# Tags: LineItemService.createLineItem
|
30
|
-
|
31
|
-
require 'dfp_api'
|
32
|
-
|
33
|
-
API_VERSION = :v201403
|
34
|
-
|
35
|
-
def create_mobile_line_item()
|
36
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
37
|
-
dfp = DfpApi::Api.new
|
38
|
-
|
39
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
40
|
-
# the configuration file or provide your own logger:
|
41
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
42
|
-
|
43
|
-
# Get the LineItemService.
|
44
|
-
line_item_service = dfp.service(:LineItemService, API_VERSION)
|
45
|
-
|
46
|
-
# Set the order that all created line items will belong to and the
|
47
|
-
# placement containing ad units with a mobile target platform.
|
48
|
-
order_id = 'INSERT_ORDER_ID_HERE'.to_i
|
49
|
-
targeted_placement_id = 'INSERT_MOBILE_PLACEMENT_ID_HERE'.to_i
|
50
|
-
|
51
|
-
# Create inventory targeting.
|
52
|
-
inventory_targeting = {:targeted_placement_ids => [targeted_placement_id]}
|
53
|
-
|
54
|
-
# Create technology targeting.
|
55
|
-
technology_targeting = {
|
56
|
-
:device_manufacturer_targeting => {
|
57
|
-
# Target the Google device manufacturer (40100).
|
58
|
-
:device_manufacturers => [{:id => 40100}],
|
59
|
-
:is_targeted => true
|
60
|
-
},
|
61
|
-
:mobile_device_targeting => {
|
62
|
-
# Exclude the Nexus One device (604046).
|
63
|
-
:excluded_mobile_devices => [{:id => 604046}]
|
64
|
-
},
|
65
|
-
:mobile_device_submodel_targeting => {
|
66
|
-
# Target the iPhone 4 device submodel (640003).
|
67
|
-
:targeted_mobile_device_submodels => [{:id => 640003}]
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
# Create targeting.
|
72
|
-
targeting = {
|
73
|
-
:inventory_targeting => inventory_targeting,
|
74
|
-
:technology_targeting => technology_targeting
|
75
|
-
}
|
76
|
-
|
77
|
-
# Create local line item object.
|
78
|
-
line_item = {
|
79
|
-
:name => 'Mobile line item',
|
80
|
-
:order_id => order_id,
|
81
|
-
:targeting => targeting,
|
82
|
-
:line_item_type => 'STANDARD',
|
83
|
-
:allow_overbook => true,
|
84
|
-
# Set the target platform to mobile.
|
85
|
-
:target_platform => 'MOBILE',
|
86
|
-
# Set the creative rotation type to even.
|
87
|
-
:creative_rotation_type => 'EVEN',
|
88
|
-
# Set the size of creatives that can be associated with this line item.
|
89
|
-
:creative_placeholders => [
|
90
|
-
{:size => {:width => 300, :height => 250, :is_aspect_ratio => false}}
|
91
|
-
],
|
92
|
-
# Set the length of the line item to run.
|
93
|
-
:start_date_time_type => 'IMMEDIATELY',
|
94
|
-
:end_date_time => Time.new + 60 * 60 * 24 * 7,
|
95
|
-
# Set the cost per day to $2.
|
96
|
-
:cost_type => 'CPM',
|
97
|
-
:cost_per_unit => {:currency_code => 'USD', :micro_amount => 2000000},
|
98
|
-
# Set the number of units bought to 500,000 so that the budget is $1,000.
|
99
|
-
:units_bought => 500000,
|
100
|
-
:unit_type => 'IMPRESSIONS'
|
101
|
-
}
|
102
|
-
|
103
|
-
# Create the line item on the server.
|
104
|
-
return_line_item = line_item_service.create_line_item(line_item)
|
105
|
-
|
106
|
-
if return_line_item
|
107
|
-
puts(("Line item with ID: %d, belonging to order ID: %d, " +
|
108
|
-
"and named: %s was created.") %
|
109
|
-
[return_line_item[:id], return_line_item[:order_id],
|
110
|
-
return_line_item[:name]])
|
111
|
-
else
|
112
|
-
raise 'No line items were created.'
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
if __FILE__ == $0
|
117
|
-
begin
|
118
|
-
create_mobile_line_item()
|
119
|
-
|
120
|
-
# HTTP errors.
|
121
|
-
rescue AdsCommon::Errors::HttpError => e
|
122
|
-
puts "HTTP Error: %s" % e
|
123
|
-
|
124
|
-
# API errors.
|
125
|
-
rescue DfpApi::Errors::ApiException => e
|
126
|
-
puts "Message: %s" % e.message
|
127
|
-
puts 'Errors:'
|
128
|
-
e.errors.each_with_index do |error, index|
|
129
|
-
puts "\tError [%d]:" % (index + 1)
|
130
|
-
error.each do |field, value|
|
131
|
-
puts "\t\t%s: %s" % [field, value]
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
@@ -1,135 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: utf-8
|
3
|
-
#
|
4
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
5
|
-
#
|
6
|
-
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
17
|
-
# implied.
|
18
|
-
# See the License for the specific language governing permissions and
|
19
|
-
# limitations under the License.
|
20
|
-
#
|
21
|
-
# This example runs a report that includes custom fields found in the line items
|
22
|
-
# of an order. To download the report see download_report.rb.
|
23
|
-
#
|
24
|
-
# Tags: LineItemService.getLineItemByStatement
|
25
|
-
# Tags: ReportService.runReportJob, ReportService.getReportJob
|
26
|
-
|
27
|
-
require 'dfp_api'
|
28
|
-
|
29
|
-
API_VERSION = :v201403
|
30
|
-
PAGE_SIZE = 500
|
31
|
-
MAX_RETRIES = 10
|
32
|
-
RETRY_INTERVAL = 30
|
33
|
-
|
34
|
-
def run_report_with_custom_fields()
|
35
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
36
|
-
dfp = DfpApi::Api.new
|
37
|
-
|
38
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
39
|
-
# the configuration file or provide your own logger:
|
40
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
41
|
-
|
42
|
-
# Get the LineItemService.
|
43
|
-
line_item_service = dfp.service(:LineItemService, API_VERSION)
|
44
|
-
|
45
|
-
# Get the ReportService.
|
46
|
-
report_service = dfp.service(:ReportService, API_VERSION)
|
47
|
-
|
48
|
-
# Set the ID of the order to get line items from.
|
49
|
-
order_id = 'INSERT_ORDER_ID_HERE'.to_i
|
50
|
-
|
51
|
-
# Define initial values.
|
52
|
-
offset = 0
|
53
|
-
page = {}
|
54
|
-
custom_field_ids = []
|
55
|
-
|
56
|
-
# Create a statement to only select line items from a given order.
|
57
|
-
statement = {
|
58
|
-
:values => [
|
59
|
-
{:key => 'order_id',
|
60
|
-
:value => {:value => order_id, :xsi_type => 'NumberValue'}}
|
61
|
-
]
|
62
|
-
}
|
63
|
-
query_text = 'WHERE orderId = :order_id LIMIT %d OFFSET %d'
|
64
|
-
|
65
|
-
begin
|
66
|
-
# Update the statement to get one page with current offset.
|
67
|
-
statement[:query] = query_text % [PAGE_SIZE, offset]
|
68
|
-
|
69
|
-
# Get line items by statement.
|
70
|
-
page = line_item_service.get_line_items_by_statement(statement)
|
71
|
-
|
72
|
-
if page[:results]
|
73
|
-
# Increase query offset by page size.
|
74
|
-
offset += PAGE_SIZE
|
75
|
-
|
76
|
-
# Get custom field IDs from the line items of an order.
|
77
|
-
page[:results].each do |line_item|
|
78
|
-
if line_item[:custom_field_values]
|
79
|
-
line_item[:custom_field_values].each do |value|
|
80
|
-
custom_field_ids |= [value[:custom_field_id]]
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end while offset < page[:total_result_set_size]
|
86
|
-
|
87
|
-
# Create report query.
|
88
|
-
statement[:query] = 'WHERE ORDER_ID = :order_id'
|
89
|
-
report_query = {
|
90
|
-
:date_range_type => 'LAST_MONTH',
|
91
|
-
:dimensions => ['LINE_ITEM_ID', 'LINE_ITEM_NAME'],
|
92
|
-
:custom_field_ids => custom_field_ids,
|
93
|
-
:columns => ['AD_SERVER_IMPRESSIONS'],
|
94
|
-
:statement => statement
|
95
|
-
}
|
96
|
-
|
97
|
-
# Create report job.
|
98
|
-
report_job = {:report_query => report_query}
|
99
|
-
|
100
|
-
# Run report job.
|
101
|
-
report_job = report_service.run_report_job(report_job);
|
102
|
-
|
103
|
-
MAX_RETRIES.times do |retry_count|
|
104
|
-
# Get the report job status.
|
105
|
-
report_job = report_service.get_report_job(report_job[:id])
|
106
|
-
|
107
|
-
break unless report_job[:report_job_status] == 'IN_PROGRESS'
|
108
|
-
puts "Report with ID: %d is still running." % report_job[:id]
|
109
|
-
sleep(RETRY_INTERVAL)
|
110
|
-
end
|
111
|
-
|
112
|
-
puts "Report job with ID: %d finished with status %s." %
|
113
|
-
[report_job[:id], report_job[:report_job_status]]
|
114
|
-
end
|
115
|
-
|
116
|
-
if __FILE__ == $0
|
117
|
-
begin
|
118
|
-
run_report_with_custom_fields()
|
119
|
-
|
120
|
-
# HTTP errors.
|
121
|
-
rescue AdsCommon::Errors::HttpError => e
|
122
|
-
puts "HTTP Error: %s" % e
|
123
|
-
|
124
|
-
# API errors.
|
125
|
-
rescue DfpApi::Errors::ApiException => e
|
126
|
-
puts "Message: %s" % e.message
|
127
|
-
puts 'Errors:'
|
128
|
-
e.errors.each_with_index do |error, index|
|
129
|
-
puts "\tError [%d]:" % (index + 1)
|
130
|
-
error.each do |field, value|
|
131
|
-
puts "\t\t%s: %s" % [field, value]
|
132
|
-
end
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: utf-8
|
3
|
-
#
|
4
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
5
|
-
#
|
6
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
17
|
-
# implied.
|
18
|
-
# See the License for the specific language governing permissions and
|
19
|
-
# limitations under the License.
|
20
|
-
#
|
21
|
-
# This example gets a suggested ad unit by its ID. To determine which suggested
|
22
|
-
# ad units exist, run get_all_suggested_ad_units.rb.
|
23
|
-
#
|
24
|
-
# This feature is only available to DFP premium solution networks.
|
25
|
-
#
|
26
|
-
# Tags: SuggestedAdUnitService.getSuggestedAdUnit
|
27
|
-
|
28
|
-
require 'dfp_api'
|
29
|
-
|
30
|
-
API_VERSION = :v201403
|
31
|
-
|
32
|
-
def get_suggested_ad_unit()
|
33
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
34
|
-
dfp = DfpApi::Api.new
|
35
|
-
|
36
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
37
|
-
# the configuration file or provide your own logger:
|
38
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
39
|
-
|
40
|
-
# Get the SuggestedAdUnitService.
|
41
|
-
suggested_ad_unit_service = dfp.service(:SuggestedAdUnitService, API_VERSION)
|
42
|
-
|
43
|
-
# Set the ID of the ad unit to get.
|
44
|
-
suggested_ad_unit_id = 'INSERT_SUGGESTED_AD_UNIT_ID_HERE'
|
45
|
-
|
46
|
-
# Get the suggested ad unit.
|
47
|
-
suggested_ad_unit =
|
48
|
-
suggested_ad_unit_service.get_suggested_ad_unit(suggested_ad_unit_id)
|
49
|
-
|
50
|
-
if suggested_ad_unit
|
51
|
-
puts "Suggested ad unit with ID: '%s' and number of requests: %d" %
|
52
|
-
[suggested_ad_unit[:id], suggested_ad_unit[:num_requests]]
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
if __FILE__ == $0
|
57
|
-
begin
|
58
|
-
get_suggested_ad_unit()
|
59
|
-
|
60
|
-
# HTTP errors.
|
61
|
-
rescue AdsCommon::Errors::HttpError => e
|
62
|
-
puts "HTTP Error: %s" % e
|
63
|
-
|
64
|
-
# API errors.
|
65
|
-
rescue DfpApi::Errors::ApiException => e
|
66
|
-
puts "Message: %s" % e.message
|
67
|
-
puts 'Errors:'
|
68
|
-
e.errors.each_with_index do |error, index|
|
69
|
-
puts "\tError [%d]:" % (index + 1)
|
70
|
-
error.each do |field, value|
|
71
|
-
puts "\t\t%s: %s" % [field, value]
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Encoding: utf-8
|
3
|
-
#
|
4
|
-
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
5
|
-
#
|
6
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
7
|
-
#
|
8
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
-
# you may not use this file except in compliance with the License.
|
10
|
-
# You may obtain a copy of the License at
|
11
|
-
#
|
12
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
#
|
14
|
-
# Unless required by applicable law or agreed to in writing, software
|
15
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
17
|
-
# implied.
|
18
|
-
# See the License for the specific language governing permissions and
|
19
|
-
# limitations under the License.
|
20
|
-
#
|
21
|
-
# Handles SOAP headers and namespaces definition for ClientLogin type header.
|
22
|
-
|
23
|
-
require 'ads_common/savon_headers/base_header_handler'
|
24
|
-
|
25
|
-
module DfpApi
|
26
|
-
class ClientLoginHeaderHandler < AdsCommon::SavonHeaders::BaseHeaderHandler
|
27
|
-
private
|
28
|
-
|
29
|
-
# Generates DFP API specific request header with ClientLogin data in
|
30
|
-
# required namespace.
|
31
|
-
#
|
32
|
-
# Args:
|
33
|
-
# - None
|
34
|
-
#
|
35
|
-
# Returns:
|
36
|
-
# - Hash containing a header with filled in credentials
|
37
|
-
#
|
38
|
-
def generate_request_header()
|
39
|
-
request_header = super()
|
40
|
-
auth_header = prepend_namespace('authentication')
|
41
|
-
credentials = @credential_handler.credentials
|
42
|
-
request_header[auth_header] = {
|
43
|
-
prepend_namespace('token') => @auth_handler.get_token(credentials)
|
44
|
-
}
|
45
|
-
request_header[:attributes!] ||= {}
|
46
|
-
request_header[:attributes!][auth_header] = {
|
47
|
-
'xsi:type' => prepend_namespace('ClientLogin'),
|
48
|
-
}
|
49
|
-
return request_header
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|