Ejemplo n.º 1
0
        /// <summary>
        /// Create a new Build. At least one Function Version or Asset Version is required.
        /// </summary>
        /// <param name="options"> Create Build parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Build </returns>
        public static BuildResource Create(CreateBuildOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a new Build. At least one Function Version or Asset Version is required.
        /// </summary>
        /// <param name="options"> Create Build parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Build </returns>
        public static async System.Threading.Tasks.Task <BuildResource> CreateAsync(CreateBuildOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 3
0
 private static Request BuildCreateRequest(CreateBuildOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Builds",
                postParams: options.GetParams()
                ));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a new Build. At least one Function Version or Asset Version is required.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="assetVersions"> List of Asset Version Sids. </param>
        /// <param name="functionVersions"> List of Function Version Sids. </param>
        /// <param name="dependencies"> List of Dependencies. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Build </returns>
        public static async System.Threading.Tasks.Task <BuildResource> CreateAsync(string pathServiceSid,
                                                                                    List <string> assetVersions    = null,
                                                                                    List <string> functionVersions = null,
                                                                                    string dependencies            = null,
                                                                                    ITwilioRestClient client       = null)
        {
            var options = new CreateBuildOptions(pathServiceSid)
            {
                AssetVersions = assetVersions, FunctionVersions = functionVersions, Dependencies = dependencies
            };

            return(await CreateAsync(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new Build. At least one Function Version or Asset Version is required.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="assetVersions"> List of Asset Version Sids. </param>
        /// <param name="functionVersions"> List of Function Version Sids. </param>
        /// <param name="dependencies"> List of Dependencies. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Build </returns>
        public static BuildResource Create(string pathServiceSid,
                                           List <string> assetVersions    = null,
                                           List <string> functionVersions = null,
                                           string dependencies            = null,
                                           ITwilioRestClient client       = null)
        {
            var options = new CreateBuildOptions(pathServiceSid)
            {
                AssetVersions = assetVersions, FunctionVersions = functionVersions, Dependencies = dependencies
            };

            return(Create(options, client));
        }