/// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update UserChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserChannel </returns>
        public static UserChannelResource Update(UpdateUserChannelOptions 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(UpdateUserChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Chat,
                "/v2/Services/" + options.PathServiceSid + "/Users/" + options.PathUserSid + "/Channels/" + options.PathChannelSid + "",
                postParams: options.GetParams()
                ));
 }
예제 #3
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The unique id of the Service those channels belong to. </param>
        /// <param name="pathUserSid"> The unique id of a User. </param>
        /// <param name="pathChannelSid"> The unique id of a Channel. </param>
        /// <param name="notificationLevel"> Push notification level to be assigned to Channel of the User. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserChannel </returns>
        public static async System.Threading.Tasks.Task <UserChannelResource> UpdateAsync(string pathServiceSid,
                                                                                          string pathUserSid,
                                                                                          string pathChannelSid,
                                                                                          UserChannelResource.NotificationLevelEnum notificationLevel,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid, notificationLevel);

            return(await UpdateAsync(options, client));
        }
예제 #4
0
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The unique id of the Service those channels belong to. </param>
        /// <param name="pathUserSid"> The unique id of a User. </param>
        /// <param name="pathChannelSid"> The unique id of a Channel. </param>
        /// <param name="notificationLevel"> Push notification level to be assigned to Channel of the User. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserChannel </returns>
        public static UserChannelResource Update(string pathServiceSid,
                                                 string pathUserSid,
                                                 string pathChannelSid,
                                                 UserChannelResource.NotificationLevelEnum notificationLevel,
                                                 ITwilioRestClient client = null)
        {
            var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid, notificationLevel);

            return(Update(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param>
        /// <param name="pathUserSid"> The SID of the User to update the User Channel resource from </param>
        /// <param name="pathChannelSid"> The SID of the Channel with the User Channel resource to update </param>
        /// <param name="notificationLevel"> The push notification level to assign to the User Channel </param>
        /// <param name="lastConsumedMessageIndex"> The index of the last Message that the Member has read within the Channel
        ///                                </param>
        /// <param name="lastConsumptionTimestamp"> The ISO 8601 based timestamp string that represents the datetime of the
        ///                                last Message read event for the Member within the Channel </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserChannel </returns>
        public static async System.Threading.Tasks.Task <UserChannelResource> UpdateAsync(string pathServiceSid,
                                                                                          string pathUserSid,
                                                                                          string pathChannelSid,
                                                                                          UserChannelResource.NotificationLevelEnum notificationLevel = null,
                                                                                          int?lastConsumedMessageIndex      = null,
                                                                                          DateTime?lastConsumptionTimestamp = null,
                                                                                          ITwilioRestClient client          = null)
        {
            var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid)
            {
                NotificationLevel = notificationLevel, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp
            };

            return(await UpdateAsync(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to update the resource from </param>
        /// <param name="pathUserSid"> The SID of the User to update the User Channel resource from </param>
        /// <param name="pathChannelSid"> The SID of the Channel with the User Channel resource to update </param>
        /// <param name="notificationLevel"> The push notification level to assign to the User Channel </param>
        /// <param name="lastConsumedMessageIndex"> The index of the last Message that the Member has read within the Channel
        ///                                </param>
        /// <param name="lastConsumptionTimestamp"> The ISO 8601 based timestamp string that represents the datetime of the
        ///                                last Message read event for the Member within the Channel </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of UserChannel </returns>
        public static UserChannelResource Update(string pathServiceSid,
                                                 string pathUserSid,
                                                 string pathChannelSid,
                                                 UserChannelResource.NotificationLevelEnum notificationLevel = null,
                                                 int?lastConsumedMessageIndex      = null,
                                                 DateTime?lastConsumptionTimestamp = null,
                                                 ITwilioRestClient client          = null)
        {
            var options = new UpdateUserChannelOptions(pathServiceSid, pathUserSid, pathChannelSid)
            {
                NotificationLevel = notificationLevel, LastConsumedMessageIndex = lastConsumedMessageIndex, LastConsumptionTimestamp = lastConsumptionTimestamp
            };

            return(Update(options, client));
        }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="options"> Update UserChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of UserChannel </returns>
        public static async System.Threading.Tasks.Task <UserChannelResource> UpdateAsync(UpdateUserChannelOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }