/// <summary> /// update /// </summary> /// <param name="options"> Update Document parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Document </returns> public static DocumentResource Update(UpdateDocumentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdateDocumentOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Sync, "/v1/Services/" + options.PathServiceSid + "/Documents/" + options.PathSid + "", postParams: options.GetParams() )); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathSid"> The sid </param> /// <param name="data"> The data </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Document </returns> public static async System.Threading.Tasks.Task <DocumentResource> UpdateAsync(string pathServiceSid, string pathSid, object data, ITwilioRestClient client = null) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid, data); return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The service_sid </param> /// <param name="pathSid"> The sid </param> /// <param name="data"> The data </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Document </returns> public static DocumentResource Update(string pathServiceSid, string pathSid, object data, ITwilioRestClient client = null) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid, data); return(Update(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The SID of the Sync Service with the Document resource to update </param> /// <param name="pathSid"> The SID of the Document resource to update </param> /// <param name="data"> A JSON string that represents an arbitrary, schema-less object that the Sync Document stores /// </param> /// <param name="ttl"> How long, in seconds, before the Document resource expires and is deleted </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Document </returns> public static DocumentResource Update(string pathServiceSid, string pathSid, object data = null, int?ttl = null, ITwilioRestClient client = null) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid) { Data = data, Ttl = ttl }; return(Update(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathServiceSid"> The SID of the Sync Service with the Document resource to update </param> /// <param name="pathSid"> The SID of the Document resource to update </param> /// <param name="data"> A JSON string that represents an arbitrary, schema-less object that the Sync Document stores /// </param> /// <param name="ttl"> How long, in seconds, before the Document resource expires and is deleted </param> /// <param name="ifMatch"> The If-Match HTTP request header </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Document </returns> public static async System.Threading.Tasks.Task <DocumentResource> UpdateAsync(string pathServiceSid, string pathSid, object data = null, int?ttl = null, string ifMatch = null, ITwilioRestClient client = null) { var options = new UpdateDocumentOptions(pathServiceSid, pathSid) { Data = data, Ttl = ttl, IfMatch = ifMatch }; return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// <param name="options"> Update Document parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Document </returns> public static async System.Threading.Tasks.Task <DocumentResource> UpdateAsync(UpdateDocumentOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }