Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve a list of all conversation users in your service
        /// </summary>
        /// <param name="options"> Read User parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of User </returns>
        public static ResourceSet <UserResource> Read(ReadUserOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <UserResource> .FromJson("users", response.Content);

            return(new ResourceSet <UserResource>(page, options, client));
        }
Ejemplo n.º 2
0
 private static Request BuildReadRequest(ReadUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Conversations,
                "/v1/Services/" + options.PathChatServiceSid + "/Users",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Retrieve a list of all conversation users in your service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service to read the User resources from </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 User </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <UserResource> > ReadAsync(string pathChatServiceSid,
                                                                                                int?pageSize             = null,
                                                                                                long?limit               = null,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new ReadUserOptions(pathChatServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Retrieve a list of all conversation users in your service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Conversation Service to read the User resources from </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 User </returns>
        public static ResourceSet <UserResource> Read(string pathChatServiceSid,
                                                      int?pageSize             = null,
                                                      long?limit               = null,
                                                      ITwilioRestClient client = null)
        {
            var options = new ReadUserOptions(pathChatServiceSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Retrieve a list of all conversation users in your service
        /// </summary>
        /// <param name="options"> Read User parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of User </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <UserResource> > ReadAsync(ReadUserOptions options,
                                                                                                ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <UserResource> .FromJson("users", response.Content);

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