/// <summary> /// update /// </summary> /// <param name="options"> Update Service parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
/// <summary> /// update /// </summary> /// /// <param name="pathSid"> The sid </param> /// <param name="webhookUrl"> The webhook_url </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="reachabilityWebhooksEnabled"> The reachability_webhooks_enabled </param> /// <param name="aclEnabled"> The acl_enabled </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Service </returns> public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid, Uri webhookUrl = null, string friendlyName = null, bool?reachabilityWebhooksEnabled = null, bool?aclEnabled = null, ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid) { WebhookUrl = webhookUrl, FriendlyName = friendlyName, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled }; return(await UpdateAsync(options, client)); }
private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Sync, "/v1/Services/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// update /// </summary> /// /// <param name="pathSid"> The sid </param> /// <param name="webhookUrl"> The webhook_url </param> /// <param name="friendlyName"> The friendly_name </param> /// <param name="reachabilityWebhooksEnabled"> The reachability_webhooks_enabled </param> /// <param name="aclEnabled"> The acl_enabled </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Update(string pathSid, Uri webhookUrl = null, string friendlyName = null, bool?reachabilityWebhooksEnabled = null, bool?aclEnabled = null, ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid) { WebhookUrl = webhookUrl, FriendlyName = friendlyName, ReachabilityWebhooksEnabled = reachabilityWebhooksEnabled, AclEnabled = aclEnabled }; return(Update(options, client)); }
/// <summary> /// update /// </summary> /// <param name="options"> Update Service parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Service </returns> public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }