Example #1
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create FunctionVersion parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FunctionVersion </returns>
        public static FunctionVersionResource Create(CreateFunctionVersionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathFunctionSid"> The function_sid </param>
        /// <param name="path"> The path </param>
        /// <param name="visibility"> The visibility </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of FunctionVersion </returns>
        public static async System.Threading.Tasks.Task <FunctionVersionResource> CreateAsync(string pathServiceSid,
                                                                                              string pathFunctionSid,
                                                                                              string path,
                                                                                              FunctionVersionResource.VisibilityEnum visibility,
                                                                                              ITwilioRestClient client = null)
        {
            var options = new CreateFunctionVersionOptions(pathServiceSid, pathFunctionSid, path, visibility);

            return(await CreateAsync(options, client));
        }
Example #3
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathFunctionSid"> The function_sid </param>
        /// <param name="path"> The path </param>
        /// <param name="visibility"> The visibility </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of FunctionVersion </returns>
        public static FunctionVersionResource Create(string pathServiceSid,
                                                     string pathFunctionSid,
                                                     string path,
                                                     FunctionVersionResource.VisibilityEnum visibility,
                                                     ITwilioRestClient client = null)
        {
            var options = new CreateFunctionVersionOptions(pathServiceSid, pathFunctionSid, path, visibility);

            return(Create(options, client));
        }
Example #4
0
 private static Request BuildCreateRequest(CreateFunctionVersionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Functions/" + options.PathFunctionSid + "/Versions",
                client.Region,
                postParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create FunctionVersion parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of FunctionVersion </returns>
        public static async System.Threading.Tasks.Task <FunctionVersionResource> CreateAsync(CreateFunctionVersionOptions options,
                                                                                              ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }