Exemplo 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));
        }
Exemplo n.º 2
0
 private static Request BuildReadRequest(ReadUserBindingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Chat,
                "/v2/Services/" + options.PathServiceSid + "/Users/" + options.PathUserSid + "/Bindings",
                queryParams: options.GetParams()
                ));
 }
Exemplo n.º 3
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to read the resource from </param>
        /// <param name="pathUserSid"> The SID of the User with the User Bindings to read </param>
        /// <param name="bindingType"> The push technology used by the User Binding resources to read </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));
        }
Exemplo n.º 4
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to read the resource from </param>
        /// <param name="pathUserSid"> The SID of the User with the User Bindings to read </param>
        /// <param name="bindingType"> The push technology used by the User Binding resources to read </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));
        }
Exemplo 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));
        }