コード例 #1
0
        /// <summary>
        /// Gets all <see cref="SpeedDial"/>s.
        /// </summary>
        /// <returns>Collection of <see cref="SpeedDial"/></returns>
        /// <exception cref="OdorikException">Throws when Odorik.cz refuses to get SpeedDials. See <see cref="OdorikException.MessageCode" /> for details.</exception>
        public async Task <IEnumerable <SpeedDial> > GetSpeedDialsAsync()
        {
            using (var client = new OdorikClient(Credentials))
            {
                var result = await client.GetAsync(null, SpeedDial);

                return(DeserializeResult <IEnumerable <SpeedDial> >(result));
            }
        }
コード例 #2
0
        /// <summary>
        /// Gets <see cref="SentSMS"/>s limited by <paramref name="filter"/>.
        /// </summary>
        /// <param name="filter"><see cref="SMSFilter"/> contains From and To limitation</param>
        /// <returns>Collection of <see cref="SentSMS"/></returns>
        /// <exception cref="OdorikException">Throws when Odorik.cz refuses to get SMSs. See <see cref="OdorikException.MessageCode" /> for details.</exception>
        public async Task <IEnumerable <SentSMS> > GetSentSMSsAsync(SMSFilter filter)
        {
            using (var client = new OdorikClient(Credentials))
            {
                var result = await client.GetAsync(filter, SentSMS);

                return(DeserializeResult <IEnumerable <SentSMS> >(result));
            }
        }
コード例 #3
0
        /// <summary>
        /// Gets actual balance.
        /// </summary>
        /// <returns>Actual account balance.</returns>
        /// <exception cref="OdorikException">Throws when Odorik.cz refuses to get actual account balance. See <see cref="OdorikException.MessageCode" /> for details.</exception>
        public async Task <double> GetBalanceAsync()
        {
            using (var client = new OdorikClient(Credentials))
            {
                var result = await client.GetAsync(null, Credit);

                return(DeserializeResult <double>(result));
            }
        }
コード例 #4
0
        /// <summary>
        /// Gets allowed senders for <see cref="NewSMS.Sender"/>.
        /// </summary>
        /// <returns>Collection of allowed senders.</returns>
        public async Task <IEnumerable <string> > GetAllowedSendersAsync()
        {
            using (var client = new OdorikClient(Credentials))
            {
                var result = await client.GetAsync(null, AllowedSenders);

                return(result.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries));
            }
        }