/// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch UserChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserChannel </returns>
        public static UserChannelResource Fetch(FetchUserChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the User Channel resource from </param>
        /// <param name="pathUserSid"> The SID of the User to fetch the User Channel resource from </param>
        /// <param name="pathChannelSid"> The SID of the Channel that has the User Channel to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserChannel </returns>
        public static async System.Threading.Tasks.Task <UserChannelResource> FetchAsync(string pathServiceSid,
                                                                                         string pathUserSid,
                                                                                         string pathChannelSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the User Channel resource from </param>
        /// <param name="pathUserSid"> The SID of the User to fetch the User Channel resource from </param>
        /// <param name="pathChannelSid"> The SID of the Channel that has the User Channel to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserChannel </returns>
        public static UserChannelResource Fetch(string pathServiceSid,
                                                string pathUserSid,
                                                string pathChannelSid,
                                                ITwilioRestClient client = null)
        {
            var options = new FetchUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid);

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

            return(FromJson(response.Content));
        }