Ejemplo n.º 1
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));
        }
 private static Request BuildReadRequest(ReadUserBindingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.IpMessaging,
                "/v2/Services/" + options.PathServiceSid + "/Users/" + options.PathUserSid + "/Bindings",
                queryParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathUserSid"> The user_sid </param>
        /// <param name="bindingType"> The binding_type </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 UserBinding </returns>
        public static ResourceSet <UserBindingResource> Read(string pathServiceSid,
                                                             string pathUserSid,
                                                             List <UserBindingResource.BindingTypeEnum> bindingType = null,
                                                             int?pageSize             = null,
                                                             long?limit               = null,
                                                             ITwilioRestClient client = null)
        {
            var options = new ReadUserBindingOptions(pathServiceSid, pathUserSid)
            {
                BindingType = bindingType, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathUserSid"> The user_sid </param>
        /// <param name="bindingType"> The binding_type </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 pathUserSid,
                                                                                                       List <UserBindingResource.BindingTypeEnum> bindingType = null,
                                                                                                       int?pageSize             = null,
                                                                                                       long?limit               = null,
                                                                                                       ITwilioRestClient client = null)
        {
            var options = new ReadUserBindingOptions(pathServiceSid, pathUserSid)
            {
                BindingType = bindingType, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Ejemplo n.º 5
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));
        }