google-dfp-api 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/ChangeLog +6 -0
- data/examples/{v201311 → v201411}/activity_group_service/create_activity_groups.rb +1 -1
- data/examples/{v201311 → v201411}/activity_group_service/get_active_activity_groups.rb +18 -27
- data/examples/{v201311 → v201411}/activity_group_service/get_all_activity_groups.rb +13 -23
- data/examples/{v201311 → v201411}/activity_group_service/update_activity_groups.rb +25 -14
- data/examples/{v201311 → v201411}/activity_service/create_activities.rb +1 -1
- data/examples/{v201311 → v201411}/activity_service/get_active_activities.rb +15 -27
- data/examples/{v201311 → v201411}/activity_service/get_all_activities.rb +10 -21
- data/examples/{v201311 → v201411}/activity_service/update_activities.rb +32 -16
- data/examples/{v201311 → v201411}/audience_segment_service/create_audience_segments.rb +1 -1
- data/examples/{v201311 → v201411}/audience_segment_service/get_all_audience_segments.rb +10 -19
- data/examples/{v201311 → v201411}/audience_segment_service/get_first_party_audience_segments.rb +14 -21
- data/examples/{v201311 → v201411}/audience_segment_service/populate_first_party_audience_segments.rb +16 -13
- data/examples/{v201311 → v201411}/audience_segment_service/update_audience_segments.rb +12 -11
- data/examples/{v201311 → v201411}/common/error_handling.rb +1 -1
- data/examples/{v201311 → v201411}/common/oauth2_jwt_handling.rb +9 -17
- data/examples/{v201311 → v201411}/common/setup_oauth2.rb +1 -1
- data/examples/{v201311 → v201411}/company_service/create_companies.rb +1 -1
- data/examples/{v201311 → v201411}/company_service/get_all_companies.rb +10 -18
- data/examples/{v201311 → v201411}/company_service/get_companies_by_statement.rb +21 -16
- data/examples/{v201311 → v201411}/company_service/update_companies.rb +17 -11
- data/examples/{v201311 → v201411}/contact_service/create_contacts.rb +1 -1
- data/examples/{v201311 → v201411}/contact_service/get_all_contacts.rb +11 -19
- data/examples/{v201311 → v201411}/contact_service/get_uninvited_contacts.rb +18 -22
- data/examples/{v201311 → v201411}/contact_service/update_contacts.rb +33 -17
- data/examples/v201411/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb +96 -0
- data/examples/v201411/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb +106 -0
- data/examples/v201411/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb +89 -0
- data/examples/v201411/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb +115 -0
- data/examples/{v201311 → v201411}/content_service/get_all_content.rb +9 -18
- data/examples/{v201311 → v201411}/content_service/get_content_by_category.rb +18 -28
- data/examples/{v201311 → v201411}/creative_service/copy_image_creatives.rb +7 -7
- data/examples/{v201311 → v201411}/creative_service/create_creative_from_template.rb +1 -1
- data/examples/{v201311 → v201411}/creative_service/create_creatives.rb +1 -1
- data/examples/{v201311 → v201411}/creative_service/create_custom_creative.rb +1 -1
- data/examples/{v201311 → v201411}/creative_service/get_all_creatives.rb +8 -17
- data/examples/{v201311 → v201411}/creative_service/get_creatives_by_statement.rb +18 -13
- data/examples/{v201311 → v201411}/creative_service/update_creatives.rb +16 -11
- data/examples/{v201311 → v201411}/creative_set_service/associate_creative_set_to_line_item.rb +1 -1
- data/examples/{v201311 → v201411}/creative_set_service/create_creative_set.rb +1 -1
- data/examples/{v201311 → v201411}/creative_set_service/get_all_creative_sets.rb +9 -17
- data/examples/{v201311 → v201411}/creative_set_service/get_creative_sets_by_statement.rb +20 -14
- data/examples/{v201311 → v201411}/creative_set_service/update_creative_sets.rb +33 -15
- data/examples/{v201311 → v201411}/creative_template_service/get_all_creative_templates.rb +9 -17
- data/examples/{v201311/creative_template_service/get_creative_templates_by_statement.rb → v201411/creative_template_service/get_system_defined_creative_templates.rb} +24 -13
- data/examples/{v201311 → v201411}/creative_wrapper_service/create_creative_wrappers.rb +1 -1
- data/examples/{v201311 → v201411}/creative_wrapper_service/deactivate_creative_wrapper.rb +9 -7
- data/examples/{v201311 → v201411}/creative_wrapper_service/get_all_creative_wrappers.rb +10 -18
- data/examples/{v201311 → v201411}/creative_wrapper_service/get_creative_wrappers_by_statement.rb +17 -12
- data/examples/{v201311 → v201411}/creative_wrapper_service/update_creative_wrappers.rb +34 -16
- data/examples/{v201311 → v201411}/custom_field_service/create_custom_field_options.rb +1 -1
- data/examples/{v201311 → v201411}/custom_field_service/create_custom_fields.rb +1 -1
- data/examples/{v201311 → v201411}/custom_field_service/deactivate_all_line_item_custom_fields.rb +13 -23
- data/examples/{v201311 → v201411}/custom_field_service/get_all_custom_fields.rb +11 -19
- data/examples/{v201311 → v201411}/custom_field_service/get_all_line_item_custom_fields.rb +19 -14
- data/examples/{v201311 → v201411}/custom_field_service/set_line_item_custom_field_value.rb +59 -11
- data/examples/{v201311 → v201411}/custom_field_service/update_custom_fields.rb +33 -15
- data/examples/{v201311 → v201411}/custom_targeting_service/create_custom_targeting_keys_and_values.rb +1 -1
- data/examples/{v201311 → v201411}/custom_targeting_service/delete_custom_targeting_keys.rb +16 -20
- data/examples/{v201311 → v201411}/custom_targeting_service/delete_custom_targeting_values.rb +23 -21
- data/examples/{v201311 → v201411}/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +15 -36
- data/examples/{v201311 → v201411}/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +20 -16
- data/examples/{v201311 → v201411}/custom_targeting_service/get_custom_targeting_values_by_statement.rb +19 -15
- data/examples/{v201311 → v201411}/custom_targeting_service/update_custom_targeting_keys.rb +4 -3
- data/examples/{v201311 → v201411}/custom_targeting_service/update_custom_targeting_values.rb +34 -30
- data/examples/{v201311 → v201411}/forecast_service/get_forecast.rb +6 -3
- data/examples/{v201311 → v201411}/forecast_service/get_forecast_by_id.rb +1 -1
- data/examples/{v201311 → v201411}/inventory_service/create_ad_units.rb +1 -1
- data/examples/{v201311 → v201411}/inventory_service/create_mobile_ad_unit.rb +1 -1
- data/examples/{v201311 → v201411}/inventory_service/create_video_ad_unit.rb +1 -1
- data/examples/{v201311 → v201411}/inventory_service/deactivate_ad_units.rb +19 -23
- data/examples/{v201311 → v201411}/inventory_service/get_ad_unit_sizes.rb +7 -14
- data/examples/{v201311 → v201411}/inventory_service/get_ad_units_by_statement.rb +18 -13
- data/examples/{v201311 → v201411}/inventory_service/get_all_ad_units.rb +8 -17
- data/examples/{v201311 → v201411}/inventory_service/update_ad_units.rb +23 -11
- data/examples/{v201311 → v201411}/label_service/create_labels.rb +1 -1
- data/examples/{v201311 → v201411}/label_service/deactivate_labels.rb +15 -22
- data/examples/{v201311 → v201411}/label_service/get_all_labels.rb +9 -18
- data/examples/{v201311 → v201411}/label_service/get_labels_by_statement.rb +16 -11
- data/examples/{v201311 → v201411}/label_service/update_labels.rb +24 -26
- data/examples/{v201311 → v201411}/line_item_creative_association_service/create_licas.rb +1 -1
- data/examples/{v201311 → v201411}/line_item_creative_association_service/deactivate_licas.rb +15 -24
- data/examples/{v201311 → v201411}/line_item_creative_association_service/get_all_licas.rb +8 -17
- data/examples/{v201311 → v201411}/line_item_creative_association_service/get_licas_by_statement.rb +10 -8
- data/examples/{v201311 → v201411}/line_item_creative_association_service/update_licas.rb +16 -7
- data/examples/{v201311 → v201411}/line_item_service/activate_line_items.rb +13 -21
- data/examples/{v201311 → v201411}/line_item_service/create_line_items.rb +6 -3
- data/examples/{v201311 → v201411}/line_item_service/create_video_line_item.rb +8 -2
- data/examples/{v201311 → v201411}/line_item_service/get_all_line_items.rb +9 -17
- data/examples/{v201311 → v201411}/line_item_service/get_line_items_by_statement.rb +19 -17
- data/examples/{v201311 → v201411}/line_item_service/get_recently_updated_line_items.rb +19 -13
- data/examples/{v201311 → v201411}/line_item_service/target_custom_criteria.rb +31 -15
- data/examples/{v201311 → v201411}/line_item_service/update_line_items.rb +9 -9
- data/examples/{v201311 → v201411}/network_service/get_all_networks.rb +1 -1
- data/examples/{v201311 → v201411}/network_service/get_current_network.rb +1 -1
- data/examples/{v201311 → v201411}/network_service/make_test_network.rb +1 -1
- data/examples/{v201311 → v201411}/order_service/approve_orders.rb +16 -24
- data/examples/{v201311 → v201411}/order_service/create_orders.rb +1 -1
- data/examples/{v201311 → v201411}/order_service/get_all_orders.rb +8 -17
- data/examples/{v201311 → v201411}/order_service/get_orders_by_statement.rb +18 -14
- data/examples/{v201311 → v201411}/order_service/update_orders.rb +15 -7
- data/examples/{v201311 → v201411}/placement_service/create_placements.rb +4 -2
- data/examples/{v201311 → v201411}/placement_service/deactivate_placements.rb +14 -22
- data/examples/{v201311 → v201411}/placement_service/get_all_placements.rb +9 -17
- data/examples/{v201311 → v201411}/placement_service/get_placements_by_statement.rb +18 -13
- data/examples/{v201311 → v201411}/placement_service/update_placements.rb +16 -6
- data/examples/{v201311 → v201411}/publisher_query_language_service/fetch_match_tables.rb +9 -11
- data/examples/{v201311 → v201411}/publisher_query_language_service/get_all_line_items.rb +8 -9
- data/examples/{v201311 → v201411}/publisher_query_language_service/get_geo_targets.rb +10 -10
- data/examples/{v201311 → v201411}/publisher_query_language_service/get_line_items_named_like.rb +10 -10
- data/examples/{v201311 → v201411}/report_service/display_report.rb +1 -1
- data/examples/{v201311 → v201411}/report_service/download_report.rb +1 -1
- data/examples/{v201311 → v201411}/report_service/run_delivery_report.rb +1 -1
- data/examples/{v201311 → v201411}/report_service/run_inventory_report.rb +4 -4
- data/examples/{v201311 → v201411}/report_service/run_reach_report.rb +1 -1
- data/examples/{v201311/report_service/run_merged_delivery_report.rb → v201411/report_service/run_report_with_custom_fields.rb} +12 -14
- data/examples/{v201311 → v201411}/report_service/run_sales_report.rb +1 -1
- data/examples/{v201311 → v201411}/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +25 -21
- data/examples/{v201311 → v201411}/suggested_ad_unit_service/get_all_suggested_ad_units.rb +9 -18
- data/examples/{v201311 → v201411}/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb +24 -21
- data/examples/{v201311 → v201411}/team_service/create_teams.rb +1 -1
- data/examples/{v201311 → v201411}/team_service/get_all_teams.rb +8 -17
- data/examples/{v201311 → v201411}/team_service/get_teams_by_statement.rb +15 -11
- data/examples/{v201311 → v201411}/team_service/update_teams.rb +4 -3
- data/examples/{v201311 → v201411}/user_service/create_users.rb +1 -1
- data/examples/{v201311 → v201411}/user_service/deactivate_users.rb +7 -7
- data/examples/{v201311 → v201411}/user_service/get_all_roles.rb +1 -1
- data/examples/{v201311 → v201411}/user_service/get_all_users.rb +8 -18
- data/examples/{v201311 → v201411}/user_service/get_current_user.rb +1 -1
- data/examples/{v201311 → v201411}/user_service/get_users_by_statement.rb +17 -12
- data/examples/{v201311 → v201411}/user_service/update_users.rb +15 -6
- data/examples/{v201311 → v201411}/user_team_association_service/create_user_team_associations.rb +1 -1
- data/examples/{v201311 → v201411}/user_team_association_service/delete_user_team_associations.rb +13 -21
- data/examples/{v201311 → v201411}/user_team_association_service/get_all_user_team_associations.rb +10 -17
- data/examples/{v201311 → v201411}/user_team_association_service/get_user_team_associations_by_statement.rb +20 -16
- data/examples/{v201311 → v201411}/user_team_association_service/update_user_team_associations.rb +8 -7
- data/lib/dfp_api/api_config.rb +26 -3
- data/lib/dfp_api/{v201302 → v201411}/activity_group_service.rb +6 -18
- data/lib/dfp_api/v201411/activity_group_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/activity_service.rb +6 -18
- data/lib/dfp_api/v201411/activity_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/ad_exclusion_rule_service.rb +46 -0
- data/lib/dfp_api/v201411/ad_exclusion_rule_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/ad_rule_service.rb +6 -18
- data/lib/dfp_api/v201411/ad_rule_service_registry.rb +46 -0
- data/lib/dfp_api/{v201208 → v201411}/audience_segment_service.rb +18 -6
- data/lib/dfp_api/v201411/audience_segment_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/base_rate_service.rb +46 -0
- data/lib/dfp_api/v201411/base_rate_service_registry.rb +46 -0
- data/lib/dfp_api/{v201208 → v201411}/company_service.rb +6 -18
- data/lib/dfp_api/v201411/company_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/contact_service.rb +6 -18
- data/lib/dfp_api/v201411/contact_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/content_bundle_service.rb +6 -18
- data/lib/dfp_api/v201411/content_bundle_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/content_metadata_key_hierarchy_service.rb +46 -0
- data/lib/dfp_api/v201411/content_metadata_key_hierarchy_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/content_service.rb +6 -6
- data/lib/dfp_api/v201411/content_service_registry.rb +46 -0
- data/lib/dfp_api/{v201208 → v201411}/creative_service.rb +6 -18
- data/lib/dfp_api/v201411/creative_service_registry.rb +46 -0
- data/lib/dfp_api/{v201208 → v201411}/creative_set_service.rb +6 -10
- data/lib/dfp_api/v201411/creative_set_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/creative_template_service.rb +6 -10
- data/lib/dfp_api/v201411/creative_template_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/creative_wrapper_service.rb +6 -18
- data/lib/dfp_api/v201411/creative_wrapper_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/custom_field_service.rb +6 -26
- data/lib/dfp_api/v201411/custom_field_service_registry.rb +46 -0
- data/lib/dfp_api/{v201208 → v201411}/custom_targeting_service.rb +6 -6
- data/lib/dfp_api/v201411/custom_targeting_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/exchange_rate_service.rb +46 -0
- data/lib/dfp_api/v201411/exchange_rate_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/forecast_service.rb +6 -6
- data/lib/dfp_api/v201411/forecast_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/inventory_service.rb +6 -18
- data/lib/dfp_api/v201411/inventory_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/label_service.rb +6 -18
- data/lib/dfp_api/v201411/label_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/line_item_creative_association_service.rb +6 -18
- data/lib/dfp_api/v201411/line_item_creative_association_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/line_item_service.rb +6 -18
- data/lib/dfp_api/v201411/line_item_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/line_item_template_service.rb +34 -0
- data/lib/dfp_api/v201411/line_item_template_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/live_stream_event_service.rb +46 -0
- data/lib/dfp_api/v201411/live_stream_event_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/network_service.rb +6 -6
- data/lib/dfp_api/v201411/network_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/order_service.rb +6 -18
- data/lib/dfp_api/v201411/order_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/placement_service.rb +6 -18
- data/lib/dfp_api/v201411/placement_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/premium_rate_service.rb +42 -0
- data/lib/dfp_api/v201411/premium_rate_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/product_service.rb +42 -0
- data/lib/dfp_api/v201411/product_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/product_template_service.rb +46 -0
- data/lib/dfp_api/v201411/product_template_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/proposal_line_item_service.rb +46 -0
- data/lib/dfp_api/v201411/proposal_line_item_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/proposal_service.rb +46 -0
- data/lib/dfp_api/v201411/proposal_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/publisher_query_language_service.rb +6 -6
- data/lib/dfp_api/v201411/publisher_query_language_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/rate_card_service.rb +46 -0
- data/lib/dfp_api/v201411/rate_card_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/reconciliation_order_report_service.rb +38 -0
- data/lib/dfp_api/v201411/reconciliation_order_report_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/reconciliation_report_row_service.rb +38 -0
- data/lib/dfp_api/v201411/reconciliation_report_row_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/reconciliation_report_service.rb +38 -0
- data/lib/dfp_api/v201411/reconciliation_report_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/report_service.rb +6 -6
- data/lib/dfp_api/v201411/report_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/shared_ad_unit_service.rb +38 -0
- data/lib/dfp_api/v201411/shared_ad_unit_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/suggested_ad_unit_service.rb +6 -10
- data/lib/dfp_api/v201411/suggested_ad_unit_service_registry.rb +46 -0
- data/lib/dfp_api/{v201302 → v201411}/team_service.rb +6 -18
- data/lib/dfp_api/v201411/team_service_registry.rb +46 -0
- data/lib/dfp_api/{v201208 → v201411}/user_service.rb +6 -18
- data/lib/dfp_api/v201411/user_service_registry.rb +46 -0
- data/lib/dfp_api/{v201211 → v201411}/user_team_association_service.rb +6 -18
- data/lib/dfp_api/v201411/user_team_association_service_registry.rb +46 -0
- data/lib/dfp_api/v201411/workflow_request_service.rb +38 -0
- data/lib/dfp_api/v201411/workflow_request_service_registry.rb +46 -0
- data/lib/dfp_api/version.rb +1 -1
- data/lib/dfp_api_statement.rb +5 -1
- metadata +1118 -1190
- data/examples/v201311/company_service/get_company.rb +0 -72
- data/examples/v201311/creative_service/get_creative.rb +0 -72
- data/examples/v201311/creative_template_service/get_creative_template.rb +0 -74
- data/examples/v201311/inventory_service/get_ad_unit.rb +0 -72
- data/examples/v201311/label_service/get_label.rb +0 -76
- data/examples/v201311/line_item_creative_association_service/get_lica.rb +0 -77
- data/examples/v201311/line_item_service/create_mobile_line_item.rb +0 -135
- data/examples/v201311/line_item_service/get_line_item.rb +0 -74
- data/examples/v201311/order_service/get_order.rb +0 -74
- data/examples/v201311/placement_service/get_placement.rb +0 -74
- data/examples/v201311/report_service/run_report_with_custom_fields.rb +0 -135
- data/examples/v201311/suggested_ad_unit_service/get_suggested_ad_unit.rb +0 -75
- data/examples/v201311/team_service/get_team.rb +0 -74
- data/examples/v201311/user_service/get_user.rb +0 -73
- data/examples/v201311/user_team_association_service/get_user_team_association.rb +0 -76
- data/lib/dfp_api/v201208/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/content_service.rb +0 -42
- data/lib/dfp_api/v201208/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/creative_template_service.rb +0 -38
- data/lib/dfp_api/v201208/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/custom_field_service.rb +0 -78
- data/lib/dfp_api/v201208/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/forecast_service.rb +0 -38
- data/lib/dfp_api/v201208/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/inventory_service.rb +0 -62
- data/lib/dfp_api/v201208/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/label_service.rb +0 -58
- data/lib/dfp_api/v201208/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/line_item_creative_association_service.rb +0 -62
- data/lib/dfp_api/v201208/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/line_item_service.rb +0 -58
- data/lib/dfp_api/v201208/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/network_service.rb +0 -46
- data/lib/dfp_api/v201208/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/order_service.rb +0 -58
- data/lib/dfp_api/v201208/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/placement_service.rb +0 -58
- data/lib/dfp_api/v201208/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/publisher_query_language_service.rb +0 -34
- data/lib/dfp_api/v201208/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/report_service.rb +0 -46
- data/lib/dfp_api/v201208/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/suggested_ad_unit_service.rb +0 -42
- data/lib/dfp_api/v201208/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/team_service.rb +0 -54
- data/lib/dfp_api/v201208/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/third_party_slot_service.rb +0 -46
- data/lib/dfp_api/v201208/third_party_slot_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201208/user_team_association_service.rb +0 -58
- data/lib/dfp_api/v201208/user_team_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/audience_segment_service.rb +0 -34
- data/lib/dfp_api/v201211/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/company_service.rb +0 -54
- data/lib/dfp_api/v201211/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/content_service.rb +0 -42
- data/lib/dfp_api/v201211/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/creative_service.rb +0 -54
- data/lib/dfp_api/v201211/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/creative_set_service.rb +0 -46
- data/lib/dfp_api/v201211/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/creative_wrapper_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/custom_field_service.rb +0 -78
- data/lib/dfp_api/v201211/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/custom_targeting_service.rb +0 -62
- data/lib/dfp_api/v201211/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/order_service.rb +0 -58
- data/lib/dfp_api/v201211/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/report_service.rb +0 -46
- data/lib/dfp_api/v201211/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/team_service.rb +0 -54
- data/lib/dfp_api/v201211/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/third_party_slot_service.rb +0 -46
- data/lib/dfp_api/v201211/third_party_slot_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/user_service.rb +0 -66
- data/lib/dfp_api/v201211/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201211/user_team_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/activity_group_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/activity_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/ad_rule_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/audience_segment_service.rb +0 -34
- data/lib/dfp_api/v201302/audience_segment_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/company_service.rb +0 -54
- data/lib/dfp_api/v201302/company_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/contact_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/content_bundle_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/content_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/creative_service.rb +0 -54
- data/lib/dfp_api/v201302/creative_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/creative_set_service.rb +0 -46
- data/lib/dfp_api/v201302/creative_set_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/creative_template_service.rb +0 -38
- data/lib/dfp_api/v201302/creative_template_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/creative_wrapper_service.rb +0 -58
- data/lib/dfp_api/v201302/creative_wrapper_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/custom_field_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/custom_targeting_service.rb +0 -62
- data/lib/dfp_api/v201302/custom_targeting_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/forecast_service.rb +0 -38
- data/lib/dfp_api/v201302/forecast_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/inventory_service.rb +0 -62
- data/lib/dfp_api/v201302/inventory_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/label_service.rb +0 -58
- data/lib/dfp_api/v201302/label_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/line_item_creative_association_service.rb +0 -62
- data/lib/dfp_api/v201302/line_item_creative_association_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/line_item_service.rb +0 -58
- data/lib/dfp_api/v201302/line_item_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/network_service.rb +0 -46
- data/lib/dfp_api/v201302/network_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/order_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/placement_service.rb +0 -58
- data/lib/dfp_api/v201302/placement_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/publisher_query_language_service.rb +0 -34
- data/lib/dfp_api/v201302/publisher_query_language_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/report_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/suggested_ad_unit_service.rb +0 -42
- data/lib/dfp_api/v201302/suggested_ad_unit_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/team_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/third_party_slot_service.rb +0 -46
- data/lib/dfp_api/v201302/third_party_slot_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/user_service.rb +0 -66
- data/lib/dfp_api/v201302/user_service_registry.rb +0 -46
- data/lib/dfp_api/v201302/user_team_association_service.rb +0 -58
- data/lib/dfp_api/v201302/user_team_association_service_registry.rb +0 -46
|
@@ -1,72 +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 company by its ID. To determine which companies exist, run
|
|
22
|
-
# get_all_companies.rb.
|
|
23
|
-
#
|
|
24
|
-
# Tags: CompanyService.getCompany
|
|
25
|
-
|
|
26
|
-
require 'dfp_api'
|
|
27
|
-
|
|
28
|
-
API_VERSION = :v201311
|
|
29
|
-
|
|
30
|
-
def get_company()
|
|
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 CompanyService.
|
|
39
|
-
company_service = dfp.service(:CompanyService, API_VERSION)
|
|
40
|
-
|
|
41
|
-
# Set the ID of the company to get.
|
|
42
|
-
company_id = 'INSERT_COMPANY_ID_HERE'.to_i
|
|
43
|
-
|
|
44
|
-
# Get the company.
|
|
45
|
-
company = company_service.get_company(company_id)
|
|
46
|
-
|
|
47
|
-
if company
|
|
48
|
-
puts "Company with ID: %d, name: %s and type: %s was found." %
|
|
49
|
-
[company[:id], company[:name], company[:type]]
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
if __FILE__ == $0
|
|
54
|
-
begin
|
|
55
|
-
get_company()
|
|
56
|
-
|
|
57
|
-
# HTTP errors.
|
|
58
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
59
|
-
puts "HTTP Error: %s" % e
|
|
60
|
-
|
|
61
|
-
# API errors.
|
|
62
|
-
rescue DfpApi::Errors::ApiException => e
|
|
63
|
-
puts "Message: %s" % e.message
|
|
64
|
-
puts 'Errors:'
|
|
65
|
-
e.errors.each_with_index do |error, index|
|
|
66
|
-
puts "\tError [%d]:" % (index + 1)
|
|
67
|
-
error.each do |field, value|
|
|
68
|
-
puts "\t\t%s: %s" % [field, value]
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
@@ -1,72 +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 by its ID. To determine which creatives exist,
|
|
22
|
-
# run get_all_creatives.rb.
|
|
23
|
-
#
|
|
24
|
-
# Tags: CreativeService.getCreative
|
|
25
|
-
|
|
26
|
-
require 'dfp_api'
|
|
27
|
-
|
|
28
|
-
API_VERSION = :v201311
|
|
29
|
-
|
|
30
|
-
def get_creative()
|
|
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 CreativeService.
|
|
39
|
-
creative_service = dfp.service(:CreativeService, API_VERSION)
|
|
40
|
-
|
|
41
|
-
# Set the ID of the creative to get.
|
|
42
|
-
creative_id = 'INSERT_CREATIVE_ID_HERE'.to_i
|
|
43
|
-
|
|
44
|
-
# Get the creative.
|
|
45
|
-
creative = creative_service.get_creative(creative_id)
|
|
46
|
-
|
|
47
|
-
if creative
|
|
48
|
-
puts "Creative with ID: %d, name: %s and type: %s was found." %
|
|
49
|
-
[creative[:id], creative[:name], creative[:creative_type]]
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
if __FILE__ == $0
|
|
54
|
-
begin
|
|
55
|
-
get_creative()
|
|
56
|
-
|
|
57
|
-
# HTTP errors.
|
|
58
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
59
|
-
puts "HTTP Error: %s" % e
|
|
60
|
-
|
|
61
|
-
# API errors.
|
|
62
|
-
rescue DfpApi::Errors::ApiException => e
|
|
63
|
-
puts "Message: %s" % e.message
|
|
64
|
-
puts 'Errors:'
|
|
65
|
-
e.errors.each_with_index do |error, index|
|
|
66
|
-
puts "\tError [%d]:" % (index + 1)
|
|
67
|
-
error.each do |field, value|
|
|
68
|
-
puts "\t\t%s: %s" % [field, value]
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
@@ -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 = :v201311
|
|
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,72 +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 an ad unit by its ID. To determine which ad units
|
|
22
|
-
# exist, run get_inventory_tree.rb or get_all_ad_units.rb.
|
|
23
|
-
#
|
|
24
|
-
# Tags: InventoryService.getAdUnit
|
|
25
|
-
|
|
26
|
-
require 'dfp_api'
|
|
27
|
-
|
|
28
|
-
API_VERSION = :v201311
|
|
29
|
-
|
|
30
|
-
def get_ad_unit()
|
|
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
|
-
# Set the ID of the ad unit to get.
|
|
42
|
-
ad_unit_id = 'INSERT_AD_UNIT_ID_HERE'.to_i
|
|
43
|
-
|
|
44
|
-
# Get the ad unit.
|
|
45
|
-
ad_unit = inventory_service.get_ad_unit(ad_unit_id)
|
|
46
|
-
|
|
47
|
-
if ad_unit
|
|
48
|
-
puts "Ad unit with ID: %d, name: %s and status: %s was found." %
|
|
49
|
-
[ad_unit[:id], ad_unit[:name], ad_unit[:status]]
|
|
50
|
-
end
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
if __FILE__ == $0
|
|
54
|
-
begin
|
|
55
|
-
get_ad_unit()
|
|
56
|
-
|
|
57
|
-
# HTTP errors.
|
|
58
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
59
|
-
puts "HTTP Error: %s" % e
|
|
60
|
-
|
|
61
|
-
# API errors.
|
|
62
|
-
rescue DfpApi::Errors::ApiException => e
|
|
63
|
-
puts "Message: %s" % e.message
|
|
64
|
-
puts 'Errors:'
|
|
65
|
-
e.errors.each_with_index do |error, index|
|
|
66
|
-
puts "\tError [%d]:" % (index + 1)
|
|
67
|
-
error.each do |field, value|
|
|
68
|
-
puts "\t\t%s: %s" % [field, value]
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
@@ -1,76 +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 label by its ID. To determine which labels exist,
|
|
22
|
-
# run get_all_labels.rb.
|
|
23
|
-
#
|
|
24
|
-
# This feature is only available to DFP premium solution networks.
|
|
25
|
-
#
|
|
26
|
-
# Tags: LabelService.getLabel
|
|
27
|
-
|
|
28
|
-
require 'dfp_api'
|
|
29
|
-
|
|
30
|
-
API_VERSION = :v201311
|
|
31
|
-
|
|
32
|
-
def get_label()
|
|
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
|
-
# Set the ID of the label to get.
|
|
44
|
-
label_id = 'INSERT_LABEL_ID_HERE'.to_i
|
|
45
|
-
|
|
46
|
-
# Get the label.
|
|
47
|
-
label = label_service.get_label(label_id)
|
|
48
|
-
|
|
49
|
-
if label
|
|
50
|
-
puts "Label with ID: %d, name: '%s' and types '%s' was found." %
|
|
51
|
-
[label[:id], label[:name], label[:types].join(', ')]
|
|
52
|
-
else
|
|
53
|
-
puts 'No label found for this ID.'
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
if __FILE__ == $0
|
|
58
|
-
begin
|
|
59
|
-
get_label()
|
|
60
|
-
|
|
61
|
-
# HTTP errors.
|
|
62
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
63
|
-
puts "HTTP Error: %s" % e
|
|
64
|
-
|
|
65
|
-
# API errors.
|
|
66
|
-
rescue DfpApi::Errors::ApiException => e
|
|
67
|
-
puts "Message: %s" % e.message
|
|
68
|
-
puts 'Errors:'
|
|
69
|
-
e.errors.each_with_index do |error, index|
|
|
70
|
-
puts "\tError [%d]:" % (index + 1)
|
|
71
|
-
error.each do |field, value|
|
|
72
|
-
puts "\t\t%s: %s" % [field, value]
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
@@ -1,77 +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 line item creative association (LICA) by the line item and
|
|
22
|
-
# creative ID. To determine which line items exist, run get_all_line_items.rb.
|
|
23
|
-
# To determine which creatives exit, run get_all_creatives.rb.
|
|
24
|
-
#
|
|
25
|
-
# Tags: LineItemCreativeAssociationService.getLineItemCreativeAssociation
|
|
26
|
-
|
|
27
|
-
require 'dfp_api'
|
|
28
|
-
|
|
29
|
-
API_VERSION = :v201311
|
|
30
|
-
|
|
31
|
-
def get_lica()
|
|
32
|
-
# Get DfpApi instance and load configuration from ~/dfp_api.yml.
|
|
33
|
-
dfp = DfpApi::Api.new
|
|
34
|
-
|
|
35
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
|
36
|
-
# the configuration file or provide your own logger:
|
|
37
|
-
# dfp.logger = Logger.new('dfp_xml.log')
|
|
38
|
-
|
|
39
|
-
# Get the LineItemCreativeAssociationService.
|
|
40
|
-
lica_service = dfp.service(:LineItemCreativeAssociationService, API_VERSION)
|
|
41
|
-
|
|
42
|
-
# Set the line item and creative IDs to use to retrieve the LICA.
|
|
43
|
-
line_item_id = 'INSERT_LINE_ITEM_ID_HERE'.to_i
|
|
44
|
-
creative_id = 'INSERT_CREATIVE_ID_HERE'.to_i
|
|
45
|
-
|
|
46
|
-
# Get the LICA.
|
|
47
|
-
lica =
|
|
48
|
-
lica_service.get_line_item_creative_association(line_item_id, creative_id)
|
|
49
|
-
|
|
50
|
-
if lica
|
|
51
|
-
puts ("LICA with line item ID: %d, creative ID: %d and status: %s was " +
|
|
52
|
-
"found.") % [lica[:line_item_id], lica[:creative_id], lica[:status]]
|
|
53
|
-
else
|
|
54
|
-
puts 'No lica found for this ID.'
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
if __FILE__ == $0
|
|
59
|
-
begin
|
|
60
|
-
get_lica()
|
|
61
|
-
|
|
62
|
-
# HTTP errors.
|
|
63
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
64
|
-
puts "HTTP Error: %s" % e
|
|
65
|
-
|
|
66
|
-
# API errors.
|
|
67
|
-
rescue DfpApi::Errors::ApiException => e
|
|
68
|
-
puts "Message: %s" % e.message
|
|
69
|
-
puts 'Errors:'
|
|
70
|
-
e.errors.each_with_index do |error, index|
|
|
71
|
-
puts "\tError [%d]:" % (index + 1)
|
|
72
|
-
error.each do |field, value|
|
|
73
|
-
puts "\t\t%s: %s" % [field, value]
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|