getMethodCallContext method
Future<MethodCallContext>
getMethodCallContext({
- required FutureOr<
Session> createSessionCallback(- EndpointConnector connector
- required String endpointPath,
- required String methodName,
- required Map<
String, dynamic> parameters, - required SerializationManager serializationManager,
Tries to get a MethodCallContext for a given endpoint and method name. If the method is not found, a MethodNotFoundException is thrown. If the endpoint is not found, an EndpointNotFoundException is thrown. If the user is not authorized to access the endpoint, a NotAuthorizedException is thrown. If the input parameters are invalid, an InvalidParametersException is thrown. If the found method is not a MethodConnector, an InvalidEndpointMethodTypeException is thrown.
Implementation
Future<MethodCallContext> getMethodCallContext({
required FutureOr<Session> Function(EndpointConnector connector)
createSessionCallback,
required String endpointPath,
required String methodName,
required Map<String, dynamic> parameters,
required SerializationManager serializationManager,
}) async {
var (
methodConnector,
endpoint,
parsedArguments,
) = await _getEndpointMethodConnector(
createSessionCallback: createSessionCallback,
endpointPath: endpointPath,
methodName: methodName,
arguments: parameters,
serializationManager: serializationManager,
);
if (methodConnector is! MethodConnector) {
throw InvalidEndpointMethodTypeException();
}
return MethodCallContext(
method: methodConnector,
arguments: parsedArguments,
endpoint: endpoint,
);
}