/// <summary>
        /// Fetch a conversation user from your account's default service
        /// </summary>
        /// <param name="pathSid"> The SID of the User resource to fetch </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 <UserResource> FetchAsync(string pathSid,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new FetchUserOptions(pathSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// Fetch a conversation user from your account's default service
        /// </summary>
        /// <param name="options"> Fetch User parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of User </returns>
        public static UserResource Fetch(FetchUserOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Fetch a conversation user from your account's default service
        /// </summary>
        /// <param name="options"> Fetch 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 <UserResource> FetchAsync(FetchUserOptions options,
                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildFetchRequest(FetchUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Conversations,
                "/v1/Users/" + options.PathSid + "",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
        /// <summary>
        /// Fetch a conversation user from your account's default service
        /// </summary>
        /// <param name="pathSid"> The SID of the User resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of User </returns>
        public static UserResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchUserOptions(pathSid);

            return(Fetch(options, client));
        }