google-dfp-api 0.2.8 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (450) hide show
  1. data/ChangeLog +4 -0
  2. data/README +4 -6
  3. data/dfp_api.yml +5 -1
  4. data/examples/{v201104/order_service/get_all_orders.rb → v201203/audience_segment_service/get_all_audience_segments.rb} +18 -17
  5. data/examples/{v201103 → v201203}/common/error_handling.rb +1 -1
  6. data/examples/{v201107 → v201203}/common/oauth_handling.rb +1 -1
  7. data/examples/{v201107 → v201203}/company_service/create_companies.rb +1 -1
  8. data/examples/{v201107 → v201203}/company_service/get_all_companies.rb +1 -1
  9. data/examples/{v201104 → v201203}/company_service/get_companies_by_statement.rb +1 -1
  10. data/examples/{v201104 → v201203}/company_service/get_company.rb +1 -1
  11. data/examples/{v201107 → v201203}/company_service/update_companies.rb +1 -1
  12. data/examples/{v201103/user_service/get_all_users.rb → v201203/content_service/get_all_content.rb} +16 -15
  13. data/examples/v201203/content_service/get_content_by_category.rb +135 -0
  14. data/examples/{v201107 → v201203}/creative_service/copy_image_creatives.rb +1 -1
  15. data/examples/v201203/creative_service/create_creative_from_template.rb +138 -0
  16. data/examples/{v201107 → v201203}/creative_service/create_creatives.rb +1 -1
  17. data/examples/{v201103/creative_service/create_creatives.rb → v201203/creative_service/create_custom_creative.rb} +28 -30
  18. data/examples/{v201103 → v201203}/creative_service/get_all_creatives.rb +1 -1
  19. data/examples/{v201104 → v201203}/creative_service/get_creative.rb +1 -1
  20. data/examples/{v201107 → v201203}/creative_service/get_creatives_by_statement.rb +1 -1
  21. data/examples/{v201103 → v201203}/creative_service/update_creatives.rb +1 -1
  22. data/examples/{v201103/inventory_service/get_all_ad_units.rb → v201203/creative_template_service/get_all_creative_templates.rb} +16 -15
  23. data/examples/{v201103/creative_service/get_creative.rb → v201203/creative_template_service/get_creative_template.rb} +17 -15
  24. data/examples/{v201107/user_service/get_users_by_statement.rb → v201203/creative_template_service/get_creative_templates_by_statement.rb} +18 -17
  25. data/examples/{v201107 → v201203}/custom_targeting_service/create_custom_targeting_keys_and_values.rb +28 -6
  26. data/examples/{v201103 → v201203}/custom_targeting_service/delete_custom_targeting_keys.rb +1 -1
  27. data/examples/{v201107 → v201203}/custom_targeting_service/delete_custom_targeting_values.rb +1 -1
  28. data/examples/{v201103 → v201203}/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +1 -1
  29. data/examples/{v201104 → v201203}/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +1 -1
  30. data/examples/{v201104 → v201203}/custom_targeting_service/get_custom_targeting_values_by_statement.rb +1 -1
  31. data/examples/{v201107 → v201203}/custom_targeting_service/update_custom_targeting_keys.rb +1 -1
  32. data/examples/{v201103 → v201203}/custom_targeting_service/update_custom_targeting_values.rb +1 -1
  33. data/examples/{v201104 → v201203}/forecast_service/get_forecast.rb +8 -4
  34. data/examples/{v201107 → v201203}/forecast_service/get_forecast_by_id.rb +1 -1
  35. data/examples/{v201107 → v201203}/inventory_service/create_ad_units.rb +9 -3
  36. data/examples/{v201103/inventory_service/create_ad_units.rb → v201203/inventory_service/create_mobile_ad_unit.rb} +27 -22
  37. data/examples/{v201104/inventory_service/create_ad_units.rb → v201203/inventory_service/create_video_ad_unit.rb} +35 -22
  38. data/examples/{v201103 → v201203}/inventory_service/deactivate_ad_units.rb +1 -1
  39. data/examples/{v201103 → v201203}/inventory_service/get_ad_unit.rb +1 -1
  40. data/examples/{v201107 → v201203}/inventory_service/get_ad_unit_sizes.rb +20 -7
  41. data/examples/{v201104 → v201203}/inventory_service/get_ad_units_by_statement.rb +1 -1
  42. data/examples/{v201104 → v201203}/inventory_service/get_all_ad_units.rb +1 -1
  43. data/examples/{v201104 → v201203}/inventory_service/update_ad_units.rb +1 -1
  44. data/examples/{v201107 → v201203}/label_service/create_labels.rb +6 -5
  45. data/examples/{v201107 → v201203}/label_service/deactivate_labels.rb +1 -1
  46. data/examples/{v201107 → v201203}/label_service/get_all_labels.rb +6 -4
  47. data/examples/{v201107 → v201203}/label_service/get_label.rb +5 -4
  48. data/examples/{v201107 → v201203}/label_service/get_labels_by_statement.rb +9 -18
  49. data/examples/{v201107 → v201203}/label_service/update_labels.rb +12 -13
  50. data/examples/{v201107 → v201203}/line_item_creative_association_service/create_licas.rb +1 -1
  51. data/examples/{v201104 → v201203}/line_item_creative_association_service/deactivate_licas.rb +1 -1
  52. data/examples/{v201104 → v201203}/line_item_creative_association_service/get_all_licas.rb +1 -1
  53. data/examples/{v201104 → v201203}/line_item_creative_association_service/get_lica.rb +1 -1
  54. data/examples/{v201107 → v201203}/line_item_creative_association_service/get_licas_by_statement.rb +1 -1
  55. data/examples/{v201107 → v201203}/line_item_creative_association_service/update_licas.rb +1 -1
  56. data/examples/{v201103 → v201203}/line_item_service/activate_line_items.rb +1 -1
  57. data/examples/{v201107 → v201203}/line_item_service/create_line_items.rb +19 -9
  58. data/examples/v201203/line_item_service/create_mobile_line_item.rb +134 -0
  59. data/examples/v201203/line_item_service/create_video_line_item.rb +155 -0
  60. data/examples/{v201107 → v201203}/line_item_service/get_all_line_items.rb +1 -1
  61. data/examples/{v201107 → v201203}/line_item_service/get_line_item.rb +1 -1
  62. data/examples/{v201107 → v201203}/line_item_service/get_line_items_by_statement.rb +11 -7
  63. data/examples/{v201103/line_item_service/get_line_items_by_statement.rb → v201203/line_item_service/get_recently_updated_line_items.rb} +23 -14
  64. data/examples/{v201107 → v201203}/line_item_service/target_custom_criteria.rb +1 -1
  65. data/examples/{v201103 → v201203}/line_item_service/update_line_items.rb +1 -1
  66. data/examples/{v201103 → v201203}/network_service/get_all_networks.rb +1 -1
  67. data/examples/{v201103 → v201203}/network_service/get_current_network.rb +1 -1
  68. data/examples/{v201107/network_service/get_current_network.rb → v201203/network_service/make_test_network.rb} +21 -10
  69. data/examples/{v201104 → v201203}/order_service/approve_orders.rb +24 -18
  70. data/examples/{v201107 → v201203}/order_service/create_orders.rb +1 -1
  71. data/examples/{v201107 → v201203}/order_service/get_all_orders.rb +1 -1
  72. data/examples/{v201103 → v201203}/order_service/get_order.rb +1 -1
  73. data/examples/{v201103 → v201203}/order_service/get_orders_by_statement.rb +1 -1
  74. data/examples/{v201107 → v201203}/order_service/update_orders.rb +1 -1
  75. data/examples/{v201103 → v201203}/placement_service/create_placements.rb +3 -2
  76. data/examples/{v201107 → v201203}/placement_service/deactivate_placements.rb +1 -1
  77. data/examples/{v201103 → v201203}/placement_service/get_all_placements.rb +1 -1
  78. data/examples/{v201104 → v201203}/placement_service/get_placement.rb +1 -1
  79. data/examples/{v201107 → v201203}/placement_service/get_placements_by_statement.rb +1 -1
  80. data/examples/{v201103 → v201203}/placement_service/update_placements.rb +1 -1
  81. data/examples/{v201104 → v201203}/publisher_query_language_service/get_all_cities.rb +7 -2
  82. data/examples/{v201107 → v201203}/report_service/download_report.rb +1 -1
  83. data/examples/{v201104 → v201203}/report_service/run_delivery_report.rb +17 -3
  84. data/examples/{v201104 → v201203}/report_service/run_inventory_report.rb +4 -2
  85. data/examples/{v201107/report_service/run_delivery_report.rb → v201203/report_service/run_merged_delivery_report.rb} +12 -7
  86. data/examples/{v201107 → v201203}/report_service/run_sales_report.rb +1 -1
  87. data/examples/v201203/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +108 -0
  88. data/examples/{v201107/inventory_service/get_all_ad_units.rb → v201203/suggested_ad_unit_service/get_all_suggested_ad_units.rb} +17 -14
  89. data/examples/{v201104/inventory_service/get_ad_unit.rb → v201203/suggested_ad_unit_service/get_suggested_ad_unit.rb} +17 -14
  90. data/examples/{v201107/inventory_service/get_ad_units_by_statement.rb → v201203/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb} +22 -26
  91. data/examples/{v201103/user_service/create_users.rb → v201203/team_service/create_teams.rb} +31 -28
  92. data/examples/{v201107/user_service/get_all_users.rb → v201203/team_service/get_all_teams.rb} +16 -17
  93. data/examples/{v201104/network_service/get_current_network.rb → v201203/team_service/get_team.rb} +21 -13
  94. data/examples/{v201103/user_service/update_users.rb → v201203/team_service/get_teams_by_statement.rb} +27 -29
  95. data/examples/{v201104/user_service/update_users.rb → v201203/team_service/update_teams.rb} +38 -23
  96. data/examples/v201203/third_party_slot_service/archive_third_party_slots.rb +124 -0
  97. data/examples/{v201103/company_service/get_company.rb → v201203/third_party_slot_service/create_third_party_slot.rb} +33 -14
  98. data/examples/{v201103/order_service/get_all_orders.rb → v201203/third_party_slot_service/get_all_third_party_slots.rb} +15 -15
  99. data/examples/{v201104/placement_service/get_placements_by_statement.rb → v201203/third_party_slot_service/get_third_party_slot_by_statement.rb} +16 -16
  100. data/examples/{v201103/placement_service/get_placements_by_statement.rb → v201203/third_party_slot_service/update_third_party_slots.rb} +32 -23
  101. data/examples/{v201104 → v201203}/user_service/create_users.rb +1 -1
  102. data/examples/{v201104 → v201203}/user_service/deactivate_users.rb +1 -1
  103. data/examples/{v201103 → v201203}/user_service/get_all_roles.rb +1 -1
  104. data/examples/{v201104 → v201203}/user_service/get_all_users.rb +1 -1
  105. data/examples/{v201107 → v201203}/user_service/get_current_user.rb +1 -1
  106. data/examples/{v201103 → v201203}/user_service/get_user.rb +1 -1
  107. data/examples/{v201103 → v201203}/user_service/get_users_by_statement.rb +1 -1
  108. data/examples/{v201107 → v201203}/user_service/update_users.rb +1 -1
  109. data/lib/dfp_api/api_config.rb +14 -36
  110. data/lib/dfp_api/v201108/company_service.rb +18 -16
  111. data/lib/dfp_api/v201108/company_service_registry.rb +8 -6
  112. data/lib/dfp_api/v201108/creative_service.rb +10 -8
  113. data/lib/dfp_api/v201108/creative_service_registry.rb +8 -6
  114. data/lib/dfp_api/v201108/custom_targeting_service.rb +22 -20
  115. data/lib/dfp_api/v201108/custom_targeting_service_registry.rb +8 -6
  116. data/lib/dfp_api/v201108/forecast_service.rb +10 -8
  117. data/lib/dfp_api/v201108/forecast_service_registry.rb +8 -6
  118. data/lib/dfp_api/v201108/inventory_service.rb +22 -20
  119. data/lib/dfp_api/v201108/inventory_service_registry.rb +8 -6
  120. data/lib/dfp_api/v201108/label_service.rb +18 -16
  121. data/lib/dfp_api/v201108/label_service_registry.rb +8 -6
  122. data/lib/dfp_api/v201108/line_item_creative_association_service.rb +14 -12
  123. data/lib/dfp_api/v201108/line_item_creative_association_service_registry.rb +8 -6
  124. data/lib/dfp_api/v201108/line_item_service.rb +18 -16
  125. data/lib/dfp_api/v201108/line_item_service_registry.rb +8 -6
  126. data/lib/dfp_api/v201108/network_service.rb +6 -4
  127. data/lib/dfp_api/v201108/network_service_registry.rb +8 -6
  128. data/lib/dfp_api/v201108/order_service.rb +10 -8
  129. data/lib/dfp_api/v201108/order_service_registry.rb +8 -6
  130. data/lib/dfp_api/v201108/placement_service.rb +18 -16
  131. data/lib/dfp_api/v201108/placement_service_registry.rb +8 -6
  132. data/lib/dfp_api/v201108/publisher_query_language_service.rb +6 -4
  133. data/lib/dfp_api/v201108/publisher_query_language_service_registry.rb +8 -6
  134. data/lib/dfp_api/v201108/report_service.rb +6 -4
  135. data/lib/dfp_api/v201108/report_service_registry.rb +8 -6
  136. data/lib/dfp_api/v201108/third_party_slot_service.rb +6 -4
  137. data/lib/dfp_api/v201108/third_party_slot_service_registry.rb +8 -6
  138. data/lib/dfp_api/v201108/user_service.rb +18 -16
  139. data/lib/dfp_api/v201108/user_service_registry.rb +8 -6
  140. data/lib/dfp_api/v201111/company_service.rb +18 -16
  141. data/lib/dfp_api/v201111/company_service_registry.rb +8 -6
  142. data/lib/dfp_api/v201111/content_service.rb +6 -4
  143. data/lib/dfp_api/v201111/content_service_registry.rb +8 -6
  144. data/lib/dfp_api/v201111/creative_service.rb +10 -8
  145. data/lib/dfp_api/v201111/creative_service_registry.rb +8 -6
  146. data/lib/dfp_api/v201111/creative_template_service.rb +6 -4
  147. data/lib/dfp_api/v201111/creative_template_service_registry.rb +8 -6
  148. data/lib/dfp_api/v201111/custom_targeting_service.rb +22 -20
  149. data/lib/dfp_api/v201111/custom_targeting_service_registry.rb +8 -6
  150. data/lib/dfp_api/v201111/forecast_service.rb +10 -8
  151. data/lib/dfp_api/v201111/forecast_service_registry.rb +8 -6
  152. data/lib/dfp_api/v201111/inventory_service.rb +22 -20
  153. data/lib/dfp_api/v201111/inventory_service_registry.rb +8 -6
  154. data/lib/dfp_api/v201111/label_service.rb +18 -16
  155. data/lib/dfp_api/v201111/label_service_registry.rb +8 -6
  156. data/lib/dfp_api/v201111/line_item_creative_association_service.rb +18 -16
  157. data/lib/dfp_api/v201111/line_item_creative_association_service_registry.rb +8 -6
  158. data/lib/dfp_api/v201111/line_item_service.rb +18 -16
  159. data/lib/dfp_api/v201111/line_item_service_registry.rb +8 -6
  160. data/lib/dfp_api/v201111/network_service.rb +6 -4
  161. data/lib/dfp_api/v201111/network_service_registry.rb +8 -6
  162. data/lib/dfp_api/v201111/order_service.rb +10 -8
  163. data/lib/dfp_api/v201111/order_service_registry.rb +8 -6
  164. data/lib/dfp_api/v201111/placement_service.rb +18 -16
  165. data/lib/dfp_api/v201111/placement_service_registry.rb +8 -6
  166. data/lib/dfp_api/v201111/publisher_query_language_service.rb +6 -4
  167. data/lib/dfp_api/v201111/publisher_query_language_service_registry.rb +8 -6
  168. data/lib/dfp_api/v201111/report_service.rb +6 -4
  169. data/lib/dfp_api/v201111/report_service_registry.rb +8 -6
  170. data/lib/dfp_api/v201111/suggested_ad_unit_service.rb +6 -4
  171. data/lib/dfp_api/v201111/suggested_ad_unit_service_registry.rb +8 -6
  172. data/lib/dfp_api/v201111/third_party_slot_service.rb +6 -4
  173. data/lib/dfp_api/v201111/third_party_slot_service_registry.rb +8 -6
  174. data/lib/dfp_api/v201111/user_service.rb +18 -16
  175. data/lib/dfp_api/v201111/user_service_registry.rb +8 -6
  176. data/lib/dfp_api/v201201/company_service.rb +1 -1
  177. data/lib/dfp_api/v201201/company_service_registry.rb +2 -2
  178. data/lib/dfp_api/v201201/content_service.rb +1 -1
  179. data/lib/dfp_api/v201201/content_service_registry.rb +1 -1
  180. data/lib/dfp_api/v201201/creative_service.rb +1 -1
  181. data/lib/dfp_api/v201201/creative_service_registry.rb +1 -1
  182. data/lib/dfp_api/v201201/creative_template_service.rb +1 -1
  183. data/lib/dfp_api/v201201/creative_template_service_registry.rb +1 -1
  184. data/lib/dfp_api/v201201/custom_targeting_service.rb +1 -1
  185. data/lib/dfp_api/v201201/custom_targeting_service_registry.rb +1 -1
  186. data/lib/dfp_api/v201201/forecast_service.rb +1 -1
  187. data/lib/dfp_api/v201201/forecast_service_registry.rb +2 -2
  188. data/lib/dfp_api/v201201/inventory_service.rb +1 -1
  189. data/lib/dfp_api/v201201/inventory_service_registry.rb +1 -1
  190. data/lib/dfp_api/v201201/label_service.rb +1 -1
  191. data/lib/dfp_api/v201201/label_service_registry.rb +1 -1
  192. data/lib/dfp_api/v201201/line_item_creative_association_service.rb +1 -1
  193. data/lib/dfp_api/v201201/line_item_creative_association_service_registry.rb +1 -1
  194. data/lib/dfp_api/v201201/line_item_service.rb +1 -1
  195. data/lib/dfp_api/v201201/line_item_service_registry.rb +2 -2
  196. data/lib/dfp_api/v201201/network_service.rb +1 -1
  197. data/lib/dfp_api/v201201/network_service_registry.rb +1 -1
  198. data/lib/dfp_api/v201201/order_service.rb +1 -1
  199. data/lib/dfp_api/v201201/order_service_registry.rb +1 -1
  200. data/lib/dfp_api/v201201/placement_service.rb +1 -1
  201. data/lib/dfp_api/v201201/placement_service_registry.rb +1 -1
  202. data/lib/dfp_api/v201201/publisher_query_language_service.rb +1 -1
  203. data/lib/dfp_api/v201201/publisher_query_language_service_registry.rb +1 -1
  204. data/lib/dfp_api/v201201/report_service.rb +1 -1
  205. data/lib/dfp_api/v201201/report_service_registry.rb +1 -1
  206. data/lib/dfp_api/v201201/suggested_ad_unit_service.rb +1 -1
  207. data/lib/dfp_api/v201201/suggested_ad_unit_service_registry.rb +1 -1
  208. data/lib/dfp_api/v201201/team_service.rb +1 -1
  209. data/lib/dfp_api/v201201/team_service_registry.rb +1 -1
  210. data/lib/dfp_api/v201201/third_party_slot_service.rb +1 -1
  211. data/lib/dfp_api/v201201/third_party_slot_service_registry.rb +1 -1
  212. data/lib/dfp_api/v201201/user_service.rb +1 -1
  213. data/lib/dfp_api/v201201/user_service_registry.rb +1 -1
  214. data/lib/dfp_api/v201203/audience_segment_service.rb +34 -0
  215. data/lib/dfp_api/v201203/audience_segment_service_registry.rb +46 -0
  216. data/lib/dfp_api/{v201103 → v201203}/company_service.rb +23 -21
  217. data/lib/dfp_api/v201203/company_service_registry.rb +46 -0
  218. data/lib/dfp_api/v201203/content_service.rb +42 -0
  219. data/lib/dfp_api/v201203/content_service_registry.rb +46 -0
  220. data/lib/dfp_api/{v201103 → v201203}/creative_service.rb +15 -13
  221. data/lib/dfp_api/v201203/creative_service_registry.rb +46 -0
  222. data/lib/dfp_api/v201203/creative_template_service.rb +38 -0
  223. data/lib/dfp_api/v201203/creative_template_service_registry.rb +46 -0
  224. data/lib/dfp_api/{v201107 → v201203}/custom_targeting_service.rb +27 -25
  225. data/lib/dfp_api/v201203/custom_targeting_service_registry.rb +46 -0
  226. data/lib/dfp_api/{v201107 → v201203}/forecast_service.rb +15 -13
  227. data/lib/dfp_api/v201203/forecast_service_registry.rb +46 -0
  228. data/lib/dfp_api/{v201107 → v201203}/inventory_service.rb +29 -23
  229. data/lib/dfp_api/v201203/inventory_service_registry.rb +46 -0
  230. data/lib/dfp_api/{v201107 → v201203}/label_service.rb +23 -21
  231. data/lib/dfp_api/v201203/label_service_registry.rb +46 -0
  232. data/lib/dfp_api/{v201103 → v201203}/line_item_creative_association_service.rb +23 -17
  233. data/lib/dfp_api/v201203/line_item_creative_association_service_registry.rb +46 -0
  234. data/lib/dfp_api/{v201107 → v201203}/line_item_service.rb +23 -21
  235. data/lib/dfp_api/v201203/line_item_service_registry.rb +46 -0
  236. data/lib/dfp_api/{v201104 → v201203}/network_service.rb +15 -9
  237. data/lib/dfp_api/v201203/network_service_registry.rb +46 -0
  238. data/lib/dfp_api/{v201103 → v201203}/order_service.rb +15 -13
  239. data/lib/dfp_api/v201203/order_service_registry.rb +46 -0
  240. data/lib/dfp_api/{v201107 → v201203}/placement_service.rb +23 -21
  241. data/lib/dfp_api/v201203/placement_service_registry.rb +46 -0
  242. data/lib/dfp_api/{v201104 → v201203}/publisher_query_language_service.rb +11 -9
  243. data/lib/dfp_api/v201203/publisher_query_language_service_registry.rb +46 -0
  244. data/lib/dfp_api/{v201103 → v201203}/report_service.rb +11 -9
  245. data/lib/dfp_api/v201203/report_service_registry.rb +46 -0
  246. data/lib/dfp_api/v201203/suggested_ad_unit_service.rb +42 -0
  247. data/lib/dfp_api/v201203/suggested_ad_unit_service_registry.rb +46 -0
  248. data/lib/dfp_api/v201203/team_service.rb +54 -0
  249. data/lib/dfp_api/v201203/team_service_registry.rb +46 -0
  250. data/lib/dfp_api/v201203/third_party_slot_service.rb +46 -0
  251. data/lib/dfp_api/v201203/third_party_slot_service_registry.rb +46 -0
  252. data/lib/dfp_api/{v201107 → v201203}/user_service.rb +23 -21
  253. data/lib/dfp_api/v201203/user_service_registry.rb +46 -0
  254. data/lib/dfp_api/version.rb +1 -1
  255. data/test/bugs/test_issue_00000016.rb +3 -3
  256. data/test/dfp_api/test_config.yml +0 -2
  257. data/test/dfp_api/test_dfp_api.rb +0 -4
  258. metadata +484 -649
  259. data/examples/v201103/common/oauth_handling.rb +0 -127
  260. data/examples/v201103/company_service/create_companies.rb +0 -80
  261. data/examples/v201103/company_service/get_all_companies.rb +0 -91
  262. data/examples/v201103/company_service/get_companies_by_statement.rb +0 -87
  263. data/examples/v201103/company_service/update_companies.rb +0 -94
  264. data/examples/v201103/creative_service/copy_image_creatives.rb +0 -114
  265. data/examples/v201103/creative_service/get_creatives_by_statement.rb +0 -86
  266. data/examples/v201103/custom_targeting_service/create_custom_targeting_keys_and_values.rb +0 -117
  267. data/examples/v201103/custom_targeting_service/delete_custom_targeting_values.rb +0 -124
  268. data/examples/v201103/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +0 -91
  269. data/examples/v201103/custom_targeting_service/get_custom_targeting_values_by_statement.rb +0 -97
  270. data/examples/v201103/custom_targeting_service/update_custom_targeting_keys.rb +0 -93
  271. data/examples/v201103/forecast_service/get_forecast.rb +0 -102
  272. data/examples/v201103/forecast_service/get_forecast_by_id.rb +0 -79
  273. data/examples/v201103/inventory_service/get_ad_units_by_statement.rb +0 -95
  274. data/examples/v201103/inventory_service/update_ad_units.rb +0 -93
  275. data/examples/v201103/line_item_creative_association_service/create_licas.rb +0 -93
  276. data/examples/v201103/line_item_creative_association_service/deactivate_licas.rb +0 -126
  277. data/examples/v201103/line_item_creative_association_service/get_all_licas.rb +0 -94
  278. data/examples/v201103/line_item_creative_association_service/get_lica.rb +0 -76
  279. data/examples/v201103/line_item_creative_association_service/get_licas_by_statement.rb +0 -90
  280. data/examples/v201103/line_item_creative_association_service/update_licas.rb +0 -91
  281. data/examples/v201103/line_item_service/create_line_items.rb +0 -163
  282. data/examples/v201103/line_item_service/get_all_line_items.rb +0 -93
  283. data/examples/v201103/line_item_service/get_line_item.rb +0 -73
  284. data/examples/v201103/line_item_service/target_custom_criteria.rb +0 -134
  285. data/examples/v201103/order_service/approve_orders.rb +0 -115
  286. data/examples/v201103/order_service/create_orders.rb +0 -91
  287. data/examples/v201103/order_service/update_orders.rb +0 -94
  288. data/examples/v201103/placement_service/deactivate_placements.rb +0 -117
  289. data/examples/v201103/placement_service/get_placement.rb +0 -73
  290. data/examples/v201103/publisher_query_language_service/get_all_cities.rb +0 -84
  291. data/examples/v201103/publisher_query_language_service/get_all_countries.rb +0 -84
  292. data/examples/v201103/publisher_query_language_service/get_all_metros.rb +0 -84
  293. data/examples/v201103/publisher_query_language_service/get_all_regions.rb +0 -84
  294. data/examples/v201103/report_service/download_report.rb +0 -80
  295. data/examples/v201103/report_service/run_delivery_report.rb +0 -88
  296. data/examples/v201103/report_service/run_inventory_report.rb +0 -89
  297. data/examples/v201103/report_service/run_sales_report.rb +0 -88
  298. data/examples/v201103/user_service/deactivate_users.rb +0 -98
  299. data/examples/v201104/common/error_handling.rb +0 -75
  300. data/examples/v201104/common/oauth_handling.rb +0 -127
  301. data/examples/v201104/company_service/create_companies.rb +0 -80
  302. data/examples/v201104/company_service/get_all_companies.rb +0 -91
  303. data/examples/v201104/company_service/update_companies.rb +0 -94
  304. data/examples/v201104/creative_service/copy_image_creatives.rb +0 -114
  305. data/examples/v201104/creative_service/create_creatives.rb +0 -105
  306. data/examples/v201104/creative_service/get_all_creatives.rb +0 -92
  307. data/examples/v201104/creative_service/get_creatives_by_statement.rb +0 -86
  308. data/examples/v201104/creative_service/update_creatives.rb +0 -95
  309. data/examples/v201104/custom_targeting_service/create_custom_targeting_keys_and_values.rb +0 -117
  310. data/examples/v201104/custom_targeting_service/delete_custom_targeting_keys.rb +0 -120
  311. data/examples/v201104/custom_targeting_service/delete_custom_targeting_values.rb +0 -124
  312. data/examples/v201104/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +0 -147
  313. data/examples/v201104/custom_targeting_service/update_custom_targeting_keys.rb +0 -93
  314. data/examples/v201104/custom_targeting_service/update_custom_targeting_values.rb +0 -105
  315. data/examples/v201104/forecast_service/get_forecast_by_id.rb +0 -79
  316. data/examples/v201104/inventory_service/deactivate_ad_units.rb +0 -118
  317. data/examples/v201104/line_item_creative_association_service/create_licas.rb +0 -93
  318. data/examples/v201104/line_item_creative_association_service/get_licas_by_statement.rb +0 -90
  319. data/examples/v201104/line_item_creative_association_service/update_licas.rb +0 -91
  320. data/examples/v201104/line_item_service/activate_line_items.rb +0 -130
  321. data/examples/v201104/line_item_service/create_line_items.rb +0 -155
  322. data/examples/v201104/line_item_service/get_all_line_items.rb +0 -93
  323. data/examples/v201104/line_item_service/get_line_item.rb +0 -73
  324. data/examples/v201104/line_item_service/get_line_items_by_statement.rb +0 -88
  325. data/examples/v201104/line_item_service/target_custom_criteria.rb +0 -128
  326. data/examples/v201104/line_item_service/update_line_items.rb +0 -108
  327. data/examples/v201104/network_service/get_all_networks.rb +0 -73
  328. data/examples/v201104/order_service/create_orders.rb +0 -91
  329. data/examples/v201104/order_service/get_order.rb +0 -73
  330. data/examples/v201104/order_service/get_orders_by_statement.rb +0 -89
  331. data/examples/v201104/order_service/update_orders.rb +0 -94
  332. data/examples/v201104/placement_service/create_placements.rb +0 -127
  333. data/examples/v201104/placement_service/deactivate_placements.rb +0 -117
  334. data/examples/v201104/placement_service/get_all_placements.rb +0 -92
  335. data/examples/v201104/placement_service/update_placements.rb +0 -96
  336. data/examples/v201104/publisher_query_language_service/get_all_countries.rb +0 -84
  337. data/examples/v201104/publisher_query_language_service/get_all_metros.rb +0 -84
  338. data/examples/v201104/publisher_query_language_service/get_all_regions.rb +0 -84
  339. data/examples/v201104/report_service/download_report.rb +0 -80
  340. data/examples/v201104/report_service/run_sales_report.rb +0 -88
  341. data/examples/v201104/user_service/get_all_roles.rb +0 -72
  342. data/examples/v201104/user_service/get_user.rb +0 -72
  343. data/examples/v201104/user_service/get_users_by_statement.rb +0 -78
  344. data/examples/v201107/common/error_handling.rb +0 -75
  345. data/examples/v201107/company_service/get_companies_by_statement.rb +0 -87
  346. data/examples/v201107/company_service/get_company.rb +0 -71
  347. data/examples/v201107/creative_service/get_all_creatives.rb +0 -92
  348. data/examples/v201107/creative_service/get_creative.rb +0 -71
  349. data/examples/v201107/creative_service/update_creatives.rb +0 -95
  350. data/examples/v201107/custom_targeting_service/delete_custom_targeting_keys.rb +0 -120
  351. data/examples/v201107/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +0 -147
  352. data/examples/v201107/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +0 -91
  353. data/examples/v201107/custom_targeting_service/get_custom_targeting_values_by_statement.rb +0 -97
  354. data/examples/v201107/custom_targeting_service/update_custom_targeting_values.rb +0 -105
  355. data/examples/v201107/forecast_service/get_forecast.rb +0 -102
  356. data/examples/v201107/inventory_service/deactivate_ad_units.rb +0 -118
  357. data/examples/v201107/inventory_service/get_ad_unit.rb +0 -71
  358. data/examples/v201107/inventory_service/update_ad_units.rb +0 -93
  359. data/examples/v201107/line_item_creative_association_service/deactivate_licas.rb +0 -126
  360. data/examples/v201107/line_item_creative_association_service/get_all_licas.rb +0 -94
  361. data/examples/v201107/line_item_creative_association_service/get_lica.rb +0 -76
  362. data/examples/v201107/line_item_service/activate_line_items.rb +0 -130
  363. data/examples/v201107/line_item_service/update_line_items.rb +0 -108
  364. data/examples/v201107/network_service/get_all_networks.rb +0 -73
  365. data/examples/v201107/order_service/approve_orders.rb +0 -115
  366. data/examples/v201107/order_service/get_order.rb +0 -73
  367. data/examples/v201107/order_service/get_orders_by_statement.rb +0 -89
  368. data/examples/v201107/placement_service/create_placements.rb +0 -127
  369. data/examples/v201107/placement_service/get_all_placements.rb +0 -92
  370. data/examples/v201107/placement_service/get_placement.rb +0 -73
  371. data/examples/v201107/placement_service/update_placements.rb +0 -96
  372. data/examples/v201107/publisher_query_language_service/get_all_bandwidth_groups.rb +0 -84
  373. data/examples/v201107/publisher_query_language_service/get_all_browser_languages.rb +0 -84
  374. data/examples/v201107/publisher_query_language_service/get_all_browsers.rb +0 -84
  375. data/examples/v201107/publisher_query_language_service/get_all_cities.rb +0 -84
  376. data/examples/v201107/publisher_query_language_service/get_all_countries.rb +0 -84
  377. data/examples/v201107/publisher_query_language_service/get_all_metros.rb +0 -84
  378. data/examples/v201107/publisher_query_language_service/get_all_operating_systems.rb +0 -84
  379. data/examples/v201107/publisher_query_language_service/get_all_regions.rb +0 -84
  380. data/examples/v201107/report_service/run_inventory_report.rb +0 -89
  381. data/examples/v201107/user_service/create_users.rb +0 -88
  382. data/examples/v201107/user_service/deactivate_users.rb +0 -98
  383. data/examples/v201107/user_service/get_all_roles.rb +0 -72
  384. data/examples/v201107/user_service/get_user.rb +0 -72
  385. data/lib/dfp_api/v201103/company_service_registry.rb +0 -44
  386. data/lib/dfp_api/v201103/creative_service_registry.rb +0 -44
  387. data/lib/dfp_api/v201103/custom_targeting_service.rb +0 -60
  388. data/lib/dfp_api/v201103/custom_targeting_service_registry.rb +0 -44
  389. data/lib/dfp_api/v201103/forecast_service.rb +0 -36
  390. data/lib/dfp_api/v201103/forecast_service_registry.rb +0 -44
  391. data/lib/dfp_api/v201103/inventory_service.rb +0 -56
  392. data/lib/dfp_api/v201103/inventory_service_registry.rb +0 -44
  393. data/lib/dfp_api/v201103/line_item_creative_association_service_registry.rb +0 -44
  394. data/lib/dfp_api/v201103/line_item_service.rb +0 -56
  395. data/lib/dfp_api/v201103/line_item_service_registry.rb +0 -44
  396. data/lib/dfp_api/v201103/network_service.rb +0 -40
  397. data/lib/dfp_api/v201103/network_service_registry.rb +0 -44
  398. data/lib/dfp_api/v201103/order_service_registry.rb +0 -44
  399. data/lib/dfp_api/v201103/placement_service.rb +0 -56
  400. data/lib/dfp_api/v201103/placement_service_registry.rb +0 -44
  401. data/lib/dfp_api/v201103/publisher_query_language_service.rb +0 -32
  402. data/lib/dfp_api/v201103/publisher_query_language_service_registry.rb +0 -44
  403. data/lib/dfp_api/v201103/report_service_registry.rb +0 -44
  404. data/lib/dfp_api/v201103/user_service.rb +0 -60
  405. data/lib/dfp_api/v201103/user_service_registry.rb +0 -44
  406. data/lib/dfp_api/v201104/company_service.rb +0 -52
  407. data/lib/dfp_api/v201104/company_service_registry.rb +0 -44
  408. data/lib/dfp_api/v201104/creative_service.rb +0 -52
  409. data/lib/dfp_api/v201104/creative_service_registry.rb +0 -44
  410. data/lib/dfp_api/v201104/custom_targeting_service.rb +0 -60
  411. data/lib/dfp_api/v201104/custom_targeting_service_registry.rb +0 -44
  412. data/lib/dfp_api/v201104/forecast_service.rb +0 -36
  413. data/lib/dfp_api/v201104/forecast_service_registry.rb +0 -44
  414. data/lib/dfp_api/v201104/inventory_service.rb +0 -56
  415. data/lib/dfp_api/v201104/inventory_service_registry.rb +0 -44
  416. data/lib/dfp_api/v201104/line_item_creative_association_service.rb +0 -56
  417. data/lib/dfp_api/v201104/line_item_creative_association_service_registry.rb +0 -44
  418. data/lib/dfp_api/v201104/line_item_service.rb +0 -56
  419. data/lib/dfp_api/v201104/line_item_service_registry.rb +0 -44
  420. data/lib/dfp_api/v201104/network_service_registry.rb +0 -44
  421. data/lib/dfp_api/v201104/order_service.rb +0 -56
  422. data/lib/dfp_api/v201104/order_service_registry.rb +0 -44
  423. data/lib/dfp_api/v201104/placement_service.rb +0 -56
  424. data/lib/dfp_api/v201104/placement_service_registry.rb +0 -44
  425. data/lib/dfp_api/v201104/publisher_query_language_service_registry.rb +0 -44
  426. data/lib/dfp_api/v201104/report_service.rb +0 -40
  427. data/lib/dfp_api/v201104/report_service_registry.rb +0 -44
  428. data/lib/dfp_api/v201104/user_service.rb +0 -60
  429. data/lib/dfp_api/v201104/user_service_registry.rb +0 -44
  430. data/lib/dfp_api/v201107/company_service.rb +0 -52
  431. data/lib/dfp_api/v201107/company_service_registry.rb +0 -44
  432. data/lib/dfp_api/v201107/creative_service.rb +0 -52
  433. data/lib/dfp_api/v201107/creative_service_registry.rb +0 -44
  434. data/lib/dfp_api/v201107/custom_targeting_service_registry.rb +0 -44
  435. data/lib/dfp_api/v201107/forecast_service_registry.rb +0 -44
  436. data/lib/dfp_api/v201107/inventory_service_registry.rb +0 -44
  437. data/lib/dfp_api/v201107/label_service_registry.rb +0 -44
  438. data/lib/dfp_api/v201107/line_item_creative_association_service.rb +0 -56
  439. data/lib/dfp_api/v201107/line_item_creative_association_service_registry.rb +0 -44
  440. data/lib/dfp_api/v201107/line_item_service_registry.rb +0 -44
  441. data/lib/dfp_api/v201107/network_service.rb +0 -40
  442. data/lib/dfp_api/v201107/network_service_registry.rb +0 -44
  443. data/lib/dfp_api/v201107/order_service.rb +0 -56
  444. data/lib/dfp_api/v201107/order_service_registry.rb +0 -44
  445. data/lib/dfp_api/v201107/placement_service_registry.rb +0 -44
  446. data/lib/dfp_api/v201107/publisher_query_language_service.rb +0 -32
  447. data/lib/dfp_api/v201107/publisher_query_language_service_registry.rb +0 -44
  448. data/lib/dfp_api/v201107/report_service.rb +0 -40
  449. data/lib/dfp_api/v201107/report_service_registry.rb +0 -44
  450. data/lib/dfp_api/v201107/user_service_registry.rb +0 -44
@@ -26,7 +26,7 @@
26
26
 
27
27
  require 'dfp_api'
28
28
 
29
- API_VERSION = :v201103
29
+ API_VERSION = :v201203
30
30
 
31
31
  def update_custom_targeting_values()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -24,7 +24,7 @@
24
24
 
25
25
  require 'dfp_api'
26
26
 
27
- API_VERSION = :v201104
27
+ API_VERSION = :v201203
28
28
 
29
29
  def get_forecast()
30
30
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -38,7 +38,7 @@ def get_forecast()
38
38
  forecast_service = dfp.service(:ForecastService, API_VERSION)
39
39
 
40
40
  # Set the placement that the prospective line item will target.
41
- targeted_placement_ids = ["INSERT_PLACEMENT_ID_HERE".to_i]
41
+ targeted_placement_ids = ['INSERT_PLACEMENT_ID_HERE'.to_i]
42
42
 
43
43
  # Create targeting.
44
44
  targeting = {
@@ -46,13 +46,17 @@ def get_forecast()
46
46
  {:targeted_placement_ids => targeted_placement_ids}
47
47
  }
48
48
 
49
+ # Create the creative placeholder.
50
+ creative_placeholder = {
51
+ :size => {:width => 300, :height => 250, :is_aspect_ratio => false}
52
+ }
53
+
49
54
  # Create prospective line item.
50
55
  line_item = {
51
56
  :line_item_type => 'SPONSORSHIP',
52
57
  :targeting => targeting,
53
58
  # Set the size of creatives that can be associated with this line item.
54
- :creative_sizes =>
55
- {:width => 300, :height => 250, :is_aspect_ratio => false},
59
+ :creative_placeholders => [creative_placeholder],
56
60
  # Set the line item's time to be now until the projected end date time.
57
61
  :start_date_time_type => 'IMMEDIATELY',
58
62
  :end_date_time => Time.utc(2012, 01, 01),
@@ -24,7 +24,7 @@
24
24
 
25
25
  require 'dfp_api'
26
26
 
27
- API_VERSION = :v201107
27
+ API_VERSION = :v201203
28
28
 
29
29
  def get_forecast_by_id()
30
30
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -21,11 +21,11 @@
21
21
  # determine which ad units exist, run get_inventory_tree.rb or
22
22
  # get_all_ad_units.rb.
23
23
  #
24
- # Tags: InventoryService.createAdUnits
24
+ # Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork
25
25
 
26
26
  require 'dfp_api'
27
27
 
28
- API_VERSION = :v201107
28
+ API_VERSION = :v201203
29
29
  # Number of ad units to create.
30
30
  ITEM_COUNT = 5
31
31
 
@@ -49,6 +49,12 @@ def create_ad_units()
49
49
 
50
50
  puts "Using effective root ad unit: %d" % effective_root_ad_unit_id
51
51
 
52
+ # Create the creative placeholder.
53
+ creative_placeholder = {
54
+ :size => {:width => 300, :height => 250, :is_aspect_ratio => false},
55
+ :environment_type => 'BROWSER'
56
+ }
57
+
52
58
  # Create an array to store local ad unit objects.
53
59
  ad_units = (1..ITEM_COUNT).map do |index|
54
60
  {:name => "Ad_Unit_%d" % index,
@@ -56,7 +62,7 @@ def create_ad_units()
56
62
  :description => 'Ad unit description.',
57
63
  :target_window => 'BLANK',
58
64
  # Set the size of possible creatives that can match this ad unit.
59
- :sizes => [{:width => 300, :height => 250, :is_aspect_ratio => false}]}
65
+ :ad_unit_sizes => [creative_placeholder]}
60
66
  end
61
67
 
62
68
  # Create the ad units on the server.
@@ -17,19 +17,19 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
  #
20
- # This example creates new ad units under a the effective root ad unit. To
21
- # determine which ad units exist, run get_inventory_tree.rb or
20
+ # This example creates a new mobile ad unit under a the effective root ad unit.
21
+ # To determine which ad units exist, run get_inventory_tree.rb or
22
22
  # get_all_ad_units.rb.
23
23
  #
24
- # Tags: InventoryService.createAdUnits
24
+ # Mobile features need to be enabled on your account to use mobile targeting.
25
+ #
26
+ # Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork
25
27
 
26
28
  require 'dfp_api'
27
29
 
28
- API_VERSION = :v201103
29
- # Number of ad units to create.
30
- ITEM_COUNT = 5
30
+ API_VERSION = :v201203
31
31
 
32
- def create_ad_units()
32
+ def create_mobile_ad_unit()
33
33
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
34
34
  dfp = DfpApi::Api.new
35
35
 
@@ -47,26 +47,31 @@ def create_ad_units()
47
47
  effective_root_ad_unit_id =
48
48
  network_service.get_current_network[:effective_root_ad_unit_id]
49
49
 
50
- puts "Using effective root ad unit: %d" % effective_root_ad_unit_id
50
+ puts "Using effective root ad unit: %s" % effective_root_ad_unit_id.to_s
51
+
52
+ # Create ad unit size.
53
+ ad_unit_size = {
54
+ :size => {:width => 400, :height => 300, :is_aspect_ratio => false},
55
+ :environment_type => 'BROWSER'
56
+ }
51
57
 
52
- # Create an array to store local ad unit objects.
53
- ad_units = (1..ITEM_COUNT).map do |index|
54
- {:name => "Ad_Unit_%d" % index,
58
+ # Create local ad unit object.
59
+ ad_unit = {
60
+ :name => "Mobile_Ad_Unit_%d" % (Time.new.to_f * 1000).to_i,
55
61
  :parent_id => effective_root_ad_unit_id,
56
- :description => 'Ad unit description.',
62
+ :description => 'Mobile Ad unit description',
57
63
  :target_window => 'BLANK',
64
+ :target_platform => 'MOBILE',
58
65
  # Set the size of possible creatives that can match this ad unit.
59
- :sizes => [{:width => 300, :height => 250, :is_aspect_ratio => false}]}
60
- end
66
+ :ad_unit_sizes => [ad_unit_size]
67
+ }
61
68
 
62
- # Create the ad units on the server.
63
- return_ad_units = inventory_service.create_ad_units(ad_units)
69
+ # Create the ad unit on the server.
70
+ return_ad_unit = inventory_service.create_ad_unit(ad_unit)
64
71
 
65
- if return_ad_units
66
- return_ad_units.each do |ad_unit|
67
- puts "Ad unit with ID: %d, name: %s and status: %s was created." %
68
- [ad_unit[:id], ad_unit[:name], ad_unit[:status]]
69
- end
72
+ if return_ad_unit
73
+ puts "Ad unit with ID: %d, name: %s and status: %s was created." %
74
+ [return_ad_unit[:id], return_ad_unit[:name], return_ad_unit[:status]]
70
75
  else
71
76
  raise 'No ad units were created.'
72
77
  end
@@ -74,7 +79,7 @@ end
74
79
 
75
80
  if __FILE__ == $0
76
81
  begin
77
- create_ad_units()
82
+ create_mobile_ad_unit()
78
83
 
79
84
  # HTTP errors.
80
85
  rescue AdsCommon::Errors::HttpError => e
@@ -17,19 +17,19 @@
17
17
  # See the License for the specific language governing permissions and
18
18
  # limitations under the License.
19
19
  #
20
- # This example creates new ad units under a the effective root ad unit. To
21
- # determine which ad units exist, run get_inventory_tree.rb or
20
+ # This example creates a new video ad unit under a the effective root ad unit.
21
+ # To determine which ad units exist, run get_inventory_tree.rb or
22
22
  # get_all_ad_units.rb.
23
23
  #
24
- # Tags: InventoryService.createAdUnits
24
+ # This feature is only available to DFP premium solution networks.
25
+ #
26
+ # Tags: InventoryService.createAdUnits, NetworkService.getCurrentNetwork
25
27
 
26
28
  require 'dfp_api'
27
29
 
28
- API_VERSION = :v201104
29
- # Number of ad units to create.
30
- ITEM_COUNT = 5
30
+ API_VERSION = :v201203
31
31
 
32
- def create_ad_units()
32
+ def create_video_ad_unit()
33
33
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
34
34
  dfp = DfpApi::Api.new
35
35
 
@@ -47,26 +47,39 @@ def create_ad_units()
47
47
  effective_root_ad_unit_id =
48
48
  network_service.get_current_network[:effective_root_ad_unit_id]
49
49
 
50
- puts "Using effective root ad unit: %d" % effective_root_ad_unit_id
50
+ puts "Using effective root ad unit: %s" % effective_root_ad_unit_id.to_s
51
+
52
+ # Create master ad unit size.
53
+ master_ad_unit_size = {
54
+ :size => {:width => 400, :height => 300, :is_aspect_ratio => false},
55
+ :environment_type => 'VIDEO_PLAYER',
56
+ # Add companions to master ad unit size.
57
+ :companions => [
58
+ {:size => {:width => 300, :height => 250, :is_aspect_ratio => false},
59
+ :environment_type => 'BROWSER'},
60
+ {:size => {:width => 728, :height => 90, :is_aspect_ratio => false},
61
+ :environment_type => 'BROWSER'}
62
+ ]
63
+ }
51
64
 
52
- # Create an array to store local ad unit objects.
53
- ad_units = (1..ITEM_COUNT).map do |index|
54
- {:name => "Ad_Unit_%d" % index,
65
+ # Create local ad unit object.
66
+ ad_unit = {
67
+ :name => "Video_Ad_Unit_%d" % (Time.new.to_f * 1000).to_i,
55
68
  :parent_id => effective_root_ad_unit_id,
56
- :description => 'Ad unit description.',
69
+ :description => 'Video Ad unit description',
57
70
  :target_window => 'BLANK',
71
+ :explicitly_targeted => true,
72
+ :target_platform => 'WEB',
58
73
  # Set the size of possible creatives that can match this ad unit.
59
- :sizes => [{:width => 300, :height => 250, :is_aspect_ratio => false}]}
60
- end
74
+ :ad_unit_sizes => [master_ad_unit_size]
75
+ }
61
76
 
62
- # Create the ad units on the server.
63
- return_ad_units = inventory_service.create_ad_units(ad_units)
77
+ # Create the ad unit on the server.
78
+ return_ad_unit = inventory_service.create_ad_unit(ad_unit)
64
79
 
65
- if return_ad_units
66
- return_ad_units.each do |ad_unit|
67
- puts "Ad unit with ID: %d, name: %s and status: %s was created." %
68
- [ad_unit[:id], ad_unit[:name], ad_unit[:status]]
69
- end
80
+ if return_ad_unit
81
+ puts "Ad unit with ID: %d, name: %s and status: %s was created." %
82
+ [return_ad_unit[:id], return_ad_unit[:name], return_ad_unit[:status]]
70
83
  else
71
84
  raise 'No ad units were created.'
72
85
  end
@@ -74,7 +87,7 @@ end
74
87
 
75
88
  if __FILE__ == $0
76
89
  begin
77
- create_ad_units()
90
+ create_video_ad_unit()
78
91
 
79
92
  # HTTP errors.
80
93
  rescue AdsCommon::Errors::HttpError => e
@@ -25,7 +25,7 @@
25
25
 
26
26
  require 'dfp_api'
27
27
 
28
- API_VERSION = :v201103
28
+ API_VERSION = :v201203
29
29
  PAGE_SIZE = 500
30
30
 
31
31
  def deactivate_ad_units()
@@ -24,7 +24,7 @@
24
24
 
25
25
  require 'dfp_api'
26
26
 
27
- API_VERSION = :v201103
27
+ API_VERSION = :v201203
28
28
 
29
29
  def get_ad_unit()
30
30
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -17,13 +18,13 @@
17
18
  # See the License for the specific language governing permissions and
18
19
  # limitations under the License.
19
20
  #
20
- # This example gets all ad unit sizes in the network.
21
+ # This code example gets all web target platform ad unit sizes.
21
22
  #
22
- # Tags: InventoryService.getAdUnitSizes
23
+ # Tags: InventoryService.getAdUnitSizesByStatement
23
24
 
24
25
  require 'dfp_api'
25
26
 
26
- API_VERSION = :v201107
27
+ API_VERSION = :v201203
27
28
 
28
29
  def get_all_ad_unit_sizes()
29
30
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -36,13 +37,25 @@ def get_all_ad_unit_sizes()
36
37
  # Get the InventoryService.
37
38
  inventory_service = dfp.service(:InventoryService, API_VERSION)
38
39
 
39
- # Get all ad unit sizes.
40
- ad_unit_sizes = inventory_service.get_ad_unit_sizes()
40
+ target_platform = 'WEB'
41
+
42
+ # Create statement object to only select web ad unit sizes.
43
+ statement = {
44
+ :query => 'WHERE targetPlatform = :target_platform',
45
+ :values => [
46
+ {:key => 'target_platform',
47
+ :value => {:value => target_platform,
48
+ :xsi_type => 'TextValue'}}
49
+ ]
50
+ }
51
+
52
+ # Get ad unit sizes by statement.
53
+ ad_unit_sizes = inventory_service.get_ad_unit_sizes_by_statement(statement)
41
54
 
42
55
  if ad_unit_sizes
43
56
  # Print details about each ad unit in results.
44
57
  ad_unit_sizes.each_with_index do |ad_unit_size, index|
45
- puts "%d) Ad unit size %dx%d was found." % [index,
58
+ puts "%d) Web ad unit size of dimensions %d x %d was found." % [index,
46
59
  ad_unit_size[:size][:width], ad_unit_size[:size][:height]]
47
60
  end
48
61
  else
@@ -24,7 +24,7 @@
24
24
 
25
25
  require 'dfp_api'
26
26
 
27
- API_VERSION = :v201104
27
+ API_VERSION = :v201203
28
28
 
29
29
  def get_ad_units_by_statement()
30
30
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -23,7 +23,7 @@
23
23
 
24
24
  require 'dfp_api'
25
25
 
26
- API_VERSION = :v201104
26
+ API_VERSION = :v201203
27
27
  PAGE_SIZE = 500
28
28
 
29
29
  def get_all_ad_units()
@@ -25,7 +25,7 @@
25
25
 
26
26
  require 'dfp_api'
27
27
 
28
- API_VERSION = :v201104
28
+ API_VERSION = :v201203
29
29
 
30
30
  def update_ad_units()
31
31
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -26,7 +27,7 @@
26
27
 
27
28
  require 'dfp_api'
28
29
 
29
- API_VERSION = :v201107
30
+ API_VERSION = :v201203
30
31
  # Number of labels to create.
31
32
  ITEM_COUNT = 5
32
33
 
@@ -43,7 +44,7 @@ def create_labels()
43
44
 
44
45
  # Create an array to store local label objects.
45
46
  labels = (1..ITEM_COUNT).map do |index|
46
- {:name => "Label #%d" % index, :type => 'COMPETITIVE_EXCLUSION'}
47
+ {:name => "Label #%d" % index, :types => ['COMPETITIVE_EXCLUSION']}
47
48
  end
48
49
 
49
50
  # Create the labels on the server.
@@ -51,8 +52,8 @@ def create_labels()
51
52
 
52
53
  if return_labels
53
54
  return_labels.each do |label|
54
- puts "Label with ID: %d, name: %s and type: %s was created." %
55
- [label[:id], label[:name], label[:type]]
55
+ puts "Label with ID: %d, name: '%s' and types: '%s' was created." %
56
+ [label[:id], label[:name], label[:types].join(', ')]
56
57
  end
57
58
  else
58
59
  raise 'No labels were created.'
@@ -26,7 +26,7 @@
26
26
 
27
27
  require 'dfp_api'
28
28
 
29
- API_VERSION = :v201107
29
+ API_VERSION = :v201203
30
30
  PAGE_SIZE = 500
31
31
 
32
32
  def deactivate_labels()
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -25,7 +26,7 @@
25
26
 
26
27
  require 'dfp_api'
27
28
 
28
- API_VERSION = :v201107
29
+ API_VERSION = :v201203
29
30
  PAGE_SIZE = 500
30
31
 
31
32
  def get_all_labels()
@@ -59,8 +60,9 @@ def get_all_labels()
59
60
 
60
61
  # Print details about each label in results page.
61
62
  page[:results].each_with_index do |label, index|
62
- puts "%d) Label ID: %d, name: %s, type: %s." %
63
- [index + start_index, label[:id], label[:name], label[:type]]
63
+ puts "%d) Label ID: %d, name: '%s', types: '%s'." %
64
+ [index + start_index, label[:id], label[:name],
65
+ label[:types].join(', ')]
64
66
  end
65
67
  end
66
68
  end while offset < page[:total_result_set_size]
@@ -1,4 +1,5 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
2
3
  #
3
4
  # Author:: api.dklimkin@gmail.com (Danial Klimkin)
4
5
  #
@@ -26,7 +27,7 @@
26
27
 
27
28
  require 'dfp_api'
28
29
 
29
- API_VERSION = :v201107
30
+ API_VERSION = :v201203
30
31
 
31
32
  def get_label()
32
33
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -46,8 +47,8 @@ def get_label()
46
47
  label = label_service.get_label(label_id)
47
48
 
48
49
  if label
49
- puts "Label with ID: %d, name: %s and type %s was found." %
50
- [label[:id], label[:name], label[:type]]
50
+ puts "Label with ID: %d, name: '%s' and types '%s' was found." %
51
+ [label[:id], label[:name], label[:types].join(', ')]
51
52
  else
52
53
  puts 'No label found for this ID.'
53
54
  end