Esempio n. 1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create AlphaSender parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AlphaSender </returns>
        public static AlphaSenderResource Create(CreateAlphaSenderOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Esempio n. 2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to create the resource under </param>
        /// <param name="alphaSender"> The Alphanumeric Sender ID string </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AlphaSender </returns>
        public static async System.Threading.Tasks.Task <AlphaSenderResource> CreateAsync(string pathServiceSid,
                                                                                          string alphaSender,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateAlphaSenderOptions(pathServiceSid, alphaSender);

            return(await CreateAsync(options, client));
        }
Esempio n. 3
0
 private static Request BuildCreateRequest(CreateAlphaSenderOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Messaging,
                "/v1/Services/" + options.PathServiceSid + "/AlphaSenders",
                postParams: options.GetParams()
                ));
 }
Esempio n. 4
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to create the resource under </param>
        /// <param name="alphaSender"> The Alphanumeric Sender ID string </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AlphaSender </returns>
        public static AlphaSenderResource Create(string pathServiceSid, string alphaSender, ITwilioRestClient client = null)
        {
            var options = new CreateAlphaSenderOptions(pathServiceSid, alphaSender);

            return(Create(options, client));
        }
Esempio n. 5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create AlphaSender parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AlphaSender </returns>
        public static async System.Threading.Tasks.Task <AlphaSenderResource> CreateAsync(CreateAlphaSenderOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }