updateStream method

Future<UpdateStreamResponse> updateStream({
  1. required String streamId,
  2. String? description,
  3. List<StreamFile>? files,
  4. String? roleArn,
})

Updates an existing stream. The stream version will be incremented by one.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnauthorizedException. May throw ServiceUnavailableException. May throw InternalFailureException.

Parameter streamId : The stream ID.

Parameter description : The description of the stream.

Parameter files : The files associated with the stream.

Parameter roleArn : An IAM role that allows the IoT service principal assumes to access your S3 files.

Implementation

Future<UpdateStreamResponse> updateStream({
  required String streamId,
  String? description,
  List<StreamFile>? files,
  String? roleArn,
}) async {
  ArgumentError.checkNotNull(streamId, 'streamId');
  _s.validateStringLength(
    'streamId',
    streamId,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    2028,
  );
  _s.validateStringLength(
    'roleArn',
    roleArn,
    20,
    2048,
  );
  final $payload = <String, dynamic>{
    if (description != null) 'description': description,
    if (files != null) 'files': files,
    if (roleArn != null) 'roleArn': roleArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/streams/${Uri.encodeComponent(streamId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateStreamResponse.fromJson(response);
}