public IAsyncResult BeginGetAdmedia(GetAdmediaRequest GetAdmediaRequest, AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetAdmedia", new object[1] { (object) GetAdmediaRequest }, callback, asyncState); }
public List<admediumItem> GetAdmedia(sessionType session, int? programId, int? adspaceId, int? categoryId, admediaTypeEnum? admediaType, int? format, partnerShipEnum? partnerShip, admediaPurposeEnum? admediaPurpose, string region, int page, int items, out int total) { List<admediumItem> list = new List<admediumItem>(); GetAdmediaRequest GetAdmediaRequest = new GetAdmediaRequest(); GetAdmediaRequest.connectId = session.connectId; if (programId.HasValue) { GetAdmediaRequest.programId = programId.Value; GetAdmediaRequest.programIdSpecified = true; } if (adspaceId.HasValue) { GetAdmediaRequest.adspaceId = adspaceId.Value; GetAdmediaRequest.adspaceIdSpecified = true; } if (categoryId.HasValue) { GetAdmediaRequest.categoryId = categoryId.Value; GetAdmediaRequest.categoryIdSpecified = true; } if (format.HasValue) { GetAdmediaRequest.format = format.Value; GetAdmediaRequest.formatSpecified = true; } if (admediaType.HasValue) { GetAdmediaRequest.admediumType = admediaType.Value; GetAdmediaRequest.admediumTypeSpecified = true; } if (partnerShip.HasValue) { GetAdmediaRequest.partnerShip = partnerShip.Value; GetAdmediaRequest.partnerShipSpecified = true; } if (admediaPurpose.HasValue) { GetAdmediaRequest.purpose = admediaPurpose.Value; GetAdmediaRequest.purposeSpecified = true; } if (!string.IsNullOrEmpty(region)) GetAdmediaRequest.region = region; GetAdmediaRequest.items = items; GetAdmediaRequest.itemsSpecified = true; GetAdmediaRequest.page = page; GetAdmediaRequest.pageSpecified = true; GetAdmediaResponse admedia = this.publisherService.GetAdmedia(GetAdmediaRequest); if (admedia == null) { total = 0; return (List<admediumItem>) null; } else if (admedia.admediumItems == null) { total = 0; return (List<admediumItem>) null; } else { total = (int) admedia.total; return Enumerable.ToList<admediumItem>((IEnumerable<admediumItem>) admedia.admediumItems); } }