Beispiel #1
0
        /// <summary>
        /// Add an existing shortcode to this service to be used as a Proxy Number
        /// </summary>
        /// <param name="options"> Create ShortCode parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ShortCode </returns>
        public static ShortCodeResource Create(CreateShortCodeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
        /// <summary>
        /// Add an existing shortcode to this service to be used as a Proxy Number
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="sid"> Delete by unique shortcode Sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ShortCode </returns>
        public static async System.Threading.Tasks.Task <ShortCodeResource> CreateAsync(string pathServiceSid,
                                                                                        string sid,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new CreateShortCodeOptions(pathServiceSid, sid);

            return(await CreateAsync(options, client));
        }
Beispiel #3
0
 private static Request BuildCreateRequest(CreateShortCodeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/Proxy/Services/" + options.PathServiceSid + "/ShortCodes",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Beispiel #4
0
        /// <summary>
        /// Add an existing shortcode to this service to be used as a Proxy Number
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="sid"> Delete by unique shortcode Sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ShortCode </returns>
        public static ShortCodeResource Create(string pathServiceSid, string sid, ITwilioRestClient client = null)
        {
            var options = new CreateShortCodeOptions(pathServiceSid, sid);

            return(Create(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// Add an existing shortcode to this service to be used as a Proxy Number
        /// </summary>
        /// <param name="options"> Create ShortCode parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ShortCode </returns>
        public static async System.Threading.Tasks.Task <ShortCodeResource> CreateAsync(CreateShortCodeOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }