private static Request BuildCreateRequest(CreateDeploymentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Deployments",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Beispiel #2
0
        /// <summary>
        /// Create a new Deployment in the Fleet, optionally giving it a friendly name and linking to a specific Twilio Sync
        /// service instance.
        /// </summary>
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="friendlyName"> A human readable description for this Deployment. </param>
        /// <param name="syncServiceSid"> The unique identifier of the Sync service instance. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Deployment </returns>
        public static async System.Threading.Tasks.Task <DeploymentResource> CreateAsync(string pathFleetSid,
                                                                                         string friendlyName      = null,
                                                                                         string syncServiceSid    = null,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new CreateDeploymentOptions(pathFleetSid)
            {
                FriendlyName = friendlyName, SyncServiceSid = syncServiceSid
            };

            return(await CreateAsync(options, client));
        }
Beispiel #3
0
        /// <summary>
        /// Create a new Deployment in the Fleet, optionally giving it a friendly name and linking to a specific Twilio Sync
        /// service instance.
        /// </summary>
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="friendlyName"> A human readable description for this Deployment. </param>
        /// <param name="syncServiceSid"> The unique identifier of the Sync service instance. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Deployment </returns>
        public static DeploymentResource Create(string pathFleetSid,
                                                string friendlyName      = null,
                                                string syncServiceSid    = null,
                                                ITwilioRestClient client = null)
        {
            var options = new CreateDeploymentOptions(pathFleetSid)
            {
                FriendlyName = friendlyName, SyncServiceSid = syncServiceSid
            };

            return(Create(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// Create a new Deployment in the Fleet, optionally giving it a friendly name and linking to a specific Twilio Sync
        /// service instance.
        /// </summary>
        /// <param name="options"> Create Deployment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Deployment </returns>
        public static async System.Threading.Tasks.Task <DeploymentResource> CreateAsync(CreateDeploymentOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }