Exemple #1
0
        /// <summary>
        /// Retrieves the timers
        /// </summary>
        /// <param name="properties"> </param>
        /// <param name="limits"> </param>
        /// <returns>KODIRPC.PVR.GetTimersResponse</returns>
        public async Task <KODIRPC.PVR.GetTimersResponse> GetTimers(KODIRPC.PVR.Fields.Timer properties = null, KODIRPC.List.Limits limits = null)
        {
            var jArgs = new JObject();

            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            if (limits != null)
            {
                var jproplimits = JToken.FromObject(limits, _client.Serializer);
                jArgs.Add(new JProperty("limits", jproplimits));
            }
            return(await _client.GetData <KODIRPC.PVR.GetTimersResponse>("PVR.GetTimers", jArgs));
        }
Exemple #2
0
        /// <summary>
        /// Retrieves the details of a specific timer
        /// </summary>
        /// <param name="timerid"> REQUIRED </param>
        /// <param name="properties"> </param>
        /// <returns>KODIRPC.PVR.GetTimerDetailsResponse</returns>
        public async Task <KODIRPC.PVR.GetTimerDetailsResponse> GetTimerDetails(int?timerid = null, KODIRPC.PVR.Fields.Timer properties = null)
        {
            var jArgs = new JObject();

            if (timerid == null)
            {
                throw new global::System.ArgumentException("Parameter cannot be null timerid");
            }
            else
            {
                var jproptimerid = JToken.FromObject(timerid, _client.Serializer);
                jArgs.Add(new JProperty("timerid", jproptimerid));
            }
            if (properties != null)
            {
                var jpropproperties = JToken.FromObject(properties, _client.Serializer);
                jArgs.Add(new JProperty("properties", jpropproperties));
            }
            return(await _client.GetData <KODIRPC.PVR.GetTimerDetailsResponse>("PVR.GetTimerDetails", jArgs));
        }