getChannelMetadata method

Future<GetChannelMetadataResult> getChannelMetadata(
  1. String channelId, {
  2. Keyset? keyset,
  3. String? using,
  4. bool? includeCustomFields,
  5. bool includeStatus = true,
  6. bool includeType = true,
})

Returns the specified channelMetadata, optionally including channelMetadata's custom data object.

To include custom property fields in response, set includeCustomFields to true Omit this parameter if you don't want to retrieve additional metadata.

To omit status field from metadata, set includeStatus to false Default is true.

To omit type field from metadata, set includeType to false Default is true.

channelId is Channel identifier. Must not be empty, and may contain up to 92 UTF-8 byte sequences. Prohibited characters are ,, /, , *, :, channel, non-printable ASCII control characters, and Unicode zero.

Implementation

Future<GetChannelMetadataResult> getChannelMetadata(
  String channelId, {
  Keyset? keyset,
  String? using,
  bool? includeCustomFields,
  bool includeStatus = true,
  bool includeType = true,
}) async {
  keyset ??= _core.keysets[using];
  Ensure(channelId).isNotEmpty('channelIds');

  var include = <String>{};
  if (includeCustomFields != null && includeCustomFields) {
    include.add('custom');
  }
  if (includeStatus) {
    include.add('status');
  }
  if (includeType) {
    include.add('type');
  }

  var params = GetChannelMetadataParams(keyset, channelId, include: include);

  return defaultFlow<GetChannelMetadataParams, GetChannelMetadataResult>(
      keyset: keyset,
      core: _core,
      params: params,
      serialize: (object, [_]) => GetChannelMetadataResult.fromJson(object));
}