Ejemplo n.º 1
0
        /// <summary>
        /// Update a specific variable.
        /// </summary>
        /// <param name="options"> Update Variable parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Variable </returns>
        public static VariableResource Update(UpdateVariableOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateVariableOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathEnvironmentSid + "/Variables/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Update a specific variable.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the Variable resource under </param>
        /// <param name="pathEnvironmentSid"> The SID of the environment with the Variable resource to update </param>
        /// <param name="pathSid"> The SID of the Variable resource to update </param>
        /// <param name="key"> A string by which the Variable resource can be referenced </param>
        /// <param name="value"> A string that contains the actual value of the variable </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Variable </returns>
        public static async System.Threading.Tasks.Task <VariableResource> UpdateAsync(string pathServiceSid,
                                                                                       string pathEnvironmentSid,
                                                                                       string pathSid,
                                                                                       string key               = null,
                                                                                       string value             = null,
                                                                                       ITwilioRestClient client = null)
        {
            var options = new UpdateVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid)
            {
                Key = key, Value = value
            };

            return(await UpdateAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Update a specific variable.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the Variable resource under </param>
        /// <param name="pathEnvironmentSid"> The SID of the environment with the Variable resource to update </param>
        /// <param name="pathSid"> The SID of the Variable resource to update </param>
        /// <param name="key"> A string by which the Variable resource can be referenced </param>
        /// <param name="value"> A string that contains the actual value of the variable </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Variable </returns>
        public static VariableResource Update(string pathServiceSid,
                                              string pathEnvironmentSid,
                                              string pathSid,
                                              string key               = null,
                                              string value             = null,
                                              ITwilioRestClient client = null)
        {
            var options = new UpdateVariableOptions(pathServiceSid, pathEnvironmentSid, pathSid)
            {
                Key = key, Value = value
            };

            return(Update(options, client));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Update a specific variable.
        /// </summary>
        /// <param name="options"> Update Variable parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Variable </returns>
        public static async System.Threading.Tasks.Task <VariableResource> UpdateAsync(UpdateVariableOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }