示例#1
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch UserBinding parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserBinding </returns>
        public static UserBindingResource Fetch(FetchUserBindingOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the resource from </param>
        /// <param name="pathUserSid"> The SID of the User with the binding </param>
        /// <param name="pathSid"> The SID of the User Binding resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserBinding </returns>
        public static async System.Threading.Tasks.Task <UserBindingResource> FetchAsync(string pathServiceSid,
                                                                                         string pathUserSid,
                                                                                         string pathSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchUserBindingOptions(pathServiceSid, pathUserSid, pathSid);

            return(await FetchAsync(options, client));
        }
示例#3
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the resource from </param>
        /// <param name="pathUserSid"> The SID of the User with the binding </param>
        /// <param name="pathSid"> The SID of the User Binding resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserBinding </returns>
        public static UserBindingResource Fetch(string pathServiceSid,
                                                string pathUserSid,
                                                string pathSid,
                                                ITwilioRestClient client = null)
        {
            var options = new FetchUserBindingOptions(pathServiceSid, pathUserSid, pathSid);

            return(Fetch(options, client));
        }
示例#4
0
 private static Request BuildFetchRequest(FetchUserBindingOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Chat,
                "/v2/Services/" + options.PathServiceSid + "/Users/" + options.PathUserSid + "/Bindings/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
示例#5
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch UserBinding parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserBinding </returns>
        public static async System.Threading.Tasks.Task <UserBindingResource> FetchAsync(FetchUserBindingOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }