createChannel method

Future<CreateChannelResponse> createChannel({
  1. required String id,
  2. String? description,
  3. Map<String, String>? tags,
})

Creates a new Channel.

May throw UnprocessableEntityException. May throw InternalServerErrorException. May throw ForbiddenException. May throw NotFoundException. May throw ServiceUnavailableException. May throw TooManyRequestsException.

Parameter id : The ID of the Channel. The ID must be unique within the region and it cannot be changed after a Channel is created.

Parameter description : A short text description of the Channel.

Implementation

Future<CreateChannelResponse> createChannel({
  required String id,
  String? description,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  final $payload = <String, dynamic>{
    'id': id,
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/channels',
    exceptionFnMap: _exceptionFns,
  );
  return CreateChannelResponse.fromJson(response);
}