private List <T> GetBannersInternal <T>(int[] campaingIds, int[] bannerIds, PhraseInfoType phraseDetails, BannersFilterInfo filter) where T : BannerInfo { var request = new { CampaignIDS = campaingIds, BannerIDS = bannerIds, GetPhrases = phraseDetails, Filter = filter }; return(YandexApiClient.Invoke <List <T> >(ApiMethod.GetBanners, request)); }
public ClientUnitInfo[] GetClientsUnits(params string[] logins) { if (logins == null || logins.Length == 0) { throw new ArgumentNullException("logins"); } return(YandexApiClient.Invoke <ClientUnitInfo[]>(ApiMethod.GetClientsUnits, logins)); }
public void DeleteForecastReport(int forecastReportId) { var result = YandexApiClient.Invoke <int>(ApiMethod.DeleteForecastReport, forecastReportId); if (result != 1) { throw new YandexDirectException("Method DeleteForecastReport failed."); } }
/* * Not implemented: * - CreateOrUpdateCampaign * - GetBalance * - GetCampaignParams * - GetCampaignsList * - GetCampaignsListFilter * - GetCampaignsParams */ public List <ShortCampaignInfo> GetClientCampaigns(params string[] logins) { if (logins == null || logins.Length == 0) { throw new ArgumentNullException("logins"); } return(YandexApiClient.Invoke <List <ShortCampaignInfo> >(ApiMethod.GetCampaignsList, logins)); }
public int CreateNewForecast(string[] phrases, int[] geoIds = null, int[] categoryIds = null) { if (phrases == null || phrases.Length == 0) { throw new ArgumentNullException("phrases"); } var request = new { Categories = categoryIds, GeoID = geoIds, Phrases = phrases }; return(YandexApiClient.Invoke <int>(ApiMethod.CreateNewForecast, request)); }
public bool UnArchiveBanners(int campaignId, int[] bannerIds) { if (bannerIds == null || bannerIds.Length == 0) { throw new ArgumentNullException("bannerIds"); } var request = new { CampaignID = campaignId, BannerIDS = bannerIds }; return(YandexApiClient.Invoke <int>(ApiMethod.UnArchiveBanners, request) == 1); }
public int CreateNewReport(NewReportInfo reportInfo) { if (reportInfo == null) { throw new ArgumentNullException("reportInfo"); } if (reportInfo.Limit != null && reportInfo.Offset != null) { throw new ArgumentException("Only one of \"Limit\" and \"Offset\" should be set"); } return(YandexApiClient.Invoke <int>(ApiMethod.CreateNewReport, reportInfo)); }
public List <int> CreateOrUpdateBanners(IEnumerable <EditableBannerInfo> banners) { if (banners == null) { throw new ArgumentNullException("banners"); } var bannersArray = banners.ToArray(); if (bannersArray.Contains(null)) { throw new ArgumentNullException("banners", "One of the items is null."); } return(YandexApiClient.Invoke <List <int> >(ApiMethod.CreateOrUpdateBanners, bannersArray)); }
public List <BannerPhraseInfoWithStats> GetBannerPhrasesWithStats(int[] bannerIds, bool considerTimeTarget = false) { if (bannerIds == null || bannerIds.Length == 0) { throw new ArgumentNullException("bannerIds"); } if (bannerIds.Length > 1000) { throw new ArgumentOutOfRangeException("bannerIds", "Maximum allowed number of banner identifiers per call is 1000."); } var request = new { BannerIDS = bannerIds, RequestPrices = YesNo.Yes, ConsiderTimeTarget = (YesNo)considerTimeTarget }; return(YandexApiClient.Invoke <List <BannerPhraseInfoWithStats> >(ApiMethod.GetBannerPhrasesFilter, request)); }
//TODO: Should be renamed to GetClientsList public List <ShortClientInfo> GetClientLogins() { return(YandexApiClient.Invoke <List <ShortClientInfo> >(ApiMethod.GetClientsList)); }
public List <ForecastStatus> GetForecastList() { return(YandexApiClient.Invoke <List <ForecastStatus> >(ApiMethod.GetForecastList)); }
public ForecastInfo GetForecast(int forecastId) { return(YandexApiClient.Invoke <ForecastInfo>(ApiMethod.GetForecast, forecastId)); }
public int PingApi() { return(YandexApiClient.Invoke <int>(ApiMethod.PingAPI)); }
public void TransferMoney(TransferInfo[] from, TransferInfo[] to) { var request = new { FromCampaigns = from, ToCampaigns = to }; YandexApiClient.Invoke <int>(ApiMethod.TransferMoney, request, true); }
public List <GoalInfo> GetStatGoals(int campaignId) { return(YandexApiClient.Invoke <List <GoalInfo> >(ApiMethod.GetStatGoals, new { CampaignID = campaignId })); }
public List <ReportInfo> GetReportList() { return(YandexApiClient.Invoke <List <ReportInfo> >(ApiMethod.GetReportList)); }