/// <summary> /// Update a specific Service. /// </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)); }
private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Proxy, "/v1/Services/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// Update a specific Service. /// </summary> /// /// <param name="pathSid"> A string that uniquely identifies this Service. </param> /// <param name="friendlyName"> A human readable description of this resource. </param> /// <param name="defaultTtl"> Default TTL for a Session, in seconds. </param> /// <param name="callbackUrl"> URL Twilio will send callbacks to </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, string friendlyName = null, int?defaultTtl = null, Uri callbackUrl = null, ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid) { FriendlyName = friendlyName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl }; return(await UpdateAsync(options, client)); }
/// <summary> /// Update a specific Service. /// </summary> /// /// <param name="pathSid"> A string that uniquely identifies this Service. </param> /// <param name="friendlyName"> A human readable description of this resource. </param> /// <param name="defaultTtl"> Default TTL for a Session, in seconds. </param> /// <param name="callbackUrl"> URL Twilio will send callbacks to </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Update(string pathSid, string friendlyName = null, int?defaultTtl = null, Uri callbackUrl = null, ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid) { FriendlyName = friendlyName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl }; return(Update(options, client)); }
/// <summary> /// Update a specific Service. /// </summary> /// <param name="pathSid"> A string that uniquely identifies this Service. </param> /// <param name="friendlyName"> A human readable description of this resource. </param> /// <param name="defaultTtl"> Default TTL for a Session, in seconds. </param> /// <param name="callbackUrl"> URL Twilio will send callbacks to </param> /// <param name="geoMatchLevel"> Whether to find proxy numbers in the same areacode. </param> /// <param name="numberSelectionBehavior"> What behavior to use when choosing a proxy number. </param> /// <param name="interceptCallbackUrl"> A URL for Twilio call before each Interaction. </param> /// <param name="outOfSessionCallbackUrl"> A URL for Twilio call when a new Interaction has no Session. </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, string friendlyName = null, int?defaultTtl = null, Uri callbackUrl = null, ServiceResource.GeoMatchLevelEnum geoMatchLevel = null, ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null, Uri interceptCallbackUrl = null, Uri outOfSessionCallbackUrl = null, ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid) { FriendlyName = friendlyName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl }; return(await UpdateAsync(options, client)); }
/// <summary> /// Update a specific Service. /// </summary> /// <param name="pathSid"> A string that uniquely identifies this Service. </param> /// <param name="uniqueName"> A human readable description of this resource. </param> /// <param name="defaultTtl"> Default TTL for Sessions in Service, in seconds. </param> /// <param name="callbackUrl"> URL Twilio will send callbacks to </param> /// <param name="geoMatchLevel"> Whether proxy number selected must be in the same area code as the participant /// identifier. </param> /// <param name="numberSelectionBehavior"> What behavior to use when choosing a proxy number. </param> /// <param name="interceptCallbackUrl"> A URL for Twilio call before each Interaction. </param> /// <param name="outOfSessionCallbackUrl"> A URL for Twilio call when a new Interaction has no Session. </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Service </returns> public static ServiceResource Update(string pathSid, string uniqueName = null, int?defaultTtl = null, Uri callbackUrl = null, ServiceResource.GeoMatchLevelEnum geoMatchLevel = null, ServiceResource.NumberSelectionBehaviorEnum numberSelectionBehavior = null, Uri interceptCallbackUrl = null, Uri outOfSessionCallbackUrl = null, ITwilioRestClient client = null) { var options = new UpdateServiceOptions(pathSid) { UniqueName = uniqueName, DefaultTtl = defaultTtl, CallbackUrl = callbackUrl, GeoMatchLevel = geoMatchLevel, NumberSelectionBehavior = numberSelectionBehavior, InterceptCallbackUrl = interceptCallbackUrl, OutOfSessionCallbackUrl = outOfSessionCallbackUrl }; return(Update(options, client)); }
/// <summary> /// Update a specific Service. /// </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)); }