google-dfp-api 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (448) hide show
  1. data/ChangeLog +7 -0
  2. data/examples/{v201403 → v201502}/activity_group_service/create_activity_groups.rb +1 -1
  3. data/examples/{v201403 → v201502}/activity_group_service/get_active_activity_groups.rb +18 -27
  4. data/examples/{v201403 → v201502}/activity_group_service/get_all_activity_groups.rb +13 -23
  5. data/examples/{v201403 → v201502}/activity_group_service/update_activity_groups.rb +11 -9
  6. data/examples/{v201403 → v201502}/activity_service/create_activities.rb +1 -1
  7. data/examples/{v201403 → v201502}/activity_service/get_active_activities.rb +15 -27
  8. data/examples/{v201403 → v201502}/activity_service/get_all_activities.rb +10 -21
  9. data/examples/{v201403 → v201502}/activity_service/update_activities.rb +9 -7
  10. data/examples/{v201403 → v201502}/audience_segment_service/create_audience_segments.rb +1 -1
  11. data/examples/{v201403 → v201502}/audience_segment_service/get_all_audience_segments.rb +10 -19
  12. data/examples/{v201403 → v201502}/audience_segment_service/get_first_party_audience_segments.rb +14 -21
  13. data/examples/{v201403 → v201502}/audience_segment_service/populate_first_party_audience_segments.rb +16 -14
  14. data/examples/{v201403 → v201502}/audience_segment_service/update_audience_segments.rb +12 -11
  15. data/examples/{v201403 → v201502}/common/error_handling.rb +1 -1
  16. data/examples/{v201403 → v201502}/common/oauth2_jwt_handling.rb +9 -17
  17. data/examples/{v201403 → v201502}/common/setup_oauth2.rb +1 -1
  18. data/examples/{v201403 → v201502}/company_service/create_companies.rb +1 -1
  19. data/examples/{v201403 → v201502}/company_service/get_all_companies.rb +10 -18
  20. data/examples/{v201403 → v201502}/company_service/get_companies_by_statement.rb +21 -16
  21. data/examples/{v201403 → v201502}/company_service/update_companies.rb +13 -10
  22. data/examples/{v201403 → v201502}/contact_service/create_contacts.rb +1 -1
  23. data/examples/{v201403 → v201502}/contact_service/get_all_contacts.rb +11 -19
  24. data/examples/{v201403 → v201502}/contact_service/get_uninvited_contacts.rb +18 -22
  25. data/examples/{v201403 → v201502}/contact_service/update_contacts.rb +9 -7
  26. data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/create_content_metadata_key_hierarchies.rb +1 -1
  27. data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/delete_content_metadata_key_hierarchies.rb +11 -8
  28. data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/get_all_content_metadata_key_hierarchies.rb +8 -18
  29. data/examples/{v201403 → v201502}/content_metadata_key_hierarchy_service/update_content_metadata_key_hierarchies.rb +9 -7
  30. data/examples/{v201403 → v201502}/content_service/get_all_content.rb +9 -18
  31. data/examples/{v201403 → v201502}/content_service/get_content_by_category.rb +18 -28
  32. data/examples/{v201403 → v201502}/creative_service/copy_image_creatives.rb +7 -7
  33. data/examples/{v201403 → v201502}/creative_service/create_creative_from_template.rb +1 -1
  34. data/examples/{v201403 → v201502}/creative_service/create_creatives.rb +1 -1
  35. data/examples/{v201403 → v201502}/creative_service/create_custom_creative.rb +1 -1
  36. data/examples/{v201403 → v201502}/creative_service/get_all_creatives.rb +8 -17
  37. data/examples/{v201403 → v201502}/creative_service/get_creatives_by_statement.rb +18 -13
  38. data/examples/{v201403 → v201502}/creative_service/update_creatives.rb +16 -11
  39. data/examples/{v201403 → v201502}/creative_set_service/associate_creative_set_to_line_item.rb +1 -1
  40. data/examples/{v201403 → v201502}/creative_set_service/create_creative_set.rb +1 -1
  41. data/examples/{v201403 → v201502}/creative_set_service/get_all_creative_sets.rb +9 -17
  42. data/examples/{v201403 → v201502}/creative_set_service/get_creative_sets_by_statement.rb +20 -14
  43. data/examples/{v201403 → v201502}/creative_set_service/update_creative_sets.rb +10 -7
  44. data/examples/{v201403 → v201502}/creative_template_service/get_all_creative_templates.rb +9 -17
  45. data/examples/{v201403/creative_template_service/get_creative_templates_by_statement.rb → v201502/creative_template_service/get_system_defined_creative_templates.rb} +24 -13
  46. data/examples/{v201403 → v201502}/creative_wrapper_service/create_creative_wrappers.rb +1 -1
  47. data/examples/{v201403 → v201502}/creative_wrapper_service/deactivate_creative_wrapper.rb +9 -7
  48. data/examples/{v201403 → v201502}/creative_wrapper_service/get_all_creative_wrappers.rb +10 -18
  49. data/examples/{v201403 → v201502}/creative_wrapper_service/get_creative_wrappers_by_statement.rb +17 -12
  50. data/examples/{v201403 → v201502}/creative_wrapper_service/update_creative_wrappers.rb +10 -7
  51. data/examples/{v201403 → v201502}/custom_field_service/create_custom_field_options.rb +1 -1
  52. data/examples/{v201403 → v201502}/custom_field_service/create_custom_fields.rb +1 -1
  53. data/examples/{v201403 → v201502}/custom_field_service/deactivate_all_line_item_custom_fields.rb +13 -23
  54. data/examples/{v201403 → v201502}/custom_field_service/get_all_custom_fields.rb +11 -19
  55. data/examples/{v201403 → v201502}/custom_field_service/get_all_line_item_custom_fields.rb +19 -14
  56. data/examples/{v201403 → v201502}/custom_field_service/set_line_item_custom_field_value.rb +24 -19
  57. data/examples/{v201403 → v201502}/custom_field_service/update_custom_fields.rb +10 -7
  58. data/examples/{v201403 → v201502}/custom_targeting_service/create_custom_targeting_keys_and_values.rb +1 -1
  59. data/examples/{v201403 → v201502}/custom_targeting_service/delete_custom_targeting_keys.rb +16 -20
  60. data/examples/{v201403 → v201502}/custom_targeting_service/delete_custom_targeting_values.rb +23 -21
  61. data/examples/{v201403 → v201502}/custom_targeting_service/get_all_custom_targeting_keys_and_values.rb +15 -36
  62. data/examples/{v201403 → v201502}/custom_targeting_service/get_custom_targeting_keys_by_statement.rb +20 -16
  63. data/examples/{v201403 → v201502}/custom_targeting_service/get_custom_targeting_values_by_statement.rb +19 -15
  64. data/examples/{v201403 → v201502}/custom_targeting_service/update_custom_targeting_keys.rb +4 -3
  65. data/examples/{v201403 → v201502}/custom_targeting_service/update_custom_targeting_values.rb +34 -30
  66. data/examples/{v201403/forecast_service/get_forecast.rb → v201502/forecast_service/get_availability_forecast.rb} +39 -15
  67. data/examples/{v201403/forecast_service/get_forecast_by_id.rb → v201502/forecast_service/get_availability_forecast_for_line_item.rb} +18 -11
  68. data/examples/v201502/forecast_service/get_delivery_forecast_for_line_items.rb +81 -0
  69. data/examples/{v201403 → v201502}/inventory_service/create_ad_units.rb +1 -1
  70. data/examples/{v201403 → v201502}/inventory_service/create_mobile_ad_unit.rb +1 -1
  71. data/examples/{v201403 → v201502}/inventory_service/create_video_ad_unit.rb +1 -1
  72. data/examples/{v201403 → v201502}/inventory_service/deactivate_ad_units.rb +19 -23
  73. data/examples/{v201403 → v201502}/inventory_service/get_ad_unit_sizes.rb +7 -14
  74. data/examples/{v201403 → v201502}/inventory_service/get_ad_units_by_statement.rb +18 -13
  75. data/examples/{v201403 → v201502}/inventory_service/get_all_ad_units.rb +8 -17
  76. data/examples/{v201403 → v201502}/inventory_service/update_ad_units.rb +23 -11
  77. data/examples/{v201403 → v201502}/label_service/create_labels.rb +1 -1
  78. data/examples/{v201403 → v201502}/label_service/deactivate_labels.rb +15 -22
  79. data/examples/{v201403 → v201502}/label_service/get_all_labels.rb +9 -18
  80. data/examples/{v201403 → v201502}/label_service/get_labels_by_statement.rb +16 -11
  81. data/examples/{v201403 → v201502}/label_service/update_labels.rb +24 -26
  82. data/examples/{v201403 → v201502}/line_item_creative_association_service/create_licas.rb +1 -1
  83. data/examples/{v201403 → v201502}/line_item_creative_association_service/deactivate_licas.rb +15 -24
  84. data/examples/{v201403 → v201502}/line_item_creative_association_service/get_all_licas.rb +8 -17
  85. data/examples/{v201403 → v201502}/line_item_creative_association_service/get_licas_by_statement.rb +10 -8
  86. data/examples/{v201403 → v201502}/line_item_creative_association_service/update_licas.rb +16 -7
  87. data/examples/{v201403 → v201502}/line_item_service/activate_line_items.rb +13 -21
  88. data/examples/{v201403 → v201502}/line_item_service/create_line_items.rb +6 -3
  89. data/examples/{v201403 → v201502}/line_item_service/create_video_line_item.rb +8 -2
  90. data/examples/{v201403 → v201502}/line_item_service/get_all_line_items.rb +9 -17
  91. data/examples/{v201403 → v201502}/line_item_service/get_line_items_by_statement.rb +19 -17
  92. data/examples/{v201403 → v201502}/line_item_service/get_recently_updated_line_items.rb +19 -13
  93. data/examples/{v201403 → v201502}/line_item_service/target_custom_criteria.rb +9 -7
  94. data/examples/{v201403 → v201502}/line_item_service/update_line_items.rb +9 -9
  95. data/examples/{v201403 → v201502}/network_service/get_all_networks.rb +1 -1
  96. data/examples/{v201403 → v201502}/network_service/get_current_network.rb +1 -1
  97. data/examples/{v201403 → v201502}/network_service/make_test_network.rb +1 -1
  98. data/examples/{v201403 → v201502}/order_service/approve_orders.rb +16 -24
  99. data/examples/{v201403 → v201502}/order_service/create_orders.rb +1 -1
  100. data/examples/{v201403 → v201502}/order_service/get_all_orders.rb +8 -17
  101. data/examples/{v201403 → v201502}/order_service/get_orders_by_statement.rb +18 -14
  102. data/examples/{v201403 → v201502}/order_service/update_orders.rb +15 -7
  103. data/examples/{v201403 → v201502}/placement_service/create_placements.rb +4 -2
  104. data/examples/{v201403 → v201502}/placement_service/deactivate_placements.rb +14 -22
  105. data/examples/{v201403 → v201502}/placement_service/get_all_placements.rb +9 -17
  106. data/examples/{v201403 → v201502}/placement_service/get_placements_by_statement.rb +18 -13
  107. data/examples/{v201403 → v201502}/placement_service/update_placements.rb +16 -6
  108. data/examples/{v201403 → v201502}/publisher_query_language_service/fetch_match_tables.rb +8 -11
  109. data/examples/{v201403 → v201502}/publisher_query_language_service/get_all_line_items.rb +8 -9
  110. data/examples/{v201403 → v201502}/publisher_query_language_service/get_geo_targets.rb +10 -10
  111. data/examples/{v201403 → v201502}/publisher_query_language_service/get_line_items_named_like.rb +10 -10
  112. data/examples/{v201403 → v201502}/report_service/display_report.rb +1 -1
  113. data/examples/{v201403 → v201502}/report_service/download_report.rb +1 -1
  114. data/examples/{v201403 → v201502}/report_service/run_delivery_report.rb +1 -1
  115. data/examples/{v201403 → v201502}/report_service/run_inventory_report.rb +4 -4
  116. data/examples/{v201403 → v201502}/report_service/run_reach_report.rb +1 -1
  117. data/examples/{v201403/report_service/run_merged_delivery_report.rb → v201502/report_service/run_report_with_custom_fields.rb} +12 -14
  118. data/examples/{v201403 → v201502}/report_service/run_sales_report.rb +1 -1
  119. data/examples/{v201403 → v201502}/suggested_ad_unit_service/approve_all_suggested_ad_units.rb +25 -21
  120. data/examples/{v201403 → v201502}/suggested_ad_unit_service/get_all_suggested_ad_units.rb +9 -18
  121. data/examples/{v201403 → v201502}/suggested_ad_unit_service/get_suggested_ad_units_by_statement.rb +24 -21
  122. data/examples/{v201403 → v201502}/team_service/create_teams.rb +1 -1
  123. data/examples/{v201403 → v201502}/team_service/get_all_teams.rb +8 -17
  124. data/examples/{v201403 → v201502}/team_service/get_teams_by_statement.rb +15 -11
  125. data/examples/{v201403 → v201502}/team_service/update_teams.rb +4 -3
  126. data/examples/{v201403 → v201502}/user_service/create_users.rb +1 -1
  127. data/examples/{v201403 → v201502}/user_service/deactivate_users.rb +7 -7
  128. data/examples/{v201403 → v201502}/user_service/get_all_roles.rb +1 -1
  129. data/examples/{v201403 → v201502}/user_service/get_all_users.rb +8 -18
  130. data/examples/{v201403 → v201502}/user_service/get_current_user.rb +1 -1
  131. data/examples/{v201403 → v201502}/user_service/get_users_by_statement.rb +17 -12
  132. data/examples/{v201403 → v201502}/user_service/update_users.rb +15 -6
  133. data/examples/{v201403 → v201502}/user_team_association_service/create_user_team_associations.rb +1 -1
  134. data/examples/{v201403 → v201502}/user_team_association_service/delete_user_team_associations.rb +13 -21
  135. data/examples/{v201403 → v201502}/user_team_association_service/get_all_user_team_associations.rb +10 -17
  136. data/examples/{v201403 → v201502}/user_team_association_service/get_user_team_associations_by_statement.rb +20 -16
  137. data/examples/{v201403 → v201502}/user_team_association_service/update_user_team_associations.rb +8 -7
  138. data/lib/dfp_api.rb +0 -10
  139. data/lib/dfp_api/api_config.rb +22 -67
  140. data/lib/dfp_api/{v201308 → v201502}/activity_group_service.rb +6 -18
  141. data/lib/dfp_api/v201502/activity_group_service_registry.rb +45 -0
  142. data/lib/dfp_api/{v201311 → v201502}/activity_service.rb +6 -18
  143. data/lib/dfp_api/v201502/activity_service_registry.rb +45 -0
  144. data/lib/dfp_api/v201502/ad_exclusion_rule_service.rb +46 -0
  145. data/lib/dfp_api/v201502/ad_exclusion_rule_service_registry.rb +45 -0
  146. data/lib/dfp_api/{v201308 → v201502}/ad_rule_service.rb +6 -18
  147. data/lib/dfp_api/v201502/ad_rule_service_registry.rb +45 -0
  148. data/lib/dfp_api/{v201311 → v201502}/audience_segment_service.rb +6 -6
  149. data/lib/dfp_api/v201502/audience_segment_service_registry.rb +45 -0
  150. data/lib/dfp_api/{v201308 → v201502}/base_rate_service.rb +6 -18
  151. data/lib/dfp_api/v201502/base_rate_service_registry.rb +45 -0
  152. data/lib/dfp_api/{v201311 → v201502}/company_service.rb +6 -18
  153. data/lib/dfp_api/v201502/company_service_registry.rb +45 -0
  154. data/lib/dfp_api/{v201311 → v201502}/contact_service.rb +6 -18
  155. data/lib/dfp_api/v201502/contact_service_registry.rb +45 -0
  156. data/lib/dfp_api/{v201311 → v201502}/content_bundle_service.rb +6 -18
  157. data/lib/dfp_api/v201502/content_bundle_service_registry.rb +45 -0
  158. data/lib/dfp_api/v201502/content_metadata_key_hierarchy_service.rb +46 -0
  159. data/lib/dfp_api/v201502/content_metadata_key_hierarchy_service_registry.rb +45 -0
  160. data/lib/dfp_api/{v201308 → v201502}/content_service.rb +6 -6
  161. data/lib/dfp_api/v201502/content_service_registry.rb +45 -0
  162. data/lib/dfp_api/{v201311 → v201502}/creative_service.rb +6 -18
  163. data/lib/dfp_api/v201502/creative_service_registry.rb +45 -0
  164. data/lib/dfp_api/{v201311 → v201502}/creative_set_service.rb +6 -10
  165. data/lib/dfp_api/v201502/creative_set_service_registry.rb +45 -0
  166. data/lib/dfp_api/{v201306 → v201502}/creative_template_service.rb +6 -10
  167. data/lib/dfp_api/v201502/creative_template_service_registry.rb +45 -0
  168. data/lib/dfp_api/{v201311 → v201502}/creative_wrapper_service.rb +6 -18
  169. data/lib/dfp_api/v201502/creative_wrapper_service_registry.rb +45 -0
  170. data/lib/dfp_api/{v201308 → v201502}/custom_field_service.rb +6 -26
  171. data/lib/dfp_api/v201502/custom_field_service_registry.rb +45 -0
  172. data/lib/dfp_api/{v201306 → v201502}/custom_targeting_service.rb +6 -6
  173. data/lib/dfp_api/v201502/custom_targeting_service_registry.rb +45 -0
  174. data/lib/dfp_api/{v201311 → v201502}/exchange_rate_service.rb +6 -10
  175. data/lib/dfp_api/v201502/exchange_rate_service_registry.rb +45 -0
  176. data/lib/dfp_api/v201502/forecast_service.rb +46 -0
  177. data/lib/dfp_api/v201502/forecast_service_registry.rb +45 -0
  178. data/lib/dfp_api/{v201308 → v201502}/inventory_service.rb +6 -18
  179. data/lib/dfp_api/v201502/inventory_service_registry.rb +45 -0
  180. data/lib/dfp_api/{v201311 → v201502}/label_service.rb +6 -18
  181. data/lib/dfp_api/v201502/label_service_registry.rb +45 -0
  182. data/lib/dfp_api/{v201308 → v201502}/line_item_creative_association_service.rb +6 -18
  183. data/lib/dfp_api/v201502/line_item_creative_association_service_registry.rb +45 -0
  184. data/lib/dfp_api/{v201306 → v201502}/line_item_service.rb +6 -18
  185. data/lib/dfp_api/v201502/line_item_service_registry.rb +45 -0
  186. data/lib/dfp_api/{v201306 → v201502}/line_item_template_service.rb +6 -6
  187. data/lib/dfp_api/v201502/line_item_template_service_registry.rb +45 -0
  188. data/lib/dfp_api/v201502/live_stream_event_service.rb +46 -0
  189. data/lib/dfp_api/v201502/live_stream_event_service_registry.rb +45 -0
  190. data/lib/dfp_api/{v201308 → v201502}/network_service.rb +6 -6
  191. data/lib/dfp_api/v201502/network_service_registry.rb +45 -0
  192. data/lib/dfp_api/{v201306 → v201502}/order_service.rb +6 -18
  193. data/lib/dfp_api/v201502/order_service_registry.rb +45 -0
  194. data/lib/dfp_api/v201502/package_service.rb +46 -0
  195. data/lib/dfp_api/v201502/package_service_registry.rb +45 -0
  196. data/lib/dfp_api/{v201308 → v201502}/placement_service.rb +6 -18
  197. data/lib/dfp_api/v201502/placement_service_registry.rb +45 -0
  198. data/lib/dfp_api/v201502/premium_rate_service.rb +42 -0
  199. data/lib/dfp_api/v201502/premium_rate_service_registry.rb +45 -0
  200. data/lib/dfp_api/v201502/product_package_item_service.rb +46 -0
  201. data/lib/dfp_api/v201502/product_package_item_service_registry.rb +45 -0
  202. data/lib/dfp_api/v201502/product_package_service.rb +46 -0
  203. data/lib/dfp_api/v201502/product_package_service_registry.rb +45 -0
  204. data/lib/dfp_api/{v201306 → v201502}/product_service.rb +6 -14
  205. data/lib/dfp_api/v201502/product_service_registry.rb +45 -0
  206. data/lib/dfp_api/{v201311 → v201502}/product_template_service.rb +6 -18
  207. data/lib/dfp_api/v201502/product_template_service_registry.rb +45 -0
  208. data/lib/dfp_api/{v201306 → v201502}/proposal_line_item_service.rb +6 -18
  209. data/lib/dfp_api/v201502/proposal_line_item_service_registry.rb +45 -0
  210. data/lib/dfp_api/{v201308 → v201502}/proposal_service.rb +6 -18
  211. data/lib/dfp_api/v201502/proposal_service_registry.rb +45 -0
  212. data/lib/dfp_api/{v201306 → v201502}/publisher_query_language_service.rb +6 -6
  213. data/lib/dfp_api/v201502/publisher_query_language_service_registry.rb +45 -0
  214. data/lib/dfp_api/{v201308 → v201502}/rate_card_service.rb +6 -18
  215. data/lib/dfp_api/v201502/rate_card_service_registry.rb +45 -0
  216. data/lib/dfp_api/{v201306 → v201502}/reconciliation_order_report_service.rb +6 -10
  217. data/lib/dfp_api/v201502/reconciliation_order_report_service_registry.rb +45 -0
  218. data/lib/dfp_api/{v201308 → v201502}/reconciliation_report_row_service.rb +6 -6
  219. data/lib/dfp_api/v201502/reconciliation_report_row_service_registry.rb +45 -0
  220. data/lib/dfp_api/{v201306 → v201502}/reconciliation_report_service.rb +6 -14
  221. data/lib/dfp_api/v201502/reconciliation_report_service_registry.rb +45 -0
  222. data/lib/dfp_api/{v201311 → v201502}/report_service.rb +6 -6
  223. data/lib/dfp_api/v201502/report_service_registry.rb +45 -0
  224. data/lib/dfp_api/v201502/shared_ad_unit_service.rb +38 -0
  225. data/lib/dfp_api/v201502/shared_ad_unit_service_registry.rb +45 -0
  226. data/lib/dfp_api/{v201311 → v201502}/suggested_ad_unit_service.rb +6 -10
  227. data/lib/dfp_api/v201502/suggested_ad_unit_service_registry.rb +45 -0
  228. data/lib/dfp_api/{v201311 → v201502}/team_service.rb +6 -18
  229. data/lib/dfp_api/v201502/team_service_registry.rb +45 -0
  230. data/lib/dfp_api/{v201308 → v201502}/user_service.rb +6 -18
  231. data/lib/dfp_api/v201502/user_service_registry.rb +45 -0
  232. data/lib/dfp_api/{v201311 → v201502}/user_team_association_service.rb +6 -18
  233. data/lib/dfp_api/v201502/user_team_association_service_registry.rb +45 -0
  234. data/lib/dfp_api/{v201311 → v201502}/workflow_request_service.rb +6 -6
  235. data/lib/dfp_api/v201502/workflow_request_service_registry.rb +45 -0
  236. data/lib/dfp_api/version.rb +1 -1
  237. metadata +909 -1057
  238. checksums.yaml +0 -15
  239. data/examples/v201403/creative_template_service/get_creative_template.rb +0 -74
  240. data/examples/v201403/line_item_service/create_mobile_line_item.rb +0 -135
  241. data/examples/v201403/report_service/run_report_with_custom_fields.rb +0 -135
  242. data/examples/v201403/suggested_ad_unit_service/get_suggested_ad_unit.rb +0 -75
  243. data/lib/dfp_api/client_login_header_handler.rb +0 -52
  244. data/lib/dfp_api/v201306/activity_group_service.rb +0 -54
  245. data/lib/dfp_api/v201306/activity_group_service_registry.rb +0 -46
  246. data/lib/dfp_api/v201306/activity_service.rb +0 -54
  247. data/lib/dfp_api/v201306/activity_service_registry.rb +0 -46
  248. data/lib/dfp_api/v201306/ad_rule_service.rb +0 -58
  249. data/lib/dfp_api/v201306/ad_rule_service_registry.rb +0 -46
  250. data/lib/dfp_api/v201306/audience_segment_service.rb +0 -34
  251. data/lib/dfp_api/v201306/audience_segment_service_registry.rb +0 -46
  252. data/lib/dfp_api/v201306/base_rate_service.rb +0 -58
  253. data/lib/dfp_api/v201306/base_rate_service_registry.rb +0 -46
  254. data/lib/dfp_api/v201306/company_service.rb +0 -54
  255. data/lib/dfp_api/v201306/company_service_registry.rb +0 -46
  256. data/lib/dfp_api/v201306/contact_service.rb +0 -54
  257. data/lib/dfp_api/v201306/contact_service_registry.rb +0 -46
  258. data/lib/dfp_api/v201306/content_bundle_service.rb +0 -58
  259. data/lib/dfp_api/v201306/content_bundle_service_registry.rb +0 -46
  260. data/lib/dfp_api/v201306/content_service.rb +0 -38
  261. data/lib/dfp_api/v201306/content_service_registry.rb +0 -46
  262. data/lib/dfp_api/v201306/creative_service.rb +0 -54
  263. data/lib/dfp_api/v201306/creative_service_registry.rb +0 -46
  264. data/lib/dfp_api/v201306/creative_set_service.rb +0 -46
  265. data/lib/dfp_api/v201306/creative_set_service_registry.rb +0 -46
  266. data/lib/dfp_api/v201306/creative_template_service_registry.rb +0 -46
  267. data/lib/dfp_api/v201306/creative_wrapper_service.rb +0 -58
  268. data/lib/dfp_api/v201306/creative_wrapper_service_registry.rb +0 -46
  269. data/lib/dfp_api/v201306/custom_field_service.rb +0 -78
  270. data/lib/dfp_api/v201306/custom_field_service_registry.rb +0 -46
  271. data/lib/dfp_api/v201306/custom_targeting_service_registry.rb +0 -46
  272. data/lib/dfp_api/v201306/forecast_service.rb +0 -38
  273. data/lib/dfp_api/v201306/forecast_service_registry.rb +0 -46
  274. data/lib/dfp_api/v201306/inventory_service.rb +0 -62
  275. data/lib/dfp_api/v201306/inventory_service_registry.rb +0 -46
  276. data/lib/dfp_api/v201306/label_service.rb +0 -58
  277. data/lib/dfp_api/v201306/label_service_registry.rb +0 -46
  278. data/lib/dfp_api/v201306/line_item_creative_association_service.rb +0 -62
  279. data/lib/dfp_api/v201306/line_item_creative_association_service_registry.rb +0 -46
  280. data/lib/dfp_api/v201306/line_item_service_registry.rb +0 -46
  281. data/lib/dfp_api/v201306/line_item_template_service_registry.rb +0 -46
  282. data/lib/dfp_api/v201306/network_service.rb +0 -46
  283. data/lib/dfp_api/v201306/network_service_registry.rb +0 -46
  284. data/lib/dfp_api/v201306/order_service_registry.rb +0 -46
  285. data/lib/dfp_api/v201306/placement_service.rb +0 -58
  286. data/lib/dfp_api/v201306/placement_service_registry.rb +0 -46
  287. data/lib/dfp_api/v201306/product_service_registry.rb +0 -46
  288. data/lib/dfp_api/v201306/product_template_service.rb +0 -58
  289. data/lib/dfp_api/v201306/product_template_service_registry.rb +0 -46
  290. data/lib/dfp_api/v201306/proposal_line_item_service_registry.rb +0 -46
  291. data/lib/dfp_api/v201306/proposal_service.rb +0 -58
  292. data/lib/dfp_api/v201306/proposal_service_registry.rb +0 -46
  293. data/lib/dfp_api/v201306/publisher_query_language_service_registry.rb +0 -46
  294. data/lib/dfp_api/v201306/rate_card_customization_service.rb +0 -58
  295. data/lib/dfp_api/v201306/rate_card_customization_service_registry.rb +0 -46
  296. data/lib/dfp_api/v201306/rate_card_service.rb +0 -58
  297. data/lib/dfp_api/v201306/rate_card_service_registry.rb +0 -46
  298. data/lib/dfp_api/v201306/reconciliation_order_report_service_registry.rb +0 -46
  299. data/lib/dfp_api/v201306/reconciliation_report_row_service.rb +0 -38
  300. data/lib/dfp_api/v201306/reconciliation_report_row_service_registry.rb +0 -46
  301. data/lib/dfp_api/v201306/reconciliation_report_service_registry.rb +0 -46
  302. data/lib/dfp_api/v201306/report_service.rb +0 -46
  303. data/lib/dfp_api/v201306/report_service_registry.rb +0 -46
  304. data/lib/dfp_api/v201306/suggested_ad_unit_service.rb +0 -42
  305. data/lib/dfp_api/v201306/suggested_ad_unit_service_registry.rb +0 -46
  306. data/lib/dfp_api/v201306/team_service.rb +0 -54
  307. data/lib/dfp_api/v201306/team_service_registry.rb +0 -46
  308. data/lib/dfp_api/v201306/user_service.rb +0 -66
  309. data/lib/dfp_api/v201306/user_service_registry.rb +0 -46
  310. data/lib/dfp_api/v201306/user_team_association_service.rb +0 -58
  311. data/lib/dfp_api/v201306/user_team_association_service_registry.rb +0 -46
  312. data/lib/dfp_api/v201306/workflow_action_service.rb +0 -38
  313. data/lib/dfp_api/v201306/workflow_action_service_registry.rb +0 -46
  314. data/lib/dfp_api/v201308/activity_group_service_registry.rb +0 -46
  315. data/lib/dfp_api/v201308/activity_service.rb +0 -54
  316. data/lib/dfp_api/v201308/activity_service_registry.rb +0 -46
  317. data/lib/dfp_api/v201308/ad_rule_service_registry.rb +0 -46
  318. data/lib/dfp_api/v201308/audience_segment_service.rb +0 -46
  319. data/lib/dfp_api/v201308/audience_segment_service_registry.rb +0 -46
  320. data/lib/dfp_api/v201308/base_rate_service_registry.rb +0 -46
  321. data/lib/dfp_api/v201308/company_service.rb +0 -54
  322. data/lib/dfp_api/v201308/company_service_registry.rb +0 -46
  323. data/lib/dfp_api/v201308/contact_service.rb +0 -54
  324. data/lib/dfp_api/v201308/contact_service_registry.rb +0 -46
  325. data/lib/dfp_api/v201308/content_bundle_service.rb +0 -58
  326. data/lib/dfp_api/v201308/content_bundle_service_registry.rb +0 -46
  327. data/lib/dfp_api/v201308/content_service_registry.rb +0 -46
  328. data/lib/dfp_api/v201308/creative_service.rb +0 -54
  329. data/lib/dfp_api/v201308/creative_service_registry.rb +0 -46
  330. data/lib/dfp_api/v201308/creative_set_service.rb +0 -46
  331. data/lib/dfp_api/v201308/creative_set_service_registry.rb +0 -46
  332. data/lib/dfp_api/v201308/creative_template_service.rb +0 -38
  333. data/lib/dfp_api/v201308/creative_template_service_registry.rb +0 -46
  334. data/lib/dfp_api/v201308/creative_wrapper_service.rb +0 -58
  335. data/lib/dfp_api/v201308/creative_wrapper_service_registry.rb +0 -46
  336. data/lib/dfp_api/v201308/custom_field_service_registry.rb +0 -46
  337. data/lib/dfp_api/v201308/custom_targeting_service.rb +0 -62
  338. data/lib/dfp_api/v201308/custom_targeting_service_registry.rb +0 -46
  339. data/lib/dfp_api/v201308/forecast_service.rb +0 -38
  340. data/lib/dfp_api/v201308/forecast_service_registry.rb +0 -46
  341. data/lib/dfp_api/v201308/inventory_service_registry.rb +0 -46
  342. data/lib/dfp_api/v201308/label_service.rb +0 -58
  343. data/lib/dfp_api/v201308/label_service_registry.rb +0 -46
  344. data/lib/dfp_api/v201308/line_item_creative_association_service_registry.rb +0 -46
  345. data/lib/dfp_api/v201308/line_item_service.rb +0 -58
  346. data/lib/dfp_api/v201308/line_item_service_registry.rb +0 -46
  347. data/lib/dfp_api/v201308/line_item_template_service.rb +0 -34
  348. data/lib/dfp_api/v201308/line_item_template_service_registry.rb +0 -46
  349. data/lib/dfp_api/v201308/network_service_registry.rb +0 -46
  350. data/lib/dfp_api/v201308/order_service.rb +0 -58
  351. data/lib/dfp_api/v201308/order_service_registry.rb +0 -46
  352. data/lib/dfp_api/v201308/placement_service_registry.rb +0 -46
  353. data/lib/dfp_api/v201308/product_service.rb +0 -50
  354. data/lib/dfp_api/v201308/product_service_registry.rb +0 -46
  355. data/lib/dfp_api/v201308/product_template_service.rb +0 -58
  356. data/lib/dfp_api/v201308/product_template_service_registry.rb +0 -46
  357. data/lib/dfp_api/v201308/proposal_line_item_service.rb +0 -58
  358. data/lib/dfp_api/v201308/proposal_line_item_service_registry.rb +0 -46
  359. data/lib/dfp_api/v201308/proposal_service_registry.rb +0 -46
  360. data/lib/dfp_api/v201308/publisher_query_language_service.rb +0 -34
  361. data/lib/dfp_api/v201308/publisher_query_language_service_registry.rb +0 -46
  362. data/lib/dfp_api/v201308/rate_card_customization_service.rb +0 -58
  363. data/lib/dfp_api/v201308/rate_card_customization_service_registry.rb +0 -46
  364. data/lib/dfp_api/v201308/rate_card_service_registry.rb +0 -46
  365. data/lib/dfp_api/v201308/reconciliation_order_report_service.rb +0 -42
  366. data/lib/dfp_api/v201308/reconciliation_order_report_service_registry.rb +0 -46
  367. data/lib/dfp_api/v201308/reconciliation_report_row_service_registry.rb +0 -46
  368. data/lib/dfp_api/v201308/reconciliation_report_service.rb +0 -46
  369. data/lib/dfp_api/v201308/reconciliation_report_service_registry.rb +0 -46
  370. data/lib/dfp_api/v201308/report_service.rb +0 -46
  371. data/lib/dfp_api/v201308/report_service_registry.rb +0 -46
  372. data/lib/dfp_api/v201308/suggested_ad_unit_service.rb +0 -42
  373. data/lib/dfp_api/v201308/suggested_ad_unit_service_registry.rb +0 -46
  374. data/lib/dfp_api/v201308/team_service.rb +0 -54
  375. data/lib/dfp_api/v201308/team_service_registry.rb +0 -46
  376. data/lib/dfp_api/v201308/user_service_registry.rb +0 -46
  377. data/lib/dfp_api/v201308/user_team_association_service.rb +0 -58
  378. data/lib/dfp_api/v201308/user_team_association_service_registry.rb +0 -46
  379. data/lib/dfp_api/v201308/workflow_action_service.rb +0 -38
  380. data/lib/dfp_api/v201308/workflow_action_service_registry.rb +0 -46
  381. data/lib/dfp_api/v201311/activity_group_service.rb +0 -54
  382. data/lib/dfp_api/v201311/activity_group_service_registry.rb +0 -46
  383. data/lib/dfp_api/v201311/activity_service_registry.rb +0 -46
  384. data/lib/dfp_api/v201311/ad_rule_service.rb +0 -58
  385. data/lib/dfp_api/v201311/ad_rule_service_registry.rb +0 -46
  386. data/lib/dfp_api/v201311/audience_segment_service_registry.rb +0 -46
  387. data/lib/dfp_api/v201311/base_rate_service.rb +0 -58
  388. data/lib/dfp_api/v201311/base_rate_service_registry.rb +0 -46
  389. data/lib/dfp_api/v201311/company_service_registry.rb +0 -46
  390. data/lib/dfp_api/v201311/contact_service_registry.rb +0 -46
  391. data/lib/dfp_api/v201311/content_bundle_service_registry.rb +0 -46
  392. data/lib/dfp_api/v201311/content_metadata_key_hierarchy_service.rb +0 -34
  393. data/lib/dfp_api/v201311/content_metadata_key_hierarchy_service_registry.rb +0 -46
  394. data/lib/dfp_api/v201311/content_service.rb +0 -38
  395. data/lib/dfp_api/v201311/content_service_registry.rb +0 -46
  396. data/lib/dfp_api/v201311/creative_service_registry.rb +0 -46
  397. data/lib/dfp_api/v201311/creative_set_service_registry.rb +0 -46
  398. data/lib/dfp_api/v201311/creative_template_service.rb +0 -38
  399. data/lib/dfp_api/v201311/creative_template_service_registry.rb +0 -46
  400. data/lib/dfp_api/v201311/creative_wrapper_service_registry.rb +0 -46
  401. data/lib/dfp_api/v201311/custom_field_service.rb +0 -78
  402. data/lib/dfp_api/v201311/custom_field_service_registry.rb +0 -46
  403. data/lib/dfp_api/v201311/custom_targeting_service.rb +0 -62
  404. data/lib/dfp_api/v201311/custom_targeting_service_registry.rb +0 -46
  405. data/lib/dfp_api/v201311/exchange_rate_service_registry.rb +0 -46
  406. data/lib/dfp_api/v201311/forecast_service.rb +0 -38
  407. data/lib/dfp_api/v201311/forecast_service_registry.rb +0 -46
  408. data/lib/dfp_api/v201311/inventory_service.rb +0 -62
  409. data/lib/dfp_api/v201311/inventory_service_registry.rb +0 -46
  410. data/lib/dfp_api/v201311/label_service_registry.rb +0 -46
  411. data/lib/dfp_api/v201311/line_item_creative_association_service.rb +0 -62
  412. data/lib/dfp_api/v201311/line_item_creative_association_service_registry.rb +0 -46
  413. data/lib/dfp_api/v201311/line_item_service.rb +0 -58
  414. data/lib/dfp_api/v201311/line_item_service_registry.rb +0 -46
  415. data/lib/dfp_api/v201311/line_item_template_service.rb +0 -34
  416. data/lib/dfp_api/v201311/line_item_template_service_registry.rb +0 -46
  417. data/lib/dfp_api/v201311/network_service.rb +0 -46
  418. data/lib/dfp_api/v201311/network_service_registry.rb +0 -46
  419. data/lib/dfp_api/v201311/order_service.rb +0 -58
  420. data/lib/dfp_api/v201311/order_service_registry.rb +0 -46
  421. data/lib/dfp_api/v201311/placement_service.rb +0 -58
  422. data/lib/dfp_api/v201311/placement_service_registry.rb +0 -46
  423. data/lib/dfp_api/v201311/product_service.rb +0 -50
  424. data/lib/dfp_api/v201311/product_service_registry.rb +0 -46
  425. data/lib/dfp_api/v201311/product_template_service_registry.rb +0 -46
  426. data/lib/dfp_api/v201311/proposal_line_item_service.rb +0 -58
  427. data/lib/dfp_api/v201311/proposal_line_item_service_registry.rb +0 -46
  428. data/lib/dfp_api/v201311/proposal_service.rb +0 -58
  429. data/lib/dfp_api/v201311/proposal_service_registry.rb +0 -46
  430. data/lib/dfp_api/v201311/publisher_query_language_service.rb +0 -34
  431. data/lib/dfp_api/v201311/publisher_query_language_service_registry.rb +0 -46
  432. data/lib/dfp_api/v201311/rate_card_customization_service.rb +0 -58
  433. data/lib/dfp_api/v201311/rate_card_customization_service_registry.rb +0 -46
  434. data/lib/dfp_api/v201311/rate_card_service.rb +0 -58
  435. data/lib/dfp_api/v201311/rate_card_service_registry.rb +0 -46
  436. data/lib/dfp_api/v201311/reconciliation_order_report_service.rb +0 -42
  437. data/lib/dfp_api/v201311/reconciliation_order_report_service_registry.rb +0 -46
  438. data/lib/dfp_api/v201311/reconciliation_report_row_service.rb +0 -38
  439. data/lib/dfp_api/v201311/reconciliation_report_row_service_registry.rb +0 -46
  440. data/lib/dfp_api/v201311/reconciliation_report_service.rb +0 -46
  441. data/lib/dfp_api/v201311/reconciliation_report_service_registry.rb +0 -46
  442. data/lib/dfp_api/v201311/report_service_registry.rb +0 -46
  443. data/lib/dfp_api/v201311/suggested_ad_unit_service_registry.rb +0 -46
  444. data/lib/dfp_api/v201311/team_service_registry.rb +0 -46
  445. data/lib/dfp_api/v201311/user_service.rb +0 -66
  446. data/lib/dfp_api/v201311/user_service_registry.rb +0 -46
  447. data/lib/dfp_api/v201311/user_team_association_service_registry.rb +0 -46
  448. data/lib/dfp_api/v201311/workflow_request_service_registry.rb +0 -46
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ 0.9.4:
2
+ - Added support for v201502.
3
+ - Removed support for v201311, v201308, and v201306.
4
+ - Removed examples for v201403.
5
+ - Updated ForecastService examples.
6
+ - Added PackageService, ProductPackageService, and ProductPackageItemService.
7
+
1
8
  0.9.3:
2
9
  - Added support and examples for v201411.
3
10
  - Added AdExclusionRuleService and SharedAdUnitService.
@@ -25,7 +25,7 @@
25
25
 
26
26
  require 'dfp_api'
27
27
 
28
- API_VERSION = :v201403
28
+ API_VERSION = :v201502
29
29
 
30
30
  def create_activity_groups()
31
31
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Encoding: utf-8
3
3
  #
4
- # Author:: api.davidtorres@gmail.com (David Torres)
4
+ # Author:: api.nicholaschen@gmail.com (Nicholas Chen)
5
5
  #
6
- # Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
6
+ # Copyright:: Copyright 2014, Google Inc. All Rights Reserved.
7
7
  #
8
8
  # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
9
  # you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
24
24
  # Tags: ActivityGroupService.getActivityGroupsByStatement
25
25
 
26
26
  require 'dfp_api'
27
+ require 'dfp_api_statement'
27
28
 
28
- API_VERSION = :v201403
29
- PAGE_SIZE = 500
29
+ API_VERSION = :v201502
30
30
 
31
31
  def get_active_activity_groups()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -39,38 +39,29 @@ def get_active_activity_groups()
39
39
  # Get the ActivityGroupService.
40
40
  activity_group_service = dfp.service(:ActivityGroupService, API_VERSION)
41
41
 
42
- # Define initial values.
43
- offset = 0
44
- page = {}
42
+ # Create a statement to only select active activity groups.
43
+ statement = DfpApiStatement::FilterStatement.new(
44
+ 'status = :status ORDER BY id ASC',
45
+ [
46
+ {:key => 'status',
47
+ :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}}
48
+ ]
49
+ )
45
50
 
46
51
  begin
47
- # Create statement for one page with current offset.
48
- statement = {
49
- :query => 'WHERE status = :status ORDER BY id LIMIT %d OFFSET %d' %
50
- [PAGE_SIZE, offset],
51
- :values => [
52
- {:key => 'status',
53
- :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}}
54
- ]
55
- }
56
-
57
52
  # Get activity groups by statement.
58
- page = activity_group_service.get_activity_groups_by_statement(statement)
53
+ page = activity_group_service.get_activity_groups_by_statement(
54
+ statement.toStatement())
59
55
 
60
56
  if page[:results]
61
- # Increase query offset by page size.
62
- offset += PAGE_SIZE
63
-
64
- # Get the start index for printout.
65
- start_index = page[:start_index]
66
-
67
- # Print details about each content object in results page.
68
57
  page[:results].each_with_index do |activity_group, index|
69
- puts "%d) Activity group with ID: %d, name: %s." % [index + start_index,
58
+ puts "%d) Activity group with ID: %d, name: %s." % [
59
+ index + statement.offset,
70
60
  activity_group[:id], activity_group[:name]]
71
61
  end
72
62
  end
73
- end while offset < page[:total_result_set_size]
63
+ statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
64
+ end while statement.offset < page[:total_result_set_size]
74
65
 
75
66
  # Print a footer
76
67
  if page.include?(:total_result_set_size)
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Encoding: utf-8
3
3
  #
4
- # Author:: api.davidtorres@gmail.com (David Torres)
4
+ # Author:: Nicholas Chen
5
5
  #
6
- # Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
6
+ # Copyright:: Copyright 2014, Google Inc. All Rights Reserved.
7
7
  #
8
8
  # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
9
  # you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
24
24
  # Tags: ActivityGroupService.getActivityGroupsByStatement
25
25
 
26
26
  require 'dfp_api'
27
+ require 'dfp_api_statement'
27
28
 
28
- API_VERSION = :v201403
29
- PAGE_SIZE = 500
29
+ API_VERSION = :v201502
30
30
 
31
31
  def get_all_activity_groups()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -39,37 +39,27 @@ def get_all_activity_groups()
39
39
  # Get the ActivityGroupService.
40
40
  activity_group_service = dfp.service(:ActivityGroupService, API_VERSION)
41
41
 
42
- # Define initial values.
43
- offset = 0
44
- page = {}
42
+ # Create a statement to select all activity groups.
43
+ statement = DfpApiStatement::FilterStatement.new('ORDER BY id ASC')
45
44
 
46
45
  begin
47
- # Create statement for one page with current offset.
48
- statement = {
49
- :query => 'ORDER BY id LIMIT %d OFFSET %d' % [PAGE_SIZE, offset],
50
- }
51
-
52
46
  # Get activity groups by statement.
53
- page = activity_group_service.get_activity_groups_by_statement(statement)
47
+ page = activity_group_service.get_activity_groups_by_statement(
48
+ statement.toStatement())
54
49
 
55
50
  if page[:results]
56
- # Increase query offset by page size.
57
- offset += PAGE_SIZE
58
-
59
- # Get the start index for printout.
60
- start_index = page[:start_index]
61
-
62
- # Print details about each content object in results page.
63
51
  page[:results].each_with_index do |activity_group, index|
64
- puts "%d) Activity group with ID: %d, name: %s." % [index + start_index,
52
+ puts "%d) Activity group with ID: %d, name: %s." % [
53
+ index + statement.offset,
65
54
  activity_group[:id], activity_group[:name]]
66
55
  end
67
56
  end
68
- end while offset < page[:total_result_set_size]
57
+ statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
58
+ end while statement.offset < page[:total_result_set_size]
69
59
 
70
60
  # Print a footer
71
61
  if page.include?(:total_result_set_size)
72
- puts "Total number of results: %d" % page[:total_result_set_size]
62
+ puts "Total number of results: %d" % page[:total_result_set_sizet]
73
63
  end
74
64
  end
75
65
 
@@ -26,7 +26,7 @@
26
26
 
27
27
  require 'dfp_api'
28
28
 
29
- API_VERSION = :v201403
29
+ API_VERSION = :v201502
30
30
 
31
31
  def update_activity_groups()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -44,15 +44,17 @@ def update_activity_groups()
44
44
  advertiser_company_id = 'INSERT_ADVERTISER_COMPANY_ID_HERE'
45
45
 
46
46
  # Create statement to select a single activity group.
47
- statement = {
48
- :query => 'WHERE id = :id ORDER BY id ASC LIMIT 1',
49
- :values => [
50
- {:key => 'id',
51
- :value => {:value => activity_group_id, :xsi_type => 'NumberValue'}}
52
- ]
53
- }
47
+ statement = DfpApiStatement::FilterStatement.new(
48
+ 'WHERE id = :id ORDER BY id ASC',
49
+ [
50
+ {:key => 'id',
51
+ :value => {:value => activity_group_id, :xsi_type => 'NumberValue'}}
52
+ ],
53
+ 1
54
+ )
54
55
 
55
- page = activity_group_service.get_activity_groups_by_statement(statement)
56
+ page = activity_group_service.get_activity_groups_by_statement(
57
+ statement.toStatement())
56
58
 
57
59
  if page[:results]
58
60
  # Get the activity groups.
@@ -25,7 +25,7 @@
25
25
 
26
26
  require 'dfp_api'
27
27
 
28
- API_VERSION = :v201403
28
+ API_VERSION = :v201502
29
29
 
30
30
  def create_activities()
31
31
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -24,9 +24,9 @@
24
24
  # Tags: ActivityService.getActivitiesByStatement
25
25
 
26
26
  require 'dfp_api'
27
+ require 'dfp_api_statement'
27
28
 
28
- API_VERSION = :v201403
29
- PAGE_SIZE = 500
29
+ API_VERSION = :v201502
30
30
 
31
31
  def get_active_activities()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -39,41 +39,29 @@ def get_active_activities()
39
39
  # Get the ActivityService.
40
40
  activity_service = dfp.service(:ActivityService, API_VERSION)
41
41
 
42
- # Define initial values.
43
- offset = 0
44
- page = {}
42
+ # Create a statement to only select active activities.
43
+ statement = DfpApiStatement::FilterStatement.new(
44
+ 'status = :status ORDER BY id ASC',
45
+ [
46
+ {:key => 'status',
47
+ :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}}
48
+ ]
49
+ )
45
50
 
46
51
  begin
47
- # Create statement for one page with current offset.
48
- statement = {
49
- :query => 'WHERE status = :status ORDER BY id LIMIT %d OFFSET %d' %
50
- [PAGE_SIZE, offset],
51
- :values => [
52
- {
53
- :key => 'status',
54
- :value => {:value => 'ACTIVE', :xsi_type => 'TextValue'}
55
- }
56
- ]
57
- }
58
-
59
52
  # Get activities by statement.
60
- page = activity_service.get_activities_by_statement(statement)
53
+ page = activity_service.get_activities_by_statement(
54
+ statement.toStatement())
61
55
 
62
56
  if page[:results]
63
- # Increase query offset by page size.
64
- offset += PAGE_SIZE
65
-
66
- # Get the start index for printout.
67
- start_index = page[:start_index]
68
-
69
- # Print details about each content object in results page.
70
57
  page[:results].each_with_index do |activity, index|
71
58
  puts "%d) Activity with ID: %d, name: %s, type: %s." %
72
- [index + start_index, activity[:id], activity[:name],
59
+ [index + statement.offset, activity[:id], activity[:name],
73
60
  activity[:type]]
74
61
  end
75
62
  end
76
- end while offset < page[:total_result_set_size]
63
+ statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
64
+ end while statement.offset < page[:total_result_set_size]
77
65
 
78
66
  # Print a footer
79
67
  if page.include?(:total_result_set_size)
@@ -24,9 +24,9 @@
24
24
  # Tags: ActivityService.getActivitiesByStatement
25
25
 
26
26
  require 'dfp_api'
27
+ require 'dfp_api_statement'
27
28
 
28
- API_VERSION = :v201403
29
- PAGE_SIZE = 500
29
+ API_VERSION = :v201502
30
30
 
31
31
  def get_all_activities()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -39,36 +39,25 @@ def get_all_activities()
39
39
  # Get the ActivityService.
40
40
  activity_service = dfp.service(:ActivityService, API_VERSION)
41
41
 
42
- # Define initial values.
43
- offset = 0
44
- page = {}
42
+ # Create a statement to select all activities.
43
+ statement = DfpApiStatement::FilterStatement.new('ORDER BY id ASC')
45
44
 
46
45
  begin
47
- # Update statement for one page with current offset.
48
- statement = {
49
- :query => 'ORDER BY id LIMIT %d OFFSET %d' % [PAGE_SIZE, offset]
50
- }
51
-
52
46
  # Get activities by statement.
53
- page = activity_service.get_activities_by_statement(statement)
47
+ page = activity_service.get_activities_by_statement(
48
+ statement.toStatement())
54
49
 
55
50
  if page[:results]
56
- # Increase query offset by page size.
57
- offset += PAGE_SIZE
58
-
59
- # Get the start index for printout.
60
- start_index = page[:start_index]
61
-
62
- # Print details about each content object in results page.
63
51
  page[:results].each_with_index do |activity, index|
64
52
  puts "%d) Activity with ID: %d, name: %s, type: %s." %
65
- [index + start_index, activity[:id], activity[:name],
53
+ [index + statement.offset, activity[:id], activity[:name],
66
54
  activity[:type]]
67
55
  end
68
56
  end
69
- end while offset < page[:total_result_set_size]
57
+ statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
58
+ end while statement.offset < page[:total_result_set_size]
70
59
 
71
- # Print a footer.
60
+ # Print a footer
72
61
  if page.include?(:total_result_set_size)
73
62
  puts "Total number of results: %d" % page[:total_result_set_size]
74
63
  end
@@ -25,8 +25,9 @@
25
25
  # Tags: ActivityService.updateActivities
26
26
 
27
27
  require 'dfp_api'
28
+ require 'dfp_api_statement'
28
29
 
29
- API_VERSION = :v201403
30
+ API_VERSION = :v201502
30
31
 
31
32
  def update_activities()
32
33
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -43,15 +44,16 @@ def update_activities()
43
44
  activity_id = 'INSERT_ACTIVITY_ID_HERE'
44
45
 
45
46
  # Create statement to select a single activity.
46
- statement = {
47
- :query => 'WHERE id = :id ORDER BY id ASC LIMIT 1',
48
- :values => [
47
+ statement = DfpApiStatement::FilterStatement.new(
48
+ 'WHERE id = :id ORDER BY id ASC',
49
+ [
49
50
  {:key => 'id',
50
51
  :value => {:value => activity_id, :xsi_type => 'NumberValue'}}
51
- ]
52
- }
52
+ ],
53
+ 1
54
+ )
53
55
 
54
- page = activity_service.get_activities_by_statement(statement)
56
+ page = activity_service.get_activities_by_statement(statement.toStatement())
55
57
 
56
58
  if page[:results]
57
59
  # Get the activities.
@@ -25,7 +25,7 @@
25
25
 
26
26
  require 'dfp_api'
27
27
 
28
- API_VERSION = :v201403
28
+ API_VERSION = :v201502
29
29
 
30
30
  def create_audience_segments(custom_targeting_key_id, custom_targeting_value_id)
31
31
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -24,9 +24,9 @@
24
24
  # Tags: AudienceSegmentService.getAudienceSegmentsByStatement
25
25
 
26
26
  require 'dfp_api'
27
+ require 'dfp_api_statement'
27
28
 
28
- API_VERSION = :v201403
29
- PAGE_SIZE = 500
29
+ API_VERSION = :v201502
30
30
 
31
31
  def get_all_audience_segments()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -39,32 +39,23 @@ def get_all_audience_segments()
39
39
  # Get the AudienceSegmentService.
40
40
  audience_segment_service = dfp.service(:AudienceSegmentService, API_VERSION)
41
41
 
42
- # Define initial values.
43
- offset = 0
44
- page = {}
42
+ # Create a statement to select all audience segments.
43
+ statement = DfpApiStatement::FilterStatement.new('ORDER BY id ASC')
45
44
 
46
45
  begin
47
- # Create statement for one page with current offset.
48
- statement = {:query => "LIMIT %d OFFSET %d" % [PAGE_SIZE, offset]}
49
-
50
46
  # Get audience segments by statement.
51
- page =
52
- audience_segment_service.get_audience_segments_by_statement(statement)
47
+ page = audience_segment_service.get_audience_segments_by_statement(
48
+ statement.toStatement())
53
49
 
54
50
  if page[:results]
55
- # Increase query offset by page size.
56
- offset += PAGE_SIZE
57
-
58
- # Get the start index for printout.
59
- start_index = page[:start_index]
60
-
61
- # Print details about each audience segment in results page.
62
51
  page[:results].each_with_index do |segment, index|
63
52
  puts "%d) Audience segment ID: %d, name: '%s' of size %d" %
64
- [index + start_index, segment[:id], segment[:name], segment[:size]]
53
+ [index + statement.offset,
54
+ segment[:id], segment[:name], segment[:size]]
65
55
  end
66
56
  end
67
- end while offset < page[:total_result_set_size]
57
+ statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
58
+ end while statement.offset < page[:total_result_set_size]
68
59
 
69
60
  # Print a footer
70
61
  if page.include?(:total_result_set_size)
@@ -24,9 +24,9 @@
24
24
  # Tags: AudienceSegmentService.getAudienceSegmentsByStatement
25
25
 
26
26
  require 'dfp_api'
27
+ require 'dfp_api_statement'
27
28
 
28
- API_VERSION = :v201403
29
- PAGE_SIZE = 500
29
+ API_VERSION = :v201502
30
30
 
31
31
  def get_first_party_audience_segments()
32
32
  # Get DfpApi instance and load configuration from ~/dfp_api.yml.
@@ -41,34 +41,27 @@ def get_first_party_audience_segments()
41
41
 
42
42
  # Statement parts to help build a statement to select all first party audience
43
43
  # segments.
44
- statement_text = "WHERE type = 'FIRST_PARTY' ORDER BY id LIMIT %d OFFSET %d"
45
-
46
- # Define initial values.
47
- offset = 0
48
- page = {}
44
+ statement = DfpApiStatement::FilterStatement.new(
45
+ 'type = :type ORDER BY id ASC',
46
+ [
47
+ {:key => 'type',
48
+ :value => {:value => 'FIRST_PARTY', :xsi_type => 'TextValue'}}
49
+ ]
50
+ )
49
51
 
50
52
  begin
51
- # Create statement for one page with current offset.
52
- statement = {:query => statement_text % [PAGE_SIZE, offset]}
53
-
54
53
  # Get audience segments by statement.
55
- page =
56
- audience_segment_service.get_audience_segments_by_statement(statement)
54
+ page = audience_segment_service.get_audience_segments_by_statement(
55
+ statement.toStatement())
57
56
 
58
57
  if page[:results]
59
- # Increase query offset by page size.
60
- offset += PAGE_SIZE
61
-
62
- # Get the start index for printout.
63
- start_index = page[:start_index]
64
-
65
- # Print details about each audience segment in results page.
66
58
  page[:results].each_with_index do |segment, index|
67
59
  puts "%d) First party audience segment ID: %d, name: '%s', size %d" %
68
- [index + start_index, segment[:id], segment[:name], segment[:size]]
60
+ [index + statement.offset, segment[:id], segment[:name], segment[:size]]
69
61
  end
70
62
  end
71
- end while offset < page[:total_result_set_size]
63
+ statement.offset += DfpApiStatement::SUGGESTED_PAGE_LIMIT
64
+ end while statement.offset < page[:total_result_set_size]
72
65
 
73
66
  # Print a footer
74
67
  if page.include?(:total_result_set_size)