Esempio n. 1
0
        /// <summary>
        /// Create a new Fleet for scoping of deployed devices within your account.
        /// </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));
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new Fleet for scoping of deployed devices within your account.
        /// </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));
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new Fleet for scoping of deployed devices within your account.
        /// </summary>
        ///
        /// <param name="friendlyName"> A human readable description for this Fleet. </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 friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new CreateFleetOptions {
                FriendlyName = friendlyName
            };

            return(await CreateAsync(options, client));
        }
Esempio n. 4
0
        /// <summary>
        /// Create a new Fleet for scoping of deployed devices within your account.
        /// </summary>
        ///
        /// <param name="friendlyName"> A human readable description for this Fleet. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Fleet </returns>
        public static FleetResource Create(string friendlyName = null, ITwilioRestClient client = null)
        {
            var options = new CreateFleetOptions {
                FriendlyName = friendlyName
            };

            return(Create(options, client));
        }
 private static Request BuildCreateRequest(CreateFleetOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets",
                postParams: options.GetParams()
                ));
 }