updateGateway method

Future<UpdateGatewayResponse> updateGateway({
  1. required AuthorizerType authorizerType,
  2. required String gatewayIdentifier,
  3. required String name,
  4. required String roleArn,
  5. AuthorizerConfiguration? authorizerConfiguration,
  6. String? description,
  7. ExceptionLevel? exceptionLevel,
  8. List<GatewayInterceptorConfiguration>? interceptorConfigurations,
  9. String? kmsKeyArn,
  10. GatewayPolicyEngineConfiguration? policyEngineConfiguration,
  11. GatewayProtocolConfiguration? protocolConfiguration,
  12. GatewayProtocolType? protocolType,
})

Updates an existing gateway.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter authorizerType : The updated authorizer type for the gateway.

Parameter gatewayIdentifier : The identifier of the gateway to update.

Parameter name : The name of the gateway. This name must be the same as the one when the gateway was created.

Parameter roleArn : The updated IAM role ARN that provides permissions for the gateway.

Parameter authorizerConfiguration : The updated authorizer configuration for the gateway.

Parameter description : The updated description for the gateway.

Parameter exceptionLevel : The level of detail in error messages returned when invoking the gateway.

  • If the value is DEBUG, granular exception messages are returned to help a user debug the gateway.
  • If the value is omitted, a generic error message is returned to the end user.

Parameter interceptorConfigurations : The updated interceptor configurations for the gateway.

Parameter kmsKeyArn : The updated ARN of the KMS key used to encrypt the gateway.

Parameter policyEngineConfiguration : The updated policy engine configuration for the gateway. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.

Parameter protocolType : The updated protocol type for the gateway.

Implementation

Future<UpdateGatewayResponse> updateGateway({
  required AuthorizerType authorizerType,
  required String gatewayIdentifier,
  required String name,
  required String roleArn,
  AuthorizerConfiguration? authorizerConfiguration,
  String? description,
  ExceptionLevel? exceptionLevel,
  List<GatewayInterceptorConfiguration>? interceptorConfigurations,
  String? kmsKeyArn,
  GatewayPolicyEngineConfiguration? policyEngineConfiguration,
  GatewayProtocolConfiguration? protocolConfiguration,
  GatewayProtocolType? protocolType,
}) async {
  final $payload = <String, dynamic>{
    'authorizerType': authorizerType.value,
    'name': name,
    'roleArn': roleArn,
    if (authorizerConfiguration != null)
      'authorizerConfiguration': authorizerConfiguration,
    if (description != null) 'description': description,
    if (exceptionLevel != null) 'exceptionLevel': exceptionLevel.value,
    if (interceptorConfigurations != null)
      'interceptorConfigurations': interceptorConfigurations,
    if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
    if (policyEngineConfiguration != null)
      'policyEngineConfiguration': policyEngineConfiguration,
    if (protocolConfiguration != null)
      'protocolConfiguration': protocolConfiguration,
    if (protocolType != null) 'protocolType': protocolType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/gateways/${Uri.encodeComponent(gatewayIdentifier)}/',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateGatewayResponse.fromJson(response);
}