Beispiel #1
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIdentity"> The identity </param>
        /// <param name="startDate"> The start_date </param>
        /// <param name="endDate"> The end_date </param>
        /// <param name="tag"> The tag </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 UserBinding </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <UserBindingResource> > ReadAsync(string pathServiceSid, string pathIdentity, DateTime?startDate = null, DateTime?endDate = null, List <string> tag = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadUserBindingOptions(pathServiceSid, pathIdentity)
            {
                StartDate = startDate, EndDate = endDate, Tag = tag, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #2
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read UserBinding parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserBinding </returns>
        public static ResourceSet <UserBindingResource> Read(ReadUserBindingOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <UserBindingResource> .FromJson("bindings", response.Content);

            return(new ResourceSet <UserBindingResource>(page, options, client));
        }
Beispiel #3
0
 private static Request BuildReadRequest(ReadUserBindingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Notify,
                "/v1/Services/" + options.PathServiceSid + "/Users/" + options.PathIdentity + "/Bindings",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Beispiel #4
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="options"> Read UserBinding parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserBinding </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <UserBindingResource> > ReadAsync(ReadUserBindingOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <UserBindingResource> .FromJson("bindings", response.Content);

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