Example #1
0
        /// <summary>
        /// Create a Fleet
        /// </summary>
        /// <param name="options"> Create Fleet parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Fleet </returns>
        public static FleetResource Create(CreateFleetOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Create a Fleet
        /// </summary>
        /// <param name="options"> Create Fleet parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Fleet </returns>
        public static async System.Threading.Tasks.Task <FleetResource> CreateAsync(CreateFleetOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #3
0
 private static Request BuildCreateRequest(CreateFleetOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Supersim,
                "/v1/Fleets",
                postParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// Create a Fleet
        /// </summary>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="dataEnabled"> Defines whether SIMs in the Fleet are capable of using data connectivity </param>
        /// <param name="commandsEnabled"> Defines whether SIMs in the Fleet are capable of sending and receiving Commands via
        ///                       SMS </param>
        /// <param name="commandsUrl"> The URL that will receive a webhook when a SIM in the Fleet originates a
        ///                   machine-to-machine Command </param>
        /// <param name="commandsMethod"> A string representing the HTTP method to use when making a request to `commands_url`
        ///                      </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Fleet </returns>
        public static FleetResource Create(string uniqueName    = null,
                                           bool?dataEnabled     = null,
                                           bool?commandsEnabled = null,
                                           Uri commandsUrl      = null,
                                           Twilio.Http.HttpMethod commandsMethod = null,
                                           ITwilioRestClient client = null)
        {
            var options = new CreateFleetOptions()
            {
                UniqueName = uniqueName, DataEnabled = dataEnabled, CommandsEnabled = commandsEnabled, CommandsUrl = commandsUrl, CommandsMethod = commandsMethod
            };

            return(Create(options, client));
        }
Example #5
0
        /// <summary>
        /// Create a Fleet
        /// </summary>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="dataEnabled"> Defines whether SIMs in the Fleet are capable of using data connectivity </param>
        /// <param name="commandsEnabled"> Defines whether SIMs in the Fleet are capable of sending and receiving Commands via
        ///                       SMS </param>
        /// <param name="commandsUrl"> The URL that will receive a webhook when a SIM in the Fleet originates a
        ///                   machine-to-machine Command </param>
        /// <param name="commandsMethod"> A string representing the HTTP method to use when making a request to `commands_url`
        ///                      </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Fleet </returns>
        public static async System.Threading.Tasks.Task <FleetResource> CreateAsync(string uniqueName    = null,
                                                                                    bool?dataEnabled     = null,
                                                                                    bool?commandsEnabled = null,
                                                                                    Uri commandsUrl      = null,
                                                                                    Twilio.Http.HttpMethod commandsMethod = null,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new CreateFleetOptions()
            {
                UniqueName = uniqueName, DataEnabled = dataEnabled, CommandsEnabled = commandsEnabled, CommandsUrl = commandsUrl, CommandsMethod = commandsMethod
            };

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