Exemplo n.º 1
0
        /// <summary>
        /// create
        /// </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));
        }
Exemplo n.º 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="shortCodeSid"> The short_code_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 shortCodeSid,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new CreateShortCodeOptions(pathServiceSid, shortCodeSid);

            return(await CreateAsync(options, client));
        }
Exemplo n.º 3
0
 private static Request BuildCreateRequest(CreateShortCodeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Messaging,
                "/v1/Services/" + options.PathServiceSid + "/ShortCodes",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="shortCodeSid"> The short_code_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 shortCodeSid, ITwilioRestClient client = null)
        {
            var options = new CreateShortCodeOptions(pathServiceSid, shortCodeSid);

            return(Create(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// create
        /// </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));
        }