/// <summary>
    /// Run the code example.
    /// </summary>
    /// <param name="user">The Dfa user object running the code example.
    /// </param>
    public override void Run(DfaUser user) {
      // Create SpotlightRemoteService instance.
      SpotlightRemoteService service = (SpotlightRemoteService) user.GetService(
          DfaService.v1_19.SpotlightRemoteService);

      long advertiserId = long.Parse(_T("INSERT_ADVERTISER_ID_HERE"));

      // Set activity group search criteria structure and
      // use advertiser id as search criteria.
      SpotlightActivityGroupSearchCriteria activityGroupSearchCriteria =
          new SpotlightActivityGroupSearchCriteria();
      activityGroupSearchCriteria.advertiserId = advertiserId;

      try {
        // Get activity group.
        SpotlightActivityGroupRecordSet recordSet =
            service.getSpotlightActivityGroups(activityGroupSearchCriteria);

        // Display activity group names and ids.
        if (recordSet.records != null) {
          foreach (SpotlightActivityGroup result in recordSet.records) {
           Console.WriteLine("Activity group with name \"{0}\" and id \"{1}\" was found.",
              result.name, result.id);
          }
        } else {
          Console.WriteLine("No activity groups found for your criteria.");
        }
      } catch (Exception ex) {
        Console.WriteLine("Failed to retrieve activity groups. Exception says \"{0}\"",
            ex.Message);
      }
    }
Example #2
0
 public SpotlightActivityGroupRecordSet getSpotlightActivityGroups(SpotlightActivityGroupSearchCriteria searchCriteria) {
   object[] results = this.Invoke("getSpotlightActivityGroups", new object[] {searchCriteria});
   return ((SpotlightActivityGroupRecordSet) (results[0]));
 }