private static Request BuildCreateRequest(CreateDeploymentOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Serverless, "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathEnvironmentSid + "/Deployments", client.Region, postParams: options.GetParams() )); }
/// <summary> /// Create a new deployment. /// </summary> /// <param name="pathServiceSid"> The SID of the Service to create the Deployment resource under </param> /// <param name="pathEnvironmentSid"> The SID of the environment for the deployment </param> /// <param name="buildSid"> The SID of the build for the deployment </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 pathServiceSid, string pathEnvironmentSid, string buildSid = null, ITwilioRestClient client = null) { var options = new CreateDeploymentOptions(pathServiceSid, pathEnvironmentSid) { BuildSid = buildSid }; return(await CreateAsync(options, client)); }
/// <summary> /// Create a new deployment. /// </summary> /// <param name="pathServiceSid"> The SID of the Service to create the Deployment resource under </param> /// <param name="pathEnvironmentSid"> The SID of the environment for the deployment </param> /// <param name="buildSid"> The SID of the build for the deployment </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Deployment </returns> public static DeploymentResource Create(string pathServiceSid, string pathEnvironmentSid, string buildSid = null, ITwilioRestClient client = null) { var options = new CreateDeploymentOptions(pathServiceSid, pathEnvironmentSid) { BuildSid = buildSid }; return(Create(options, client)); }
/// <summary> /// Create a new deployment. /// </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)); }