Пример #1
0
        /// <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));
        }
Пример #2
0
        /// <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));
        }
Пример #3
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the resource from </param>
        /// <param name="pathSid"> The unique string that identifies the resource </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 pathServiceSid,
                                                                                     string pathSid,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new FetchChannelOptions(pathServiceSid, pathSid);

            return(await FetchAsync(options, client));
        }
Пример #4
0
 private static Request BuildFetchRequest(FetchChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.IpMessaging,
                "/v2/Services/" + options.PathServiceSid + "/Channels/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Пример #5
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the resource from </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Channel </returns>
        public static ChannelResource Fetch(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchChannelOptions(pathServiceSid, pathSid);

            return(Fetch(options, client));
        }