updateEndpoint method

Future<UpdateEndpointResponse> updateEndpoint({
  1. required String endpointArn,
  2. String? desiredDataAccessRoleArn,
  3. int? desiredInferenceUnits,
  4. String? desiredModelArn,
  5. String? flywheelArn,
})

Updates information about the specified endpoint. For information about endpoints, see Managing endpoints.

May throw InternalServerException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceLimitExceededException. May throw ResourceNotFoundException. May throw ResourceUnavailableException. May throw TooManyRequestsException.

Parameter endpointArn : The Amazon Resource Number (ARN) of the endpoint being updated.

Parameter desiredDataAccessRoleArn : Data access role ARN to use in case the new model is encrypted with a customer CMK.

Parameter desiredInferenceUnits : The desired number of inference units to be used by the model using this endpoint. Each inference unit represents of a throughput of 100 characters per second.

Parameter desiredModelArn : The ARN of the new model to use when updating an existing endpoint.

Parameter flywheelArn : The Amazon Resource Number (ARN) of the flywheel

Implementation

Future<UpdateEndpointResponse> updateEndpoint({
  required String endpointArn,
  String? desiredDataAccessRoleArn,
  int? desiredInferenceUnits,
  String? desiredModelArn,
  String? flywheelArn,
}) async {
  _s.validateNumRange(
    'desiredInferenceUnits',
    desiredInferenceUnits,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Comprehend_20171127.UpdateEndpoint'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'EndpointArn': endpointArn,
      if (desiredDataAccessRoleArn != null)
        'DesiredDataAccessRoleArn': desiredDataAccessRoleArn,
      if (desiredInferenceUnits != null)
        'DesiredInferenceUnits': desiredInferenceUnits,
      if (desiredModelArn != null) 'DesiredModelArn': desiredModelArn,
      if (flywheelArn != null) 'FlywheelArn': flywheelArn,
    },
  );

  return UpdateEndpointResponse.fromJson(jsonResponse.body);
}