/// <summary> /// update /// </summary> /// <param name="options"> Update Session parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Session </returns> public static SessionResource Update(UpdateSessionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }
private static Request BuildUpdateRequest(UpdateSessionOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Post, Rest.Domain.Messaging, "/v1/Sessions/" + options.PathSid + "", client.Region, postParams: options.GetParams() )); }
/// <summary> /// update /// </summary> /// <param name="pathSid"> The SID that identifies the resource to update </param> /// <param name="friendlyName"> A string to describe the resource </param> /// <param name="attributes"> A JSON string that stores application-specific data </param> /// <param name="dateCreated"> The ISO 8601 date and time in GMT when the resource was created </param> /// <param name="dateUpdated"> The ISO 8601 date and time in GMT when the resource was updated </param> /// <param name="createdBy"> The Identity of the session's creator </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Session </returns> public static async System.Threading.Tasks.Task <SessionResource> UpdateAsync(string pathSid, string friendlyName = null, string attributes = null, DateTime?dateCreated = null, DateTime?dateUpdated = null, string createdBy = null, ITwilioRestClient client = null) { var options = new UpdateSessionOptions(pathSid) { FriendlyName = friendlyName, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy }; return(await UpdateAsync(options, client)); }
/// <summary> /// update /// </summary> /// <param name="pathSid"> The SID that identifies the resource to update </param> /// <param name="friendlyName"> A string to describe the resource </param> /// <param name="attributes"> A JSON string that stores application-specific data </param> /// <param name="dateCreated"> The ISO 8601 date and time in GMT when the resource was created </param> /// <param name="dateUpdated"> The ISO 8601 date and time in GMT when the resource was updated </param> /// <param name="createdBy"> The Identity of the session's creator </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Session </returns> public static SessionResource Update(string pathSid, string friendlyName = null, string attributes = null, DateTime?dateCreated = null, DateTime?dateUpdated = null, string createdBy = null, ITwilioRestClient client = null) { var options = new UpdateSessionOptions(pathSid) { FriendlyName = friendlyName, Attributes = attributes, DateCreated = dateCreated, DateUpdated = dateUpdated, CreatedBy = createdBy }; return(Update(options, client)); }
/// <summary> /// update /// </summary> /// <param name="options"> Update Session parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Session </returns> public static async System.Threading.Tasks.Task <SessionResource> UpdateAsync(UpdateSessionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildUpdateRequest(options, client)); return(FromJson(response.Content)); }