chore: additional descriptions for channel update

This commit is contained in:
Gordon Hayes
2021-08-10 12:17:19 +02:00
parent 250162b7bd
commit 4dff4d4cbe
2 changed files with 26 additions and 6 deletions
@@ -972,7 +972,13 @@ class Channel {
) => ) =>
updatePartial(set: {'name': name}); updatePartial(set: {'name': name});
/// Edit the channel custom data. /// Update the channel custom data. This replaces all of the channel data
/// with the given [channelData].
///
/// If you instead want to do a partial update, use [updatePartial].
///
/// See, https://getstream.io/chat/docs/other-rest/channel_update/?language=dart
/// for more information.
Future<UpdateChannelResponse> update( Future<UpdateChannelResponse> update(
Map<String, Object?> channelData, [ Map<String, Object?> channelData, [
Message? updateMessage, Message? updateMessage,
@@ -986,9 +992,18 @@ class Channel {
); );
} }
/// Edit the channel custom data. /// A partial update can be used to set and unset specific custom data fields
// TODO: This is the same description as [update]. Distinguish the two /// when it is necessary to retain additional custom data fields on the
// and provide a better description for set and unset. /// object.
///
/// - [set] will add, or update existing attributes.
/// - [unset] will remove the attributes with the provided list of
/// values (keys).
///
/// If you want to do a full update/replacement, use [update] instead.
///
/// See, https://getstream.io/chat/docs/other-rest/channel_update/?language=dart
/// for more information.
Future<PartialUpdateChannelResponse> updatePartial({ Future<PartialUpdateChannelResponse> updatePartial({
Map<String, Object?>? set, Map<String, Object?>? set,
List<String>? unset, List<String>? unset,
@@ -767,7 +767,9 @@ class StreamChatClient {
cancelToken: cancelToken, cancelToken: cancelToken,
); );
/// Replaces the [channelId] of type [ChannelType] data with [data] /// Replaces the [channelId] of type [ChannelType] data with [data].
///
/// Use [updateChannelPartial] for a partial update.
Future<UpdateChannelResponse> updateChannel( Future<UpdateChannelResponse> updateChannel(
String channelId, String channelId,
String channelType, String channelType,
@@ -781,7 +783,10 @@ class StreamChatClient {
message: message, message: message,
); );
/// Updates the [channelId] of type [ChannelType] data with [data] /// Partial update for the [channelId] of type [ChannelType]. Sets the
/// data provided in [set], and removes the attributes given in [unset].
///
/// Use [updateChannel] for a full update.
Future<PartialUpdateChannelResponse> updateChannelPartial( Future<PartialUpdateChannelResponse> updateChannelPartial(
String channelId, String channelId,
String channelType, { String channelType, {