/// <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 advertiserGroupName = _T("INSERT_ADVERTISER_GROUP_NAME_HERE");

              // Create advertiser group structure.
              AdvertiserGroup advertiserGroup = new AdvertiserGroup();
              advertiserGroup.id = 0;
              advertiserGroup.name = advertiserGroupName;

              try {
            // Create advertiser group.
            AdvertiserGroupSaveResult advertiserGroupSaveResult =
            service.saveAdvertiserGroup(advertiserGroup);

            // Display advertiser group id.
            Console.WriteLine("Advertiser Group with id \"{0}\" was created.",
            advertiserGroupSaveResult.id);

              } catch (Exception e) {
            Console.WriteLine("Failed to create advertiser group. Exception says \"{0}\"",
            e.Message);
              }
        }
Пример #2
0
 public AdvertiserGroupSaveResult saveAdvertiserGroup(AdvertiserGroup advertiserGroup) {
   object[] results = this.Invoke("saveAdvertiserGroup", new object[] {advertiserGroup});
   return ((AdvertiserGroupSaveResult) (results[0]));
 }