google-dfp-api 0.6.3 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/ChangeLog +4 -0
- data/README +2 -2
- data/dfp_api.yml +1 -3
- data/examples/v201208/publisher_query_language_service/get_all_cities.rb +1 -1
- data/examples/v201211/publisher_query_language_service/get_all_cities.rb +1 -1
- data/examples/v201302/publisher_query_language_service/get_all_cities.rb +1 -1
- data/examples/v201306/publisher_query_language_service/get_all_cities.rb +1 -1
- data/examples/v201308/activity_group_service/create_activity_groups.rb +94 -0
- data/examples/v201308/activity_group_service/get_active_activity_groups.rb +100 -0
- data/examples/{v201203/content_service/get_all_content.rb → v201308/activity_group_service/get_all_activity_groups.rb} +20 -18
- data/examples/{v201206/user_service/update_users.rb → v201308/activity_group_service/update_activity_groups.rb} +28 -30
- data/examples/{v201204/inventory_service/get_ad_unit_sizes.rb → v201308/activity_service/create_activities.rb} +32 -26
- data/examples/v201308/activity_service/get_active_activities.rb +107 -0
- data/examples/v201308/activity_service/get_all_activities.rb +144 -0
- data/examples/{v201204/label_service/create_labels.rb → v201308/activity_service/update_activities.rb} +27 -25
- data/examples/v201308/audience_segment_service/create_audience_segments.rb +118 -0
- data/examples/{v201203 → v201308}/audience_segment_service/get_all_audience_segments.rb +4 -3
- data/examples/{v201204/audience_segment_service/get_all_audience_segments.rb → v201308/audience_segment_service/get_first_party_audience_segments.rb} +14 -8
- data/examples/v201308/audience_segment_service/populate_first_party_audience_segments.rb +101 -0
- data/examples/v201308/audience_segment_service/update_audience_segments.rb +98 -0
- data/examples/{v201204 → v201308}/common/error_handling.rb +1 -1
- data/examples/{v201206 → v201308}/common/oauth2_handling.rb +1 -1
- data/examples/{v201206/user_service/get_all_users.rb → v201308/common/oauth2_jwt_handling.rb} +21 -7
- data/examples/{v201204 → v201308}/company_service/create_companies.rb +1 -1
- data/examples/{v201204 → v201308}/company_service/get_all_companies.rb +1 -1
- data/examples/{v201204 → v201308}/company_service/get_companies_by_statement.rb +1 -1
- data/examples/{v201204 → v201308}/company_service/get_company.rb +1 -1
- data/examples/{v201206 → v201308}/company_service/update_companies.rb +9 -2
- data/examples/{v201206/inventory_service/get_ad_unit_sizes.rb → v201308/contact_service/create_contacts.rb} +36 -26
- data/examples/{v201206/content_service/get_all_content.rb → v201308/contact_service/get_all_contacts.rb} +14 -16
- data/examples/v201308/contact_service/get_uninvited_contacts.rb +102 -0
- data/examples/{v201206/company_service/create_companies.rb → v201308/contact_service/update_contacts.rb} +26 -23
- data/examples/{v201204 → v201308}/content_service/get_all_content.rb +1 -1
- data/examples/{v201204 → v201308}/content_service/get_content_by_category.rb +47 -40
- data/examples/{v201206 → v201308}/creative_service/copy_image_creatives.rb +2 -2
- data/examples/{v201206 → v201308}/creative_service/create_creative_from_template.rb +2 -2
- data/examples/{v201204 → v201308}/creative_service/create_creatives.rb +15 -9
- data/examples/{v201206 → v201308}/creative_service/create_custom_creative.rb +2 -2
- data/examples/{v201206 → v201308}/creative_service/get_all_creatives.rb +2 -2
- data/examples/{v201206 → v201308}/creative_service/get_creative.rb +2 -2
- data/examples/{v201204 → v201308}/creative_service/get_creatives_by_statement.rb +2 -2
- data/examples/{v201206 → v201308}/creative_service/update_creatives.rb +1 -1
- data/examples/{v201206/line_item_creative_association_service/get_lica.rb → v201308/creative_set_service/associate_creative_set_to_line_item.rb} +22 -22
- data/examples/{v201206 → v201308}/creative_set_service/create_creative_set.rb +1 -1
- data/examples/{v201206 → v201308}/creative_set_service/get_all_creative_sets.rb +1 -1
- data/examples/{v201206 → v201308}/creative_set_service/get_creative_sets_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/creative_set_service/update_creative_sets.rb +1 -1
- data/examples/{v201206 → v201308}/creative_template_service/get_all_creative_templates.rb +1 -1
- data/examples/{v201204 → v201308}/creative_template_service/get_creative_template.rb +1 -1
- data/examples/{v201206 → v201308}/creative_template_service/get_creative_templates_by_statement.rb +1 -1
- data/examples/v201308/creative_wrapper_service/create_creative_wrappers.rb +89 -0
- data/examples/{v201206/user_service/deactivate_users.rb → v201308/creative_wrapper_service/deactivate_creative_wrapper.rb} +31 -26
- data/examples/{v201206/audience_segment_service/get_all_audience_segments.rb → v201308/creative_wrapper_service/get_all_creative_wrappers.rb} +15 -14
- data/examples/{v201206/team_service/get_teams_by_statement.rb → v201308/creative_wrapper_service/get_creative_wrappers_by_statement.rb} +24 -14
- data/examples/v201308/creative_wrapper_service/update_creative_wrappers.rb +86 -0
- data/examples/{v201204 → v201308}/custom_field_service/create_custom_field_options.rb +1 -1
- data/examples/{v201204 → v201308}/custom_field_service/create_custom_fields.rb +1 -1
- data/examples/{v201204 → v201308}/custom_field_service/deactivate_all_line_item_custom_fields.rb +1 -1
- data/examples/{v201204 → v201308}/custom_field_service/get_all_custom_fields.rb +2 -2
- data/examples/{v201204 → v201308}/custom_field_service/get_all_line_item_custom_fields.rb +1 -1
- data/examples/{v201206 → v201308}/custom_field_service/set_line_item_custom_field_value.rb +1 -1
- data/examples/{v201204 → v201308}/custom_field_service/update_custom_fields.rb +3 -2
- data/examples/{v201204 → v201308}/custom_targeting_service/create_custom_targeting_keys_and_values.rb +2 -2
- data/examples/{v201206 → v201308}/custom_targeting_service/delete_custom_targeting_keys.rb +1 -1
- data/examples/{v201204 → v201308}/custom_targeting_service/delete_custom_targeting_values.rb +1 -1
- data/examples/{v201206 → v201308}/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +1 -1
- data/examples/{v201206 → v201308}/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/custom_targeting_service/get_custom_targeting_values_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/custom_targeting_service/update_custom_targeting_keys.rb +1 -1
- data/examples/{v201206 → v201308}/custom_targeting_service/update_custom_targeting_values.rb +1 -1
- data/examples/{v201206 → v201308}/forecast_service/get_forecast.rb +3 -2
- data/examples/{v201206 → v201308}/forecast_service/get_forecast_by_id.rb +2 -1
- data/examples/{v201204 → v201308}/inventory_service/create_ad_units.rb +1 -1
- data/examples/{v201204 → v201308}/inventory_service/create_mobile_ad_unit.rb +3 -2
- data/examples/{v201206 → v201308}/inventory_service/create_video_ad_unit.rb +1 -1
- data/examples/{v201204 → v201308}/inventory_service/deactivate_ad_units.rb +1 -1
- data/examples/{v201206 → v201308}/inventory_service/get_ad_unit.rb +1 -1
- data/examples/{v201203 → v201308}/inventory_service/get_ad_unit_sizes.rb +3 -3
- data/examples/{v201204 → v201308}/inventory_service/get_ad_units_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/inventory_service/get_all_ad_units.rb +1 -1
- data/examples/{v201206 → v201308}/inventory_service/update_ad_units.rb +3 -1
- data/examples/{v201203 → v201308}/label_service/create_labels.rb +1 -1
- data/examples/{v201206 → v201308}/label_service/deactivate_labels.rb +1 -1
- data/examples/{v201206 → v201308}/label_service/get_all_labels.rb +1 -1
- data/examples/{v201203 → v201308}/label_service/get_label.rb +1 -1
- data/examples/{v201203 → v201308}/label_service/get_labels_by_statement.rb +1 -1
- data/examples/{v201203 → v201308}/label_service/update_labels.rb +2 -2
- data/examples/{v201206 → v201308}/line_item_creative_association_service/create_licas.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_creative_association_service/deactivate_licas.rb +1 -1
- data/examples/{v201204 → v201308}/line_item_creative_association_service/get_all_licas.rb +11 -8
- data/examples/{v201204 → v201308}/line_item_creative_association_service/get_lica.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_creative_association_service/get_licas_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_creative_association_service/update_licas.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_service/activate_line_items.rb +1 -1
- data/examples/{v201204 → v201308}/line_item_service/create_line_items.rb +1 -1
- data/examples/{v201204 → v201308}/line_item_service/create_mobile_line_item.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_service/create_video_line_item.rb +4 -2
- data/examples/{v201206 → v201308}/line_item_service/get_all_line_items.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_service/get_line_item.rb +1 -1
- data/examples/{v201204 → v201308}/line_item_service/get_line_items_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_service/get_recently_updated_line_items.rb +1 -1
- data/examples/{v201204 → v201308}/line_item_service/target_custom_criteria.rb +1 -1
- data/examples/{v201206 → v201308}/line_item_service/update_line_items.rb +1 -1
- data/examples/{v201204 → v201308}/network_service/get_all_networks.rb +1 -1
- data/examples/{v201206 → v201308}/network_service/get_current_network.rb +1 -1
- data/examples/{v201204 → v201308}/network_service/make_test_network.rb +9 -6
- data/examples/{v201206 → v201308}/order_service/approve_orders.rb +1 -1
- data/examples/{v201206 → v201308}/order_service/create_orders.rb +1 -1
- data/examples/{v201206 → v201308}/order_service/get_all_orders.rb +1 -1
- data/examples/{v201204 → v201308}/order_service/get_order.rb +1 -1
- data/examples/{v201206 → v201308}/order_service/get_orders_by_statement.rb +1 -1
- data/examples/{v201204 → v201308}/order_service/update_orders.rb +3 -1
- data/examples/{v201204 → v201308}/placement_service/create_placements.rb +1 -1
- data/examples/{v201206 → v201308}/placement_service/deactivate_placements.rb +1 -1
- data/examples/{v201206 → v201308}/placement_service/get_all_placements.rb +1 -1
- data/examples/{v201204 → v201308}/placement_service/get_placement.rb +1 -1
- data/examples/{v201204 → v201308}/placement_service/get_placements_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/placement_service/update_placements.rb +1 -1
- data/examples/{v201206/publisher_query_language_service/get_all_cities.rb → v201308/publisher_query_language_service/get_all_line_items.rb} +33 -23
- data/examples/{v201204/publisher_query_language_service/get_all_cities.rb → v201308/publisher_query_language_service/get_geo_targets.rb} +33 -21
- data/examples/{v201203/publisher_query_language_service/get_all_cities.rb → v201308/publisher_query_language_service/get_line_items_named_like.rb} +36 -25
- data/examples/{v201204/report_service/download_report.rb → v201308/report_service/display_report.rb} +18 -18
- data/examples/{v201206 → v201308}/report_service/download_report.rb +1 -1
- data/examples/{v201206 → v201308}/report_service/run_delivery_report.rb +4 -4
- data/examples/{v201206 → v201308}/report_service/run_inventory_report.rb +2 -3
- data/examples/{v201206 → v201308}/report_service/run_merged_delivery_report.rb +3 -3
- data/examples/{v201204/report_service/run_sales_report.rb → v201308/report_service/run_reach_report.rb} +10 -12
- data/examples/{v201204/report_service/run_delivery_report.rb → v201308/report_service/run_report_with_custom_fields.rb} +53 -21
- data/examples/{v201206 → v201308}/report_service/run_sales_report.rb +3 -3
- data/examples/{v201206 → v201308}/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +1 -1
- data/examples/{v201206 → v201308}/suggested_ad_unit_service/get_all_suggested_ad_units.rb +1 -1
- data/examples/{v201206 → v201308}/suggested_ad_unit_service/get_suggested_ad_unit.rb +1 -1
- data/examples/{v201206 → v201308}/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb +1 -1
- data/examples/{v201204 → v201308}/team_service/create_teams.rb +1 -1
- data/examples/{v201204 → v201308}/team_service/get_all_teams.rb +1 -1
- data/examples/{v201206 → v201308}/team_service/get_team.rb +1 -1
- data/examples/{v201204 → v201308}/team_service/get_teams_by_statement.rb +1 -1
- data/examples/{v201206 → v201308}/team_service/update_teams.rb +3 -1
- data/examples/{v201206 → v201308}/user_service/create_users.rb +1 -1
- data/examples/{v201204 → v201308}/user_service/deactivate_users.rb +1 -1
- data/examples/{v201204 → v201308}/user_service/get_all_roles.rb +1 -1
- data/examples/{v201204 → v201308}/user_service/get_all_users.rb +1 -1
- data/examples/{v201206 → v201308}/user_service/get_current_user.rb +1 -1
- data/examples/{v201206 → v201308}/user_service/get_user.rb +1 -1
- data/examples/{v201206 → v201308}/user_service/get_users_by_statement.rb +1 -1
- data/examples/{v201204 → v201308}/user_service/update_users.rb +1 -1
- data/examples/{v201206 → v201308}/user_team_association_service/create_user_team_associations.rb +1 -1
- data/examples/{v201204 → v201308}/user_team_association_service/delete_user_team_associations.rb +1 -1
- data/examples/{v201206 → v201308}/user_team_association_service/get_all_user_team_associations.rb +1 -1
- data/examples/{v201206 → v201308}/user_team_association_service/get_user_team_association.rb +1 -1
- data/examples/{v201204 → v201308}/user_team_association_service/get_user_team_associations_by_statement.rb +1 -1
- data/examples/{v201204 → v201308}/user_team_association_service/update_user_team_associations.rb +1 -1
- data/lib/dfp_api/api_config.rb +23 -32
- data/lib/dfp_api/v201308/activity_group_service.rb +54 -0
- data/lib/dfp_api/v201308/activity_group_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/activity_service.rb +54 -0
- data/lib/dfp_api/v201308/activity_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/ad_rule_service.rb +58 -0
- data/lib/dfp_api/v201308/ad_rule_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/audience_segment_service.rb +46 -0
- data/lib/dfp_api/v201308/audience_segment_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/base_rate_service.rb +58 -0
- data/lib/dfp_api/v201308/base_rate_service_registry.rb +46 -0
- data/lib/dfp_api/{v201203 → v201308}/company_service.rb +7 -7
- data/lib/dfp_api/v201308/company_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/contact_service.rb +54 -0
- data/lib/dfp_api/v201308/contact_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/content_bundle_service.rb +58 -0
- data/lib/dfp_api/v201308/content_bundle_service_registry.rb +46 -0
- data/lib/dfp_api/{v201204 → v201308}/content_service.rb +7 -11
- data/lib/dfp_api/v201308/content_service_registry.rb +46 -0
- data/lib/dfp_api/{v201204 → v201308}/creative_service.rb +7 -7
- data/lib/dfp_api/v201308/creative_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/creative_set_service.rb +7 -7
- data/lib/dfp_api/v201308/creative_set_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/creative_template_service.rb +7 -7
- data/lib/dfp_api/{v201206 → v201308}/creative_template_service_registry.rb +4 -4
- data/lib/dfp_api/v201308/creative_wrapper_service.rb +58 -0
- data/lib/dfp_api/v201308/creative_wrapper_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/custom_field_service.rb +7 -7
- data/lib/dfp_api/{v201206 → v201308}/custom_field_service_registry.rb +4 -4
- data/lib/dfp_api/{v201204 → v201308}/custom_targeting_service.rb +7 -7
- data/lib/dfp_api/{v201204 → v201308}/custom_targeting_service_registry.rb +4 -4
- data/lib/dfp_api/{v201204 → v201308}/forecast_service.rb +7 -7
- data/lib/dfp_api/v201308/forecast_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/inventory_service.rb +7 -7
- data/lib/dfp_api/v201308/inventory_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/label_service.rb +7 -7
- data/lib/dfp_api/{v201206 → v201308}/label_service_registry.rb +4 -4
- data/lib/dfp_api/{v201206 → v201308}/line_item_creative_association_service.rb +7 -7
- data/lib/dfp_api/v201308/line_item_creative_association_service_registry.rb +46 -0
- data/lib/dfp_api/{v201203 → v201308}/line_item_service.rb +7 -7
- data/lib/dfp_api/v201308/line_item_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/line_item_template_service.rb +34 -0
- data/lib/dfp_api/v201308/line_item_template_service_registry.rb +46 -0
- data/lib/dfp_api/{v201204 → v201308}/network_service.rb +7 -7
- data/lib/dfp_api/{v201206 → v201308}/network_service_registry.rb +4 -4
- data/lib/dfp_api/{v201203 → v201308}/order_service.rb +7 -7
- data/lib/dfp_api/v201308/order_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/placement_service.rb +7 -7
- data/lib/dfp_api/v201308/placement_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/product_service.rb +50 -0
- data/lib/dfp_api/v201308/product_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/product_template_service.rb +58 -0
- data/lib/dfp_api/v201308/product_template_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/proposal_line_item_service.rb +58 -0
- data/lib/dfp_api/v201308/proposal_line_item_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/proposal_service.rb +58 -0
- data/lib/dfp_api/v201308/proposal_service_registry.rb +46 -0
- data/lib/dfp_api/{v201204 → v201308}/publisher_query_language_service.rb +7 -7
- data/lib/dfp_api/v201308/publisher_query_language_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/rate_card_customization_service.rb +58 -0
- data/lib/dfp_api/v201308/rate_card_customization_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/rate_card_service.rb +58 -0
- data/lib/dfp_api/v201308/rate_card_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/reconciliation_order_report_service.rb +42 -0
- data/lib/dfp_api/v201308/reconciliation_order_report_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/reconciliation_report_row_service.rb +38 -0
- data/lib/dfp_api/v201308/reconciliation_report_row_service_registry.rb +46 -0
- data/lib/dfp_api/v201308/reconciliation_report_service.rb +46 -0
- data/lib/dfp_api/v201308/reconciliation_report_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/report_service.rb +11 -7
- data/lib/dfp_api/v201308/report_service_registry.rb +46 -0
- data/lib/dfp_api/{v201203 → v201308}/suggested_ad_unit_service.rb +7 -7
- data/lib/dfp_api/v201308/suggested_ad_unit_service_registry.rb +46 -0
- data/lib/dfp_api/{v201206 → v201308}/team_service.rb +7 -7
- data/lib/dfp_api/v201308/team_service_registry.rb +46 -0
- data/lib/dfp_api/{v201203 → v201308}/user_service.rb +7 -7
- data/lib/dfp_api/v201308/user_service_registry.rb +46 -0
- data/lib/dfp_api/{v201204 → v201308}/user_team_association_service.rb +7 -7
- data/lib/dfp_api/{v201204 → v201308}/user_team_association_service_registry.rb +4 -4
- data/lib/dfp_api/v201308/workflow_action_service.rb +38 -0
- data/lib/dfp_api/v201308/workflow_action_service_registry.rb +46 -0
- data/lib/dfp_api/version.rb +1 -1
- data/test/bugs/test_issue_00000016.rb +2 -2
- metadata +940 -1193
- data/examples/v201203/common/error_handling.rb +0 -75
- data/examples/v201203/company_service/create_companies.rb +0 -80
- data/examples/v201203/company_service/get_all_companies.rb +0 -91
- data/examples/v201203/company_service/get_companies_by_statement.rb +0 -87
- data/examples/v201203/company_service/get_company.rb +0 -71
- data/examples/v201203/company_service/update_companies.rb +0 -94
- data/examples/v201203/content_service/get_content_by_category.rb +0 -135
- data/examples/v201203/creative_service/copy_image_creatives.rb +0 -114
- data/examples/v201203/creative_service/create_creative_from_template.rb +0 -138
- data/examples/v201203/creative_service/create_creatives.rb +0 -105
- data/examples/v201203/creative_service/create_custom_creative.rb +0 -103
- data/examples/v201203/creative_service/get_all_creatives.rb +0 -92
- data/examples/v201203/creative_service/get_creative.rb +0 -71
- data/examples/v201203/creative_service/get_creatives_by_statement.rb +0 -86
- data/examples/v201203/creative_service/update_creatives.rb +0 -95
- data/examples/v201203/creative_template_service/get_all_creative_templates.rb +0 -93
- data/examples/v201203/creative_template_service/get_creative_template.rb +0 -73
- data/examples/v201203/creative_template_service/get_creative_templates_by_statement.rb +0 -79
- data/examples/v201203/custom_targeting_service/create_custom_targeting_keys_and_values.rb +0 -139
- data/examples/v201203/custom_targeting_service/delete_custom_targeting_keys.rb +0 -120
- data/examples/v201203/custom_targeting_service/delete_custom_targeting_values.rb +0 -124
- data/examples/v201203/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +0 -147
- data/examples/v201203/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +0 -91
- data/examples/v201203/custom_targeting_service/get_custom_targeting_values_by_statement.rb +0 -97
- data/examples/v201203/custom_targeting_service/update_custom_targeting_keys.rb +0 -93
- data/examples/v201203/custom_targeting_service/update_custom_targeting_values.rb +0 -105
- data/examples/v201203/forecast_service/get_forecast.rb +0 -106
- data/examples/v201203/forecast_service/get_forecast_by_id.rb +0 -79
- data/examples/v201203/inventory_service/create_ad_units.rb +0 -100
- data/examples/v201203/inventory_service/create_mobile_ad_unit.rb +0 -99
- data/examples/v201203/inventory_service/create_video_ad_unit.rb +0 -107
- data/examples/v201203/inventory_service/deactivate_ad_units.rb +0 -118
- data/examples/v201203/inventory_service/get_ad_unit.rb +0 -71
- data/examples/v201203/inventory_service/get_ad_units_by_statement.rb +0 -95
- data/examples/v201203/inventory_service/get_all_ad_units.rb +0 -92
- data/examples/v201203/inventory_service/update_ad_units.rb +0 -93
- data/examples/v201203/label_service/deactivate_labels.rb +0 -117
- data/examples/v201203/label_service/get_all_labels.rb +0 -95
- data/examples/v201203/line_item_creative_association_service/create_licas.rb +0 -93
- data/examples/v201203/line_item_creative_association_service/deactivate_licas.rb +0 -126
- data/examples/v201203/line_item_creative_association_service/get_all_licas.rb +0 -94
- data/examples/v201203/line_item_creative_association_service/get_lica.rb +0 -76
- data/examples/v201203/line_item_creative_association_service/get_licas_by_statement.rb +0 -90
- data/examples/v201203/line_item_creative_association_service/update_licas.rb +0 -91
- data/examples/v201203/line_item_service/activate_line_items.rb +0 -130
- data/examples/v201203/line_item_service/create_line_items.rb +0 -176
- data/examples/v201203/line_item_service/create_mobile_line_item.rb +0 -134
- data/examples/v201203/line_item_service/create_video_line_item.rb +0 -155
- data/examples/v201203/line_item_service/get_all_line_items.rb +0 -93
- data/examples/v201203/line_item_service/get_line_item.rb +0 -73
- data/examples/v201203/line_item_service/get_line_items_by_statement.rb +0 -92
- data/examples/v201203/line_item_service/get_recently_updated_line_items.rb +0 -97
- data/examples/v201203/line_item_service/target_custom_criteria.rb +0 -128
- data/examples/v201203/line_item_service/update_line_items.rb +0 -108
- data/examples/v201203/network_service/get_all_networks.rb +0 -73
- data/examples/v201203/network_service/get_current_network.rb +0 -65
- data/examples/v201203/network_service/make_test_network.rb +0 -76
- data/examples/v201203/order_service/approve_orders.rb +0 -121
- data/examples/v201203/order_service/create_orders.rb +0 -91
- data/examples/v201203/order_service/get_all_orders.rb +0 -92
- data/examples/v201203/order_service/get_order.rb +0 -73
- data/examples/v201203/order_service/get_orders_by_statement.rb +0 -89
- data/examples/v201203/order_service/update_orders.rb +0 -94
- data/examples/v201203/placement_service/create_placements.rb +0 -128
- data/examples/v201203/placement_service/deactivate_placements.rb +0 -117
- data/examples/v201203/placement_service/get_all_placements.rb +0 -92
- data/examples/v201203/placement_service/get_placement.rb +0 -73
- data/examples/v201203/placement_service/get_placements_by_statement.rb +0 -85
- data/examples/v201203/placement_service/update_placements.rb +0 -96
- data/examples/v201203/report_service/download_report.rb +0 -80
- data/examples/v201203/report_service/run_delivery_report.rb +0 -102
- data/examples/v201203/report_service/run_inventory_report.rb +0 -91
- data/examples/v201203/report_service/run_merged_delivery_report.rb +0 -93
- data/examples/v201203/report_service/run_sales_report.rb +0 -88
- data/examples/v201203/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +0 -108
- data/examples/v201203/suggested_ad_unit_service/get_all_suggested_ad_units.rb +0 -95
- data/examples/v201203/suggested_ad_unit_service/get_suggested_ad_unit.rb +0 -74
- data/examples/v201203/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb +0 -91
- data/examples/v201203/team_service/create_teams.rb +0 -91
- data/examples/v201203/team_service/get_all_teams.rb +0 -91
- data/examples/v201203/team_service/get_team.rb +0 -73
- data/examples/v201203/team_service/get_teams_by_statement.rb +0 -86
- data/examples/v201203/team_service/update_teams.rb +0 -103
- data/examples/v201203/third_party_slot_service/archive_third_party_slots.rb +0 -124
- data/examples/v201203/third_party_slot_service/create_third_party_slot.rb +0 -90
- data/examples/v201203/third_party_slot_service/get_all_third_party_slots.rb +0 -92
- data/examples/v201203/third_party_slot_service/get_third_party_slot_by_statement.rb +0 -85
- data/examples/v201203/third_party_slot_service/update_third_party_slots.rb +0 -94
- data/examples/v201203/user_service/create_users.rb +0 -88
- data/examples/v201203/user_service/deactivate_users.rb +0 -98
- data/examples/v201203/user_service/get_all_roles.rb +0 -72
- data/examples/v201203/user_service/get_all_users.rb +0 -92
- data/examples/v201203/user_service/get_current_user.rb +0 -65
- data/examples/v201203/user_service/get_user.rb +0 -72
- data/examples/v201203/user_service/get_users_by_statement.rb +0 -78
- data/examples/v201203/user_service/update_users.rb +0 -88
- data/examples/v201204/common/oauth2_handling.rb +0 -128
- data/examples/v201204/company_service/update_companies.rb +0 -95
- data/examples/v201204/creative_service/copy_image_creatives.rb +0 -115
- data/examples/v201204/creative_service/create_creative_from_template.rb +0 -139
- data/examples/v201204/creative_service/create_custom_creative.rb +0 -104
- data/examples/v201204/creative_service/get_all_creatives.rb +0 -93
- data/examples/v201204/creative_service/get_creative.rb +0 -72
- data/examples/v201204/creative_service/update_creatives.rb +0 -96
- data/examples/v201204/creative_template_service/get_all_creative_templates.rb +0 -94
- data/examples/v201204/creative_template_service/get_creative_templates_by_statement.rb +0 -80
- data/examples/v201204/custom_field_service/set_line_item_custom_field_value.rb +0 -135
- data/examples/v201204/custom_targeting_service/delete_custom_targeting_keys.rb +0 -121
- data/examples/v201204/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +0 -148
- data/examples/v201204/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +0 -92
- data/examples/v201204/custom_targeting_service/get_custom_targeting_values_by_statement.rb +0 -98
- data/examples/v201204/custom_targeting_service/update_custom_targeting_keys.rb +0 -94
- data/examples/v201204/custom_targeting_service/update_custom_targeting_values.rb +0 -106
- data/examples/v201204/forecast_service/get_forecast.rb +0 -107
- data/examples/v201204/forecast_service/get_forecast_by_id.rb +0 -80
- data/examples/v201204/inventory_service/create_video_ad_unit.rb +0 -108
- data/examples/v201204/inventory_service/get_ad_unit.rb +0 -72
- data/examples/v201204/inventory_service/get_all_ad_units.rb +0 -93
- data/examples/v201204/inventory_service/update_ad_units.rb +0 -94
- data/examples/v201204/label_service/deactivate_labels.rb +0 -118
- data/examples/v201204/label_service/get_all_labels.rb +0 -95
- data/examples/v201204/label_service/get_label.rb +0 -76
- data/examples/v201204/label_service/get_labels_by_statement.rb +0 -81
- data/examples/v201204/label_service/update_labels.rb +0 -102
- data/examples/v201204/line_item_creative_association_service/create_licas.rb +0 -94
- data/examples/v201204/line_item_creative_association_service/deactivate_licas.rb +0 -127
- data/examples/v201204/line_item_creative_association_service/get_licas_by_statement.rb +0 -91
- data/examples/v201204/line_item_creative_association_service/update_licas.rb +0 -91
- data/examples/v201204/line_item_service/activate_line_items.rb +0 -131
- data/examples/v201204/line_item_service/create_video_line_item.rb +0 -156
- data/examples/v201204/line_item_service/get_all_line_items.rb +0 -94
- data/examples/v201204/line_item_service/get_line_item.rb +0 -74
- data/examples/v201204/line_item_service/get_recently_updated_line_items.rb +0 -98
- data/examples/v201204/line_item_service/update_line_items.rb +0 -109
- data/examples/v201204/network_service/get_current_network.rb +0 -66
- data/examples/v201204/order_service/approve_orders.rb +0 -122
- data/examples/v201204/order_service/create_orders.rb +0 -92
- data/examples/v201204/order_service/get_all_orders.rb +0 -93
- data/examples/v201204/order_service/get_orders_by_statement.rb +0 -90
- data/examples/v201204/placement_service/deactivate_placements.rb +0 -118
- data/examples/v201204/placement_service/get_all_placements.rb +0 -93
- data/examples/v201204/placement_service/update_placements.rb +0 -97
- data/examples/v201204/report_service/run_inventory_report.rb +0 -92
- data/examples/v201204/report_service/run_merged_delivery_report.rb +0 -94
- data/examples/v201204/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +0 -109
- data/examples/v201204/suggested_ad_unit_service/get_all_suggested_ad_units.rb +0 -96
- data/examples/v201204/suggested_ad_unit_service/get_suggested_ad_unit.rb +0 -75
- data/examples/v201204/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb +0 -92
- data/examples/v201204/team_service/get_team.rb +0 -74
- data/examples/v201204/team_service/update_teams.rb +0 -95
- data/examples/v201204/third_party_slot_service/archive_third_party_slots.rb +0 -125
- data/examples/v201204/third_party_slot_service/create_third_party_slot.rb +0 -91
- data/examples/v201204/third_party_slot_service/get_all_third_party_slots.rb +0 -93
- data/examples/v201204/third_party_slot_service/get_third_party_slot_by_statement.rb +0 -86
- data/examples/v201204/third_party_slot_service/update_third_party_slots.rb +0 -95
- data/examples/v201204/user_service/create_users.rb +0 -89
- data/examples/v201204/user_service/get_current_user.rb +0 -66
- data/examples/v201204/user_service/get_user.rb +0 -73
- data/examples/v201204/user_service/get_users_by_statement.rb +0 -79
- data/examples/v201204/user_team_association_service/create_user_team_associations.rb +0 -86
- data/examples/v201204/user_team_association_service/get_all_user_team_associations.rb +0 -94
- data/examples/v201204/user_team_association_service/get_user_team_association.rb +0 -76
- data/examples/v201206/common/error_handling.rb +0 -76
- data/examples/v201206/company_service/get_all_companies.rb +0 -92
- data/examples/v201206/company_service/get_companies_by_statement.rb +0 -88
- data/examples/v201206/company_service/get_company.rb +0 -72
- data/examples/v201206/content_service/get_content_by_category.rb +0 -136
- data/examples/v201206/creative_service/create_creatives.rb +0 -106
- data/examples/v201206/creative_service/get_creatives_by_statement.rb +0 -87
- data/examples/v201206/creative_template_service/get_creative_template.rb +0 -74
- data/examples/v201206/custom_field_service/create_custom_field_options.rb +0 -87
- data/examples/v201206/custom_field_service/create_custom_fields.rb +0 -86
- data/examples/v201206/custom_field_service/deactivate_all_line_item_custom_fields.rb +0 -112
- data/examples/v201206/custom_field_service/get_all_custom_fields.rb +0 -102
- data/examples/v201206/custom_field_service/get_all_line_item_custom_fields.rb +0 -86
- data/examples/v201206/custom_field_service/update_custom_fields.rb +0 -83
- data/examples/v201206/custom_targeting_service/create_custom_targeting_keys_and_values.rb +0 -140
- data/examples/v201206/custom_targeting_service/delete_custom_targeting_values.rb +0 -125
- data/examples/v201206/inventory_service/create_ad_units.rb +0 -101
- data/examples/v201206/inventory_service/create_mobile_ad_unit.rb +0 -100
- data/examples/v201206/inventory_service/deactivate_ad_units.rb +0 -119
- data/examples/v201206/inventory_service/get_ad_units_by_statement.rb +0 -96
- data/examples/v201206/label_service/create_labels.rb +0 -83
- data/examples/v201206/label_service/get_label.rb +0 -76
- data/examples/v201206/label_service/get_labels_by_statement.rb +0 -81
- data/examples/v201206/label_service/update_labels.rb +0 -102
- data/examples/v201206/line_item_creative_association_service/get_all_licas.rb +0 -95
- data/examples/v201206/line_item_service/create_line_items.rb +0 -177
- data/examples/v201206/line_item_service/create_mobile_line_item.rb +0 -135
- data/examples/v201206/line_item_service/get_line_items_by_statement.rb +0 -93
- data/examples/v201206/line_item_service/target_custom_criteria.rb +0 -129
- data/examples/v201206/network_service/get_all_networks.rb +0 -74
- data/examples/v201206/network_service/make_test_network.rb +0 -76
- data/examples/v201206/order_service/get_order.rb +0 -74
- data/examples/v201206/order_service/update_orders.rb +0 -95
- data/examples/v201206/placement_service/create_placements.rb +0 -131
- data/examples/v201206/placement_service/get_placement.rb +0 -74
- data/examples/v201206/placement_service/get_placements_by_statement.rb +0 -86
- data/examples/v201206/team_service/create_teams.rb +0 -83
- data/examples/v201206/team_service/get_all_teams.rb +0 -92
- data/examples/v201206/third_party_slot_service/archive_third_party_slots.rb +0 -125
- data/examples/v201206/third_party_slot_service/create_third_party_slot.rb +0 -91
- data/examples/v201206/third_party_slot_service/get_all_third_party_slots.rb +0 -93
- data/examples/v201206/third_party_slot_service/get_third_party_slot_by_statement.rb +0 -86
- data/examples/v201206/third_party_slot_service/update_third_party_slots.rb +0 -95
- data/examples/v201206/user_service/get_all_roles.rb +0 -73
- data/examples/v201206/user_team_association_service/delete_user_team_associations.rb +0 -111
- data/examples/v201206/user_team_association_service/get_user_team_associations_by_statement.rb +0 -94
- data/examples/v201206/user_team_association_service/update_user_team_associations.rb +0 -102
- data/lib/dfp_api/v201203/audience_segment_service.rb +0 -34
- data/lib/dfp_api/v201203/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/content_service.rb +0 -42
- data/lib/dfp_api/v201203/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/creative_service.rb +0 -54
- data/lib/dfp_api/v201203/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/creative_template_service.rb +0 -38
- data/lib/dfp_api/v201203/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/custom_targeting_service.rb +0 -62
- data/lib/dfp_api/v201203/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/forecast_service.rb +0 -38
- data/lib/dfp_api/v201203/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/inventory_service.rb +0 -66
- data/lib/dfp_api/v201203/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/label_service.rb +0 -58
- data/lib/dfp_api/v201203/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/line_item_creative_association_service.rb +0 -62
- data/lib/dfp_api/v201203/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/network_service.rb +0 -46
- data/lib/dfp_api/v201203/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/placement_service.rb +0 -58
- data/lib/dfp_api/v201203/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/publisher_query_language_service.rb +0 -34
- data/lib/dfp_api/v201203/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/report_service.rb +0 -42
- data/lib/dfp_api/v201203/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/team_service.rb +0 -54
- data/lib/dfp_api/v201203/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/third_party_slot_service.rb +0 -46
- data/lib/dfp_api/v201203/third_party_slot_service_registry.rb +0 -46
- data/lib/dfp_api/v201203/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/audience_segment_service.rb +0 -34
- data/lib/dfp_api/v201204/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/company_service.rb +0 -54
- data/lib/dfp_api/v201204/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/creative_template_service.rb +0 -38
- data/lib/dfp_api/v201204/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/custom_field_service.rb +0 -78
- data/lib/dfp_api/v201204/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/inventory_service.rb +0 -62
- data/lib/dfp_api/v201204/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/label_service.rb +0 -58
- data/lib/dfp_api/v201204/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/line_item_creative_association_service.rb +0 -62
- data/lib/dfp_api/v201204/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/line_item_service.rb +0 -58
- data/lib/dfp_api/v201204/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/order_service.rb +0 -58
- data/lib/dfp_api/v201204/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/placement_service.rb +0 -58
- data/lib/dfp_api/v201204/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/report_service.rb +0 -42
- data/lib/dfp_api/v201204/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/suggested_ad_unit_service.rb +0 -42
- data/lib/dfp_api/v201204/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/team_service.rb +0 -54
- data/lib/dfp_api/v201204/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/third_party_slot_service.rb +0 -46
- data/lib/dfp_api/v201204/third_party_slot_service_registry.rb +0 -46
- data/lib/dfp_api/v201204/user_service.rb +0 -66
- data/lib/dfp_api/v201204/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/audience_segment_service.rb +0 -34
- data/lib/dfp_api/v201206/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/company_service.rb +0 -54
- data/lib/dfp_api/v201206/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/content_service.rb +0 -42
- data/lib/dfp_api/v201206/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/creative_service.rb +0 -54
- data/lib/dfp_api/v201206/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/custom_targeting_service.rb +0 -62
- data/lib/dfp_api/v201206/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/forecast_service.rb +0 -38
- data/lib/dfp_api/v201206/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/line_item_service.rb +0 -58
- data/lib/dfp_api/v201206/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/network_service.rb +0 -46
- data/lib/dfp_api/v201206/order_service.rb +0 -58
- data/lib/dfp_api/v201206/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/publisher_query_language_service.rb +0 -34
- data/lib/dfp_api/v201206/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/suggested_ad_unit_service.rb +0 -42
- data/lib/dfp_api/v201206/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/third_party_slot_service.rb +0 -46
- data/lib/dfp_api/v201206/third_party_slot_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/user_service.rb +0 -66
- data/lib/dfp_api/v201206/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201206/user_team_association_service.rb +0 -58
- data/lib/dfp_api/v201206/user_team_association_service_registry.rb +0 -46
@@ -1,92 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
#
|
3
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
-
#
|
5
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
-
#
|
7
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
-
# implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
#
|
20
|
-
# This example gets all ad units. To create ad units, run create_ad_units.rb.
|
21
|
-
#
|
22
|
-
# Tags: InventoryService.getAdUnitsByStatement
|
23
|
-
|
24
|
-
require 'dfp_api'
|
25
|
-
|
26
|
-
API_VERSION = :v201203
|
27
|
-
PAGE_SIZE = 500
|
28
|
-
|
29
|
-
def get_all_ad_units()
|
30
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
31
|
-
dfp = DfpApi::Api.new
|
32
|
-
|
33
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
34
|
-
# the configuration file or provide your own logger:
|
35
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
36
|
-
|
37
|
-
# Get the InventoryService.
|
38
|
-
inventory_service = dfp.service(:InventoryService, API_VERSION)
|
39
|
-
|
40
|
-
# Define initial values.
|
41
|
-
offset = 0
|
42
|
-
page = {}
|
43
|
-
|
44
|
-
begin
|
45
|
-
# Create a statement to get one page with current offset.
|
46
|
-
statement = {:query => "LIMIT %d OFFSET %d" % [PAGE_SIZE, offset]}
|
47
|
-
|
48
|
-
# Get ad units by statement.
|
49
|
-
page = inventory_service.get_ad_units_by_statement(statement)
|
50
|
-
|
51
|
-
if page[:results]
|
52
|
-
# Increase query offset by page size.
|
53
|
-
offset += PAGE_SIZE
|
54
|
-
|
55
|
-
# Get the start index for printout.
|
56
|
-
start_index = page[:start_index]
|
57
|
-
|
58
|
-
# Print details about each ad unit in results.
|
59
|
-
page[:results].each_with_index do |ad_unit, index|
|
60
|
-
puts "%d) Ad unit ID: %d, name: %s, status: %s." %
|
61
|
-
[index + start_index, ad_unit[:id],
|
62
|
-
ad_unit[:name], ad_unit[:status]]
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end while offset < page[:total_result_set_size]
|
66
|
-
|
67
|
-
# Print a footer.
|
68
|
-
if page.include?(:total_result_set_size)
|
69
|
-
puts "Total number of ad units: %d" % page[:total_result_set_size]
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
if __FILE__ == $0
|
74
|
-
begin
|
75
|
-
get_all_ad_units()
|
76
|
-
|
77
|
-
# HTTP errors.
|
78
|
-
rescue AdsCommon::Errors::HttpError => e
|
79
|
-
puts "HTTP Error: %s" % e
|
80
|
-
|
81
|
-
# API errors.
|
82
|
-
rescue DfpApi::Errors::ApiException => e
|
83
|
-
puts "Message: %s" % e.message
|
84
|
-
puts 'Errors:'
|
85
|
-
e.errors.each_with_index do |error, index|
|
86
|
-
puts "\tError [%d]:" % (index + 1)
|
87
|
-
error.each do |field, value|
|
88
|
-
puts "\t\t%s: %s" % [field, value]
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
@@ -1,93 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
#
|
3
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
-
#
|
5
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
-
#
|
7
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
-
# implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
#
|
20
|
-
# This example updates an ad unit by enabling AdSense to the first 500. To
|
21
|
-
# determine which ad units exist, run get_all_ad_units.rb or
|
22
|
-
# get_inventory_tree.rb.
|
23
|
-
#
|
24
|
-
# Tags: InventoryService.getAdUnitsByStatement, InventoryService.updateAdUnits
|
25
|
-
|
26
|
-
require 'dfp_api'
|
27
|
-
|
28
|
-
API_VERSION = :v201203
|
29
|
-
|
30
|
-
def update_ad_units()
|
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 InventoryService.
|
39
|
-
inventory_service = dfp.service(:InventoryService, API_VERSION)
|
40
|
-
|
41
|
-
# Create a statement to get first 500 ad units.
|
42
|
-
statement = {:query => "LIMIT 500"}
|
43
|
-
|
44
|
-
# Get ad units by statement.
|
45
|
-
page = inventory_service.get_ad_units_by_statement(statement)
|
46
|
-
|
47
|
-
if page[:results]
|
48
|
-
ad_units = page[:results]
|
49
|
-
|
50
|
-
# Update each local ad unit object by enabling AdSense.
|
51
|
-
ad_units.each do |ad_unit|
|
52
|
-
ad_unit[:inherited_ad_sense_settings] =
|
53
|
-
{:value => {:ad_sense_enabled => true}}
|
54
|
-
end
|
55
|
-
|
56
|
-
# Update the ad units on the server.
|
57
|
-
return_ad_units = inventory_service.update_ad_units(ad_units)
|
58
|
-
|
59
|
-
if return_ad_units
|
60
|
-
return_ad_units.each do |ad_unit|
|
61
|
-
puts ("Ad unit with ID: %d, name: %s and status: %s was updated " +
|
62
|
-
"with AdSense enabled: %s") %
|
63
|
-
[ad_unit[:id], ad_unit[:name], ad_unit[:status],
|
64
|
-
ad_unit[:inherited_ad_sense_settings][:value][:ad_sense_enabled]]
|
65
|
-
end
|
66
|
-
else
|
67
|
-
raise 'No ad units were updated.'
|
68
|
-
end
|
69
|
-
else
|
70
|
-
puts 'No ad units found to update.'
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
if __FILE__ == $0
|
75
|
-
begin
|
76
|
-
update_ad_units()
|
77
|
-
|
78
|
-
# HTTP errors.
|
79
|
-
rescue AdsCommon::Errors::HttpError => e
|
80
|
-
puts "HTTP Error: %s" % e
|
81
|
-
|
82
|
-
# API errors.
|
83
|
-
rescue DfpApi::Errors::ApiException => e
|
84
|
-
puts "Message: %s" % e.message
|
85
|
-
puts 'Errors:'
|
86
|
-
e.errors.each_with_index do |error, index|
|
87
|
-
puts "\tError [%d]:" % (index + 1)
|
88
|
-
error.each do |field, value|
|
89
|
-
puts "\t\t%s: %s" % [field, value]
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
@@ -1,117 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
#
|
3
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
-
#
|
5
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
-
#
|
7
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
-
# implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
#
|
20
|
-
# This example deactivates all active labels. To determine which labels exist,
|
21
|
-
# run get_all_labels.rb.
|
22
|
-
#
|
23
|
-
# This feature is only available to DFP premium solution networks.
|
24
|
-
#
|
25
|
-
# Tags: LabelService.getLabelsByStatement, LabelService.performLabelAction
|
26
|
-
|
27
|
-
require 'dfp_api'
|
28
|
-
|
29
|
-
API_VERSION = :v201203
|
30
|
-
PAGE_SIZE = 500
|
31
|
-
|
32
|
-
def deactivate_labels()
|
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 LabelService.
|
41
|
-
label_service = dfp.service(:LabelService, API_VERSION)
|
42
|
-
|
43
|
-
# Create statement text and statement to select active labels.
|
44
|
-
statement_text = 'WHERE isActive = :is_active'
|
45
|
-
statement = {
|
46
|
-
:values => [
|
47
|
-
{:key => 'is_active',
|
48
|
-
:value => {:value => true, :xsi_type => 'BooleanValue'}}
|
49
|
-
]
|
50
|
-
}
|
51
|
-
|
52
|
-
# Define initial values.
|
53
|
-
offset = 0
|
54
|
-
page = {}
|
55
|
-
label_ids = []
|
56
|
-
|
57
|
-
begin
|
58
|
-
# Modify the statement to get one page with current offset.
|
59
|
-
statement[:query] = statement_text +
|
60
|
-
" LIMIT %d OFFSET %d" % [PAGE_SIZE, offset]
|
61
|
-
|
62
|
-
# Get labels by statement.
|
63
|
-
page = label_service.get_labels_by_statement(statement)
|
64
|
-
|
65
|
-
if page[:results]
|
66
|
-
# Increase query offset by page size.
|
67
|
-
offset += PAGE_SIZE
|
68
|
-
|
69
|
-
page[:results].each do |label|
|
70
|
-
puts ("%d) Label ID: %d, name: %s will be deactivated.") %
|
71
|
-
[label_ids.size, label[:id], label[:name]]
|
72
|
-
label_ids << label[:id]
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end while offset < page[:total_result_set_size]
|
76
|
-
|
77
|
-
puts "Number of labels to be deactivated: %d" % label_ids.size
|
78
|
-
|
79
|
-
if !label_ids.empty?
|
80
|
-
# Create a statement for action.
|
81
|
-
statement = {:query => "WHERE id IN (%s)" % label_ids.join(', ')}
|
82
|
-
|
83
|
-
# Perform action.
|
84
|
-
result = label_service.perform_label_action(
|
85
|
-
{:xsi_type => 'DeactivateLabels'}, statement)
|
86
|
-
|
87
|
-
# Display results.
|
88
|
-
if result and result[:num_changes] > 0
|
89
|
-
puts "Number of labels deactivated: %d" % result[:num_changes]
|
90
|
-
else
|
91
|
-
puts 'No labels were deactivated.'
|
92
|
-
end
|
93
|
-
else
|
94
|
-
puts 'No labels found to deactivate.'
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
if __FILE__ == $0
|
99
|
-
begin
|
100
|
-
deactivate_labels()
|
101
|
-
|
102
|
-
# HTTP errors.
|
103
|
-
rescue AdsCommon::Errors::HttpError => e
|
104
|
-
puts "HTTP Error: %s" % e
|
105
|
-
|
106
|
-
# API errors.
|
107
|
-
rescue DfpApi::Errors::ApiException => e
|
108
|
-
puts "Message: %s" % e.message
|
109
|
-
puts 'Errors:'
|
110
|
-
e.errors.each_with_index do |error, index|
|
111
|
-
puts "\tError [%d]:" % (index + 1)
|
112
|
-
error.each do |field, value|
|
113
|
-
puts "\t\t%s: %s" % [field, value]
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
@@ -1,95 +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 all labels. To create labels, run create_labels.rb
|
22
|
-
#
|
23
|
-
# This feature is only available to DFP premium solution networks.
|
24
|
-
#
|
25
|
-
# Tags: LabelService.getLabelsByStatement
|
26
|
-
|
27
|
-
require 'dfp_api'
|
28
|
-
|
29
|
-
API_VERSION = :v201203
|
30
|
-
PAGE_SIZE = 500
|
31
|
-
|
32
|
-
def get_all_labels()
|
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 LabelService.
|
41
|
-
label_service = dfp.service(:LabelService, API_VERSION)
|
42
|
-
|
43
|
-
# Define initial values.
|
44
|
-
offset = 0
|
45
|
-
page = {}
|
46
|
-
|
47
|
-
begin
|
48
|
-
# Create statement for one page with current offset.
|
49
|
-
statement = {:query => "LIMIT %d OFFSET %d" % [PAGE_SIZE, offset]}
|
50
|
-
|
51
|
-
# Get labels by statement.
|
52
|
-
page = label_service.get_labels_by_statement(statement)
|
53
|
-
|
54
|
-
if page[:results]
|
55
|
-
# Increase query offset by page size.
|
56
|
-
offset += PAGE_SIZE
|
57
|
-
|
58
|
-
# Get the start index for printout.
|
59
|
-
start_index = page[:start_index]
|
60
|
-
|
61
|
-
# Print details about each label in results page.
|
62
|
-
page[:results].each_with_index do |label, index|
|
63
|
-
puts "%d) Label ID: %d, name: '%s', types: '%s'." %
|
64
|
-
[index + start_index, label[:id], label[:name],
|
65
|
-
label[:types].join(', ')]
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end while offset < page[:total_result_set_size]
|
69
|
-
|
70
|
-
# Print a footer
|
71
|
-
if page.include?(:total_result_set_size)
|
72
|
-
puts "Total number of labels: %d" % page[:total_result_set_size]
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
if __FILE__ == $0
|
77
|
-
begin
|
78
|
-
get_all_labels()
|
79
|
-
|
80
|
-
# HTTP errors.
|
81
|
-
rescue AdsCommon::Errors::HttpError => e
|
82
|
-
puts "HTTP Error: %s" % e
|
83
|
-
|
84
|
-
# API errors.
|
85
|
-
rescue DfpApi::Errors::ApiException => e
|
86
|
-
puts "Message: %s" % e.message
|
87
|
-
puts 'Errors:'
|
88
|
-
e.errors.each_with_index do |error, index|
|
89
|
-
puts "\tError [%d]:" % (index + 1)
|
90
|
-
error.each do |field, value|
|
91
|
-
puts "\t\t%s: %s" % [field, value]
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
@@ -1,93 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
#
|
3
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
-
#
|
5
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
-
#
|
7
|
-
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
-
# implied.
|
17
|
-
# See the License for the specific language governing permissions and
|
18
|
-
# limitations under the License.
|
19
|
-
#
|
20
|
-
# This example creates new line item creative associations (LICAs) for an
|
21
|
-
# existing line item and a set of creative ids. For small business networks,
|
22
|
-
# the creative ids must represent new or copied creatives as creatives cannot
|
23
|
-
# be used for more than one line item. For premium solution networks, the
|
24
|
-
# creative ids can represent any creatvie. To copy creatives, run
|
25
|
-
# copy_image_creatives.rb. To determine which LICAs exist, run get_all_licas.rb.
|
26
|
-
#
|
27
|
-
# Tags: LineItemCreativeAssociationService.createLineItemCreativeAssociations
|
28
|
-
|
29
|
-
require 'dfp_api'
|
30
|
-
|
31
|
-
API_VERSION = :v201203
|
32
|
-
|
33
|
-
def create_licas()
|
34
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
35
|
-
dfp = DfpApi::Api.new
|
36
|
-
|
37
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
38
|
-
# the configuration file or provide your own logger:
|
39
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
40
|
-
|
41
|
-
# Get the LineItemCreativeAssociationService.
|
42
|
-
lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION)
|
43
|
-
|
44
|
-
# Get the CreativeService.
|
45
|
-
creative_service = dfp.service(:CreativeService, API_VERSION)
|
46
|
-
|
47
|
-
# Set the line item ID and creative IDs to associate.
|
48
|
-
line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i
|
49
|
-
creative_ids = [
|
50
|
-
'INSERT_CREATIVE_ID_HERE'.to_i,
|
51
|
-
'INSERT_CREATIVE_ID_HERE'.to_i
|
52
|
-
]
|
53
|
-
|
54
|
-
# Create an array to store local LICA objects.
|
55
|
-
licas = creative_ids.map do |creative_id|
|
56
|
-
# For each line item, associate it with the given creative.
|
57
|
-
{:line_item_id => line_item_id, :creative_id => creative_id}
|
58
|
-
end
|
59
|
-
|
60
|
-
# Create the LICAs on the server.
|
61
|
-
return_licas = lica_service.create_line_item_creative_associations(licas)
|
62
|
-
|
63
|
-
if return_licas
|
64
|
-
return_licas.each do |lica|
|
65
|
-
puts ("LICA with line item ID: %d, creative ID: %d and status: %s was " +
|
66
|
-
"created.") % [lica[:line_item_id], lica[:creative_id], lica[:status]]
|
67
|
-
end
|
68
|
-
else
|
69
|
-
raise 'No LICAs were created.'
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
if __FILE__ == $0
|
75
|
-
begin
|
76
|
-
create_licas()
|
77
|
-
|
78
|
-
# HTTP errors.
|
79
|
-
rescue AdsCommon::Errors::HttpError => e
|
80
|
-
puts "HTTP Error: %s" % e
|
81
|
-
|
82
|
-
# API errors.
|
83
|
-
rescue DfpApi::Errors::ApiException => e
|
84
|
-
puts "Message: %s" % e.message
|
85
|
-
puts 'Errors:'
|
86
|
-
e.errors.each_with_index do |error, index|
|
87
|
-
puts "\tError [%d]:" % (index + 1)
|
88
|
-
error.each do |field, value|
|
89
|
-
puts "\t\t%s: %s" % [field, value]
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|