/// <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 AdvertiserGroupRemoteService instance.
      AdvertiserGroupRemoteService service = (AdvertiserGroupRemoteService) user.GetService(
          DfaService.v1_20.AdvertiserGroupRemoteService);

      String searchString = _T("INSERT_SEARCH_STRING_CRITERIA_HERE");

      // Create advertiser group search criteria structure.
      AdvertiserGroupSearchCriteria advGroupSearchCriteria = new AdvertiserGroupSearchCriteria();
      advGroupSearchCriteria.pageSize = 10;
      advGroupSearchCriteria.searchString = searchString;

      try {
        // Get advertiser group record set.
        AdvertiserGroupRecordSet advertiserGroupRecordSet =
          service.getAdvertiserGroups(advGroupSearchCriteria);

        // Display advertiser group names, ids and advertiser count.
        if (advertiserGroupRecordSet != null && advertiserGroupRecordSet.records != null) {
          foreach (AdvertiserGroup advertiserGroup in advertiserGroupRecordSet.records) {
            Console.WriteLine("Advertiser Group with name \"{0}\", id \"{1}\", containing \"{2}\"" +
                " advertisers was found.", advertiserGroup.name, advertiserGroup.id,
                advertiserGroup.advertiserCount);
          }
        } else {
          Console.WriteLine("No advertiser groups found for your search criteria.");
        }
      } catch (Exception ex) {
        Console.WriteLine("Failed to retrieve advertiser groups. Exception says \"{0}\"",
            ex.Message);
      }
    }
 public AdvertiserGroupRecordSet getAdvertiserGroups(AdvertiserGroupSearchCriteria searchCriteria) {
   object[] results = this.Invoke("getAdvertiserGroups", new object[] {searchCriteria});
   return ((AdvertiserGroupRecordSet) (results[0]));
 }