updateVpcEndpoint method

Future<UpdateVpcEndpointResponse> updateVpcEndpoint({
  1. required String id,
  2. List<String>? addSecurityGroupIds,
  3. List<String>? addSubnetIds,
  4. String? clientToken,
  5. List<String>? removeSecurityGroupIds,
  6. List<String>? removeSubnetIds,
})

Updates an OpenSearch Serverless-managed interface endpoint. For more information, see Access Amazon OpenSearch Serverless using an interface endpoint.

May throw ConflictException. May throw InternalServerException. May throw ValidationException.

Parameter id : The unique identifier of the interface endpoint to update.

Parameter addSecurityGroupIds : The unique identifiers of the security groups to add to the endpoint. Security groups define the ports, protocols, and sources for inbound traffic that you are authorizing into your endpoint.

Parameter addSubnetIds : The ID of one or more subnets to add to the endpoint.

Parameter clientToken : Unique, case-sensitive identifier to ensure idempotency of the request.

Parameter removeSecurityGroupIds : The unique identifiers of the security groups to remove from the endpoint.

Parameter removeSubnetIds : The unique identifiers of the subnets to remove from the endpoint.

Implementation

Future<UpdateVpcEndpointResponse> updateVpcEndpoint({
  required String id,
  List<String>? addSecurityGroupIds,
  List<String>? addSubnetIds,
  String? clientToken,
  List<String>? removeSecurityGroupIds,
  List<String>? removeSubnetIds,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'OpenSearchServerless.UpdateVpcEndpoint'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'id': id,
      if (addSecurityGroupIds != null)
        'addSecurityGroupIds': addSecurityGroupIds,
      if (addSubnetIds != null) 'addSubnetIds': addSubnetIds,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (removeSecurityGroupIds != null)
        'removeSecurityGroupIds': removeSecurityGroupIds,
      if (removeSubnetIds != null) 'removeSubnetIds': removeSubnetIds,
    },
  );

  return UpdateVpcEndpointResponse.fromJson(jsonResponse.body);
}