Example #1
0
        /// <summary>
        /// List all Channels for a given User.
        /// </summary>
        /// <param name="options"> Read UserChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserChannel </returns>
        public static ResourceSet <UserChannelResource> Read(ReadUserChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <UserChannelResource> .FromJson("channels", response.Content);

            return(new ResourceSet <UserChannelResource>(page, options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathUserSid"> The user_sid </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 UserChannel </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <UserChannelResource> > ReadAsync(string pathServiceSid, string pathUserSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathUserSid"> The user_sid </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 UserChannel </returns>
        public static ResourceSet <UserChannelResource> Read(string pathServiceSid, string pathUserSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadUserChannelOptions(pathServiceSid, pathUserSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Example #4
0
 private static Request BuildReadRequest(ReadUserChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.IpMessaging,
                "/v1/Services/" + options.PathServiceSid + "/Users/" + options.PathUserSid + "/Channels",
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// List all Channels for a given User.
        /// </summary>
        /// <param name="options"> Read UserChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserChannel </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <UserChannelResource> > ReadAsync(ReadUserChannelOptions options,
                                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <UserChannelResource> .FromJson("channels", response.Content);

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