Пример #1
0
        /// <summary>
        /// Retrieve a list of all conversation users in your account's default 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));
        }
Пример #2
0
 private static Request BuildReadRequest(ReadUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Conversations,
                "/v1/Users",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Пример #3
0
        /// <summary>
        /// Retrieve a list of all conversation users in your account's default service
        /// </summary>
        /// <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(int?pageSize             = null,
                                                                                                long?limit               = null,
                                                                                                ITwilioRestClient client = null)
        {
            var options = new ReadUserOptions()
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Пример #4
0
        /// <summary>
        /// Retrieve a list of all conversation users in your account's default service
        /// </summary>
        /// <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(int?pageSize             = null,
                                                      long?limit               = null,
                                                      ITwilioRestClient client = null)
        {
            var options = new ReadUserOptions()
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Пример #5
0
        /// <summary>
        /// Retrieve a list of all conversation users in your account's default 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));
        }