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. CustomTransformConfiguration? customTransformConfiguration,
  7. String? description,
  8. ExceptionLevel? exceptionLevel,
  9. List<GatewayInterceptorConfiguration>? interceptorConfigurations,
  10. String? kmsKeyArn,
  11. GatewayPolicyEngineConfiguration? policyEngineConfiguration,
  12. GatewayProtocolConfiguration? protocolConfiguration,
  13. GatewayProtocolType? protocolType,
  14. WafConfiguration? wafConfiguration,
})

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 customTransformConfiguration : The updated custom transformation configuration for the gateway. This configuration defines how the gateway transforms requests and responses.

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.

Parameter wafConfiguration : The updated Amazon Web Services WAF configuration for the gateway.

Implementation

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