requestSpec method

HttpRequestSpec requestSpec()

Implementation

HttpRequestSpec requestSpec() {
  final config = protoConfig();
  final http = config.options.whereType<ProtoOptionHttp>().firstOrNull;
  if (http == null) {
    throw DartCosmosSdkPluginException(
      "Missing request google http config.",
      details: {"typeUrl": declarationId.typeUrl},
    );
  }
  final httpRule = HttpRule.parse(
    http.path,
    http.method,
    body: http.bodyField,
  );
  return GrpcHttpEndpoint(httpRule: httpRule).buildRequest(toJson());
}