Exemple #1
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="options"> Read DataSession parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of DataSession </returns>
        public static ResourceSet <DataSessionResource> Read(ReadDataSessionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <DataSessionResource> .FromJson("data_sessions", response.Content);

            return(new ResourceSet <DataSessionResource>(page, options, client));
        }
Exemple #2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathSimSid"> The sim_sid </param>
        /// <param name="end"> The end </param>
        /// <param name="start"> The start </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 DataSession </returns>
        public static ResourceSet <DataSessionResource> Read(string pathSimSid, DateTime?end = null, DateTime?start = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadDataSessionOptions(pathSimSid)
            {
                End = end, Start = start, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Exemple #3
0
 private static Request BuildReadRequest(ReadDataSessionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Wireless,
                "/v1/Sims/" + options.PathSimSid + "/DataSessions",
                queryParams: options.GetParams()
                ));
 }
Exemple #4
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathSimSid"> The sim_sid </param>
        /// <param name="end"> The end </param>
        /// <param name="start"> The start </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 DataSession </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <DataSessionResource> > ReadAsync(string pathSimSid, DateTime?end = null, DateTime?start = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadDataSessionOptions(pathSimSid)
            {
                End = end, Start = start, PageSize = pageSize, Limit = limit
            };

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

            var page = Page <DataSessionResource> .FromJson("data_sessions", response.Content);

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