Пример #1
0
        /// <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));
        }
Пример #2
0
 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()
                ));
 }
Пример #3
0
        /// <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));
        }
Пример #4
0
        /// <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));
        }
Пример #5
0
        /// <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));
        }