Пример #1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Message parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Message </returns>
        public static ResourceSet <MessageResource> Read(ReadMessageOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <MessageResource> .FromJson("messages", response.Content);

            return(new ResourceSet <MessageResource>(page, options, client));
        }
Пример #2
0
 private static Request BuildReadRequest(ReadMessageOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Messaging,
                "/v1/Sessions/" + options.PathSessionSid + "/Messages",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Пример #3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathSessionSid"> The unique id of the Session for this message. </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Message </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MessageResource> > ReadAsync(string pathSessionSid,
                                                                                                   int?pageSize             = null,
                                                                                                   long?limit               = null,
                                                                                                   ITwilioRestClient client = null)
        {
            var options = new ReadMessageOptions(pathSessionSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Пример #4
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathSessionSid"> The unique id of the Session for this message. </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Message </returns>
        public static ResourceSet <MessageResource> Read(string pathSessionSid,
                                                         int?pageSize             = null,
                                                         long?limit               = null,
                                                         ITwilioRestClient client = null)
        {
            var options = new ReadMessageOptions(pathSessionSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Пример #5
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read Message parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Message </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MessageResource> > ReadAsync(ReadMessageOptions options,
                                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <MessageResource> .FromJson("messages", response.Content);

            return(new ResourceSet <MessageResource>(page, options, client));
        }