Пример #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));
        }
Пример #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));
        }
Пример #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()
                ));
 }
Пример #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));
        }
Пример #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));
        }