Example #1
0
        /// <summary>
        /// fetch
        /// </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));
        }
Example #2
0
        /// <summary>
        /// fetch
        /// </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));
        }
Example #3
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIdentity"> The identity </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 pathServiceSid,
                                                                                  string pathIdentity,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new FetchUserOptions(pathServiceSid, pathIdentity);

            return(await FetchAsync(options, client));
        }
Example #4
0
 private static Request BuildFetchRequest(FetchUserOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Notify,
                "/v1/Services/" + options.PathServiceSid + "/Users/" + options.PathIdentity + "",
                client.Region,
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathIdentity"> The identity </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of User </returns>
        public static UserResource Fetch(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null)
        {
            var options = new FetchUserOptions(pathServiceSid, pathIdentity);

            return(Fetch(options, client));
        }