BloomRpcContract<TInput, TOutput>.patch constructor

const BloomRpcContract<TInput, TOutput>.patch(
  1. String pathTemplate, {
  2. dynamic encodeInput(
    1. TInput input
    )?,
  3. TInput decodeInput(
    1. dynamic json
    )?,
  4. dynamic encodeOutput(
    1. TOutput output
    )?,
  5. TOutput decodeOutput(
    1. dynamic json
    )?,
  6. String? summary,
  7. String? description,
  8. List customCacheKey(
    1. TInput input
    )?,
})

Shorthand constructor for an HTTP PATCH endpoint contract.

const patchPost = BloomRpcContract<Map<String, dynamic>, Post>.patch(
  '/posts/:id',
  decodeOutput: Post.fromJson,
);

Implementation

const BloomRpcContract.patch(
  String pathTemplate, {
  dynamic Function(TInput input)? encodeInput,
  TInput Function(dynamic json)? decodeInput,
  dynamic Function(TOutput output)? encodeOutput,
  TOutput Function(dynamic json)? decodeOutput,
  String? summary,
  String? description,
  List<dynamic> Function(TInput input)? customCacheKey,
}) : this(
        method: BloomHttpMethod.patch,
        pathTemplate: pathTemplate,
        encodeInput: encodeInput,
        decodeInput: decodeInput,
        encodeOutput: encodeOutput,
        decodeOutput: decodeOutput,
        summary: summary,
        description: description,
        customCacheKey: customCacheKey,
      );