コード例 #1
0
        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));
        }
コード例 #2
0
        public ClientUnitInfo[] GetClientsUnits(params string[] logins)
        {
            if (logins == null || logins.Length == 0)
            {
                throw new ArgumentNullException("logins");
            }

            return(YandexApiClient.Invoke <ClientUnitInfo[]>(ApiMethod.GetClientsUnits, logins));
        }
コード例 #3
0
        public void DeleteForecastReport(int forecastReportId)
        {
            var result = YandexApiClient.Invoke <int>(ApiMethod.DeleteForecastReport, forecastReportId);

            if (result != 1)
            {
                throw new YandexDirectException("Method DeleteForecastReport failed.");
            }
        }
コード例 #4
0
        /*
         * 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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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));
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        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));
        }
コード例 #10
0
 //TODO: Should be renamed to GetClientsList
 public List <ShortClientInfo> GetClientLogins()
 {
     return(YandexApiClient.Invoke <List <ShortClientInfo> >(ApiMethod.GetClientsList));
 }
コード例 #11
0
 public List <ForecastStatus> GetForecastList()
 {
     return(YandexApiClient.Invoke <List <ForecastStatus> >(ApiMethod.GetForecastList));
 }
コード例 #12
0
 public ForecastInfo GetForecast(int forecastId)
 {
     return(YandexApiClient.Invoke <ForecastInfo>(ApiMethod.GetForecast, forecastId));
 }
コード例 #13
0
 public int PingApi()
 {
     return(YandexApiClient.Invoke <int>(ApiMethod.PingAPI));
 }
コード例 #14
0
        public void TransferMoney(TransferInfo[] from, TransferInfo[] to)
        {
            var request = new { FromCampaigns = from, ToCampaigns = to };

            YandexApiClient.Invoke <int>(ApiMethod.TransferMoney, request, true);
        }
コード例 #15
0
 public List <GoalInfo> GetStatGoals(int campaignId)
 {
     return(YandexApiClient.Invoke <List <GoalInfo> >(ApiMethod.GetStatGoals, new { CampaignID = campaignId }));
 }
コード例 #16
0
 public List <ReportInfo> GetReportList()
 {
     return(YandexApiClient.Invoke <List <ReportInfo> >(ApiMethod.GetReportList));
 }