コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #5
0
 private static Request BuildCreateRequest(CreateFleetOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets",
                postParams: options.GetParams()
                ));
 }