CallBinding constructor

CallBinding({
  1. required String method,
  2. required String route,
  3. List<String> pathParams = const [],
  4. String? query,
  5. required Uint8List contractSha,
  6. String? idempotencyKey,
  7. String? ifMatch,
})

contractSha is the op's contract digest, 32 bytes; throws ArgumentError otherwise. pathParams is copied.

Implementation

CallBinding({
  required this.method,
  required this.route,
  List<String> pathParams = const [],
  this.query,
  required Uint8List contractSha,
  this.idempotencyKey,
  this.ifMatch,
})  : pathParams = List.unmodifiable(pathParams),
      contractSha = Uint8List.fromList(contractSha) {
  if (contractSha.length != 32) {
    throw ArgumentError.value(
      contractSha.length,
      'contractSha',
      'the op contract digest is 32 bytes',
    );
  }
}