示例#1
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number via `X-XCNAM-Sensitive-Phone-Number-From` and
        /// `X-XCNAM-Sensitive-Phone-Number-To` headers.
        /// </summary>
        /// <param name="options"> Fetch CurrentCall parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CurrentCall </returns>
        public static CurrentCallResource Fetch(FetchCurrentCallOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
示例#2
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number.
        /// </summary>
        /// <param name="from"> The originating Phone Number </param>
        /// <param name="to"> The terminating Phone Number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CurrentCall </returns>
        public static CurrentCallResource Fetch(string from = null, string to = null, ITwilioRestClient client = null)
        {
            var options = new FetchCurrentCallOptions()
            {
                From = from, To = to
            };

            return(Fetch(options, client));
        }
 private static Request BuildFetchRequest(FetchCurrentCallOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/TrustedComms/CurrentCall",
                queryParams: options.GetParams()
                ));
 }
示例#4
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number.
        /// </summary>
        /// <param name="from"> The originating Phone Number </param>
        /// <param name="to"> The terminating Phone Number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CurrentCall </returns>
        public static async System.Threading.Tasks.Task <CurrentCallResource> FetchAsync(string from = null,
                                                                                         string to   = null,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchCurrentCallOptions()
            {
                From = from, To = to
            };

            return(await FetchAsync(options, client));
        }
示例#5
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number via `X-XCNAM-Sensitive-Phone-Number-From` and
        /// `X-XCNAM-Sensitive-Phone-Number-To` headers.
        /// </summary>
        /// <param name="xXcnamSensitivePhoneNumberFrom"> The originating Phone Number </param>
        /// <param name="xXcnamSensitivePhoneNumberTo"> The terminating Phone Number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CurrentCall </returns>
        public static async System.Threading.Tasks.Task <CurrentCallResource> FetchAsync(string xXcnamSensitivePhoneNumberFrom = null,
                                                                                         string xXcnamSensitivePhoneNumberTo   = null,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchCurrentCallOptions()
            {
                XXcnamSensitivePhoneNumberFrom = xXcnamSensitivePhoneNumberFrom, XXcnamSensitivePhoneNumberTo = xXcnamSensitivePhoneNumberTo
            };

            return(await FetchAsync(options, client));
        }
示例#6
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number via `X-XCNAM-Sensitive-Phone-Number-From` and
        /// `X-XCNAM-Sensitive-Phone-Number-To` headers.
        /// </summary>
        /// <param name="xXcnamSensitivePhoneNumberFrom"> The originating Phone Number </param>
        /// <param name="xXcnamSensitivePhoneNumberTo"> The terminating Phone Number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CurrentCall </returns>
        public static CurrentCallResource Fetch(string xXcnamSensitivePhoneNumberFrom = null,
                                                string xXcnamSensitivePhoneNumberTo   = null,
                                                ITwilioRestClient client = null)
        {
            var options = new FetchCurrentCallOptions()
            {
                XXcnamSensitivePhoneNumberFrom = xXcnamSensitivePhoneNumberFrom, XXcnamSensitivePhoneNumberTo = xXcnamSensitivePhoneNumberTo
            };

            return(Fetch(options, client));
        }
示例#7
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number via `X-XCNAM-Sensitive-Phone-Number-From` and
        /// `X-XCNAM-Sensitive-Phone-Number-To` headers.
        /// </summary>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CurrentCall </returns>
        public static async System.Threading.Tasks.Task <CurrentCallResource> FetchAsync(ITwilioRestClient client = null)
        {
            var options = new FetchCurrentCallOptions();

            return(await FetchAsync(options, client));
        }
示例#8
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number via `X-XCNAM-Sensitive-Phone-Number-From` and
        /// `X-XCNAM-Sensitive-Phone-Number-To` headers.
        /// </summary>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CurrentCall </returns>
        public static CurrentCallResource Fetch(ITwilioRestClient client = null)
        {
            var options = new FetchCurrentCallOptions();

            return(Fetch(options, client));
        }
示例#9
0
        /// <summary>
        /// Retrieve a current call given the originating and terminating number via `X-XCNAM-Sensitive-Phone-Number-From` and
        /// `X-XCNAM-Sensitive-Phone-Number-To` headers.
        /// </summary>
        /// <param name="options"> Fetch CurrentCall parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CurrentCall </returns>
        public static async System.Threading.Tasks.Task <CurrentCallResource> FetchAsync(FetchCurrentCallOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }