コード例 #1
0
        /// <summary>
        /// Retrieve a single queue member from Persephony.
        /// </summary>
        /// <param name="queueId">Target queue to retrieve information.</param>
        /// <param name="callId">Optional callId of the queue member to retrieve. If not provided the 'Front' is returned.</param>
        /// <returns>A QueueMember object returned by Persephony that represents the queue member that was retrieved.</returns>
        /// <exception cref="PersyException">Thrown upon failed request.</exception>
        public QueueMember getQueueMember(string queueId, string callId = null)
        {
            string json = base.GET(String.Format("{0}/{1}/Members/{2}", this.path, queueId, ((callId == null) ? "Front" : callId)));

            if (string.IsNullOrEmpty(json) == true)
            {
                throw new PersyException(String.Format("Failed to get queue {0} member", queueId ?? ""));
            }

            return(QueueMember.fromJson(json));
        }
コード例 #2
0
        /// <summary>
        /// Update a single queue member.
        /// </summary>
        /// <param name="queueId">The queueId of the target queueId.</param>
        /// <param name="callId">Optional callId of the queue member to retrieve. If not provided the 'Front' is returned.</param>
        /// <param name="queueMemberOptions">Optional QueueMemberOptions instance to be used when updating a queue member.</param>
        /// <returns>The queue member matching the queueId provided.</returns>
        /// <exception cref="PersyException">Thrown upon failed request.</exception>
        public QueueMember updateQueueMember(string queueId, string callId = null, QueueMemberOptions queueMemberOptions = null)
        {
            string json = base.POST(String.Format("{0}/{1}/Members/{2}", this.path, queueId, ((callId == null) ? "Front" : callId)), ((queueMemberOptions != null) ? queueMemberOptions.toJson() : null));

            if (string.IsNullOrEmpty(json) == true)
            {
                throw new PersyException(String.Format("Failed to update queue {0} member", queueId ?? ""));
            }

            return(QueueMember.fromJson(json));
        }