Example #1
0
        /// <summary>
        /// Fetch a specific Call Placement Service (CPS) given a phone number via `X-XCNAM-Sensitive-Phone-Number` header.
        /// </summary>
        /// <param name="options"> Fetch Cps parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Cps </returns>
        public static CpsResource Fetch(FetchCpsOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Fetch a specific Call Placement Service (CPS) given a phone number via `X-XCNAM-Sensitive-Phone-Number` header.
        /// </summary>
        /// <param name="options"> Fetch Cps parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Cps </returns>
        public static async System.Threading.Tasks.Task <CpsResource> FetchAsync(FetchCpsOptions options,
                                                                                 ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #3
0
        /// <summary>
        /// Fetch a specific Call Placement Service (CPS) given a phone number via `X-XCNAM-Sensitive-Phone-Number` header.
        /// </summary>
        /// <param name="xXcnamSensitivePhoneNumber"> Phone number to retrieve CPS. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Cps </returns>
        public static CpsResource Fetch(string xXcnamSensitivePhoneNumber = null, ITwilioRestClient client = null)
        {
            var options = new FetchCpsOptions()
            {
                XXcnamSensitivePhoneNumber = xXcnamSensitivePhoneNumber
            };

            return(Fetch(options, client));
        }
Example #4
0
 private static Request BuildFetchRequest(FetchCpsOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/TrustedComms/CPS",
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// Fetch a specific Call Placement Service (CPS) given a phone number via `X-XCNAM-Sensitive-Phone-Number` header.
        /// </summary>
        /// <param name="xXcnamSensitivePhoneNumber"> Phone number to retrieve CPS. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Cps </returns>
        public static async System.Threading.Tasks.Task <CpsResource> FetchAsync(string xXcnamSensitivePhoneNumber = null,
                                                                                 ITwilioRestClient client          = null)
        {
            var options = new FetchCpsOptions()
            {
                XXcnamSensitivePhoneNumber = xXcnamSensitivePhoneNumber
            };

            return(await FetchAsync(options, client));
        }
Example #6
0
        /// <summary>
        /// Fetch a specific Call Placement Service (CPS) given a phone number via `X-XCNAM-Sensitive-Phone-Number` header.
        /// </summary>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Cps </returns>
        public static async System.Threading.Tasks.Task <CpsResource> FetchAsync(ITwilioRestClient client = null)
        {
            var options = new FetchCpsOptions();

            return(await FetchAsync(options, client));
        }
Example #7
0
        /// <summary>
        /// Fetch a specific Call Placement Service (CPS) given a phone number via `X-XCNAM-Sensitive-Phone-Number` header.
        /// </summary>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Cps </returns>
        public static CpsResource Fetch(ITwilioRestClient client = null)
        {
            var options = new FetchCpsOptions();

            return(Fetch(options, client));
        }