示例#1
0
        /// <summary>
        /// Update a specific Session.
        /// </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
        /// <summary>
        /// Update a specific Session.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Session. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this Session. </param>
        /// <param name="dateExpiry"> The date this Session was expiry </param>
        /// <param name="ttl"> TTL for a Session, in seconds. </param>
        /// <param name="status"> The Status of this Session </param>
        /// <param name="participants"> A list of phone numbers to add to this Session. </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 pathServiceSid, string pathSid, string uniqueName = null, DateTime?dateExpiry = null, int?ttl = null, SessionResource.StatusEnum status = null, List <string> participants = null, ITwilioRestClient client = null)
        {
            var options = new UpdateSessionOptions(pathServiceSid, pathSid)
            {
                UniqueName = uniqueName, DateExpiry = dateExpiry, Ttl = ttl, Status = status, Participants = participants
            };

            return(await UpdateAsync(options, client));
        }
示例#3
0
        /// <summary>
        /// Update a specific Session.
        /// </summary>
        ///
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathSid"> A string that uniquely identifies this Session. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this Session. </param>
        /// <param name="dateExpiry"> The date this Session was expiry </param>
        /// <param name="ttl"> TTL for a Session, in seconds. </param>
        /// <param name="status"> The Status of this Session </param>
        /// <param name="participants"> A list of phone numbers to add to this Session. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Session </returns>
        public static SessionResource Update(string pathServiceSid, string pathSid, string uniqueName = null, DateTime?dateExpiry = null, int?ttl = null, SessionResource.StatusEnum status = null, List <string> participants = null, ITwilioRestClient client = null)
        {
            var options = new UpdateSessionOptions(pathServiceSid, pathSid)
            {
                UniqueName = uniqueName, DateExpiry = dateExpiry, Ttl = ttl, Status = status, Participants = participants
            };

            return(Update(options, client));
        }
 private static Request BuildUpdateRequest(UpdateSessionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Proxy,
                "/v1/Services/" + options.PathServiceSid + "/Sessions/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
示例#5
0
        /// <summary>
        /// Update a specific Session.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="dateExpiry"> The ISO 8601 date when the Session should expire </param>
        /// <param name="ttl"> When the session will expire </param>
        /// <param name="status"> The new status of the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Session </returns>
        public static SessionResource Update(string pathServiceSid,
                                             string pathSid,
                                             DateTime?dateExpiry = null,
                                             int?ttl             = null,
                                             SessionResource.StatusEnum status = null,
                                             ITwilioRestClient client          = null)
        {
            var options = new UpdateSessionOptions(pathServiceSid, pathSid)
            {
                DateExpiry = dateExpiry, Ttl = ttl, Status = status
            };

            return(Update(options, client));
        }
示例#6
0
        /// <summary>
        /// Update a specific Session.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="dateExpiry"> The ISO 8601 date when the Session should expire </param>
        /// <param name="ttl"> When the session will expire </param>
        /// <param name="status"> The new status of the resource </param>
        /// <param name="failOnParticipantConflict"> An experimental parameter to override the ProxyAllowParticipantConflict
        ///                                 account flag on a per-request basis. </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 pathServiceSid,
                                                                                      string pathSid,
                                                                                      DateTime?dateExpiry = null,
                                                                                      int?ttl             = null,
                                                                                      SessionResource.StatusEnum status = null,
                                                                                      bool?failOnParticipantConflict    = null,
                                                                                      ITwilioRestClient client          = null)
        {
            var options = new UpdateSessionOptions(pathServiceSid, pathSid)
            {
                DateExpiry = dateExpiry, Ttl = ttl, Status = status, FailOnParticipantConflict = failOnParticipantConflict
            };

            return(await UpdateAsync(options, client));
        }
示例#7
0
        /// <summary>
        /// Update a specific Session.
        /// </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));
        }