createRealtimeEndpoint method

Future<CreateRealtimeEndpointOutput> createRealtimeEndpoint({
  1. required String mLModelId,
})

Creates a real-time endpoint for the MLModel. The endpoint contains the URI of the MLModel; that is, the location to send real-time prediction requests for the specified MLModel.

May throw InvalidInputException. May throw ResourceNotFoundException. May throw InternalServerException.

Parameter mLModelId : The ID assigned to the MLModel during creation.

Implementation

Future<CreateRealtimeEndpointOutput> createRealtimeEndpoint({
  required String mLModelId,
}) async {
  ArgumentError.checkNotNull(mLModelId, 'mLModelId');
  _s.validateStringLength(
    'mLModelId',
    mLModelId,
    1,
    64,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonML_20141212.CreateRealtimeEndpoint'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'MLModelId': mLModelId,
    },
  );

  return CreateRealtimeEndpointOutput.fromJson(jsonResponse.body);
}