/// <summary> /// Lists plannable products for a given location. /// </summary> /// <param name="reachPlanService">Instance of Reach Plan Service client.</param> /// <param name="locationId">Location ID to plan for. To find a valid locaction ID, either /// see https://developers.google.com/adwords/api/docs/appendix/geotargeting or call /// <see cref="ReachPlanServiceClient.ListPlannableLocations"/>.</param> public void ShowPlannableProducts( ReachPlanServiceClient reachPlanService, string locationId) { ListPlannableProductsRequest request = new ListPlannableProductsRequest() { PlannableLocationId = locationId }; ListPlannableProductsResponse response = reachPlanService.ListPlannableProducts( request); Console.WriteLine($"Plannable Products for location {locationId}:"); foreach (ProductMetadata product in response.ProductMetadata) { Console.WriteLine($"{product.PlannableProductCode}:"); Console.WriteLine("Age Ranges:"); foreach (var ageRange in product.PlannableTargeting.AgeRanges) { Console.WriteLine($"\t- {ageRange}"); } Console.WriteLine("Genders:"); foreach (var gender in product.PlannableTargeting.Genders) { Console.WriteLine($"\t- {gender.Type}"); } Console.WriteLine("Devices:"); foreach (var device in product.PlannableTargeting.Devices) { Console.WriteLine($"\t- {device.Type}"); } } }
/// <summary>Snippet for ListPlannableProducts</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void ListPlannableProducts() { // Create client ReachPlanServiceClient reachPlanServiceClient = ReachPlanServiceClient.Create(); // Initialize request argument(s) string plannableLocationId = ""; // Make the request ListPlannableProductsResponse response = reachPlanServiceClient.ListPlannableProducts(plannableLocationId); }
/// <summary>Snippet for ListPlannableProducts</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void ListPlannableProductsRequestObject() { // Create client ReachPlanServiceClient reachPlanServiceClient = ReachPlanServiceClient.Create(); // Initialize request argument(s) ListPlannableProductsRequest request = new ListPlannableProductsRequest { PlannableLocationId = "", }; // Make the request ListPlannableProductsResponse response = reachPlanServiceClient.ListPlannableProducts(request); }