StreamMetadata constructor

StreamMetadata({
  1. StreamAcl? acl,
  2. dynamic custom,
  3. Duration? maxAge,
  4. int? maxCount,
  5. Duration? cacheControl,
  6. StreamPosition? truncateBefore,
})

Implementation

StreamMetadata({
  this.acl,
  this.custom,
  this.maxAge,
  this.maxCount,
  this.cacheControl,
  this.truncateBefore,
}) {
  if (maxCount != null && maxCount! <= 0) {
    throw ArgumentOutOfRangeException.fromCause(GrpcError.outOfRange(
      'maxCount value must be larger than zero',
    ));
  }

  if (maxAge != null && maxAge! <= Duration.zero) {
    throw ArgumentOutOfRangeException.fromCause(GrpcError.outOfRange(
      'maxAge value must be larger than zero',
    ));
  }

  if (cacheControl != null && cacheControl! <= Duration.zero) {
    throw ArgumentOutOfRangeException.fromCause(GrpcError.outOfRange(
      'cacheControl value must be larger than zero',
    ));
  }
}