示例#1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="command"> The command </param>
        /// <param name="sim"> The sim </param>
        /// <param name="callbackMethod"> The callback_method </param>
        /// <param name="callbackUrl"> The callback_url </param>
        /// <param name="commandMode"> The command_mode </param>
        /// <param name="includeSid"> The include_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Command </returns>
        public static CommandResource Create(string command,
                                             string sim = null,
                                             Twilio.Http.HttpMethod callbackMethod = null,
                                             Uri callbackUrl = null,
                                             CommandResource.CommandModeEnum commandMode = null,
                                             string includeSid        = null,
                                             ITwilioRestClient client = null)
        {
            var options = new CreateCommandOptions(command)
            {
                Sim = sim, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, CommandMode = commandMode, IncludeSid = includeSid
            };

            return(Create(options, client));
        }
        /// <summary>
        /// Send a Command to a Sim.
        /// </summary>
        /// <param name="command"> The message body of the Command or a Base64 encoded byte string in binary mode </param>
        /// <param name="sim"> The sid or unique_name of the SIM to send the Command to </param>
        /// <param name="callbackMethod"> The HTTP method we use to call callback_url </param>
        /// <param name="callbackUrl"> he URL we call when the Command has finished sending </param>
        /// <param name="commandMode"> The mode to use when sending the SMS message </param>
        /// <param name="includeSid"> Whether to include the SID of the command in the message body </param>
        /// <param name="deliveryReceiptRequested"> Whether to request delivery receipt from the recipient </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Command </returns>
        public static async System.Threading.Tasks.Task <CommandResource> CreateAsync(string command,
                                                                                      string sim = null,
                                                                                      Twilio.Http.HttpMethod callbackMethod = null,
                                                                                      Uri callbackUrl = null,
                                                                                      CommandResource.CommandModeEnum commandMode = null,
                                                                                      string includeSid             = null,
                                                                                      bool?deliveryReceiptRequested = null,
                                                                                      ITwilioRestClient client      = null)
        {
            var options = new CreateCommandOptions(command)
            {
                Sim = sim, CallbackMethod = callbackMethod, CallbackUrl = callbackUrl, CommandMode = commandMode, IncludeSid = includeSid, DeliveryReceiptRequested = deliveryReceiptRequested
            };

            return(await CreateAsync(options, client));
        }