/// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the Flex chat channel resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Channel </returns>
        public static async System.Threading.Tasks.Task <ChannelResource> FetchAsync(string pathSid,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new FetchChannelOptions(pathSid);

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

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch Channel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Channel </returns>
        public static async System.Threading.Tasks.Task <ChannelResource> FetchAsync(FetchChannelOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #4
0
 private static Request BuildFetchRequest(FetchChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.FlexApi,
                "/v1/Channels/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the Flex chat channel resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Channel </returns>
        public static ChannelResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchChannelOptions(pathSid);

            return(Fetch(options, client));
        }