@SdkInternalApi
    final SetSecurityGroupsResult executeSetSecurityGroups(SetSecurityGroupsRequest setSecurityGroupsRequest) {

        ExecutionContext executionContext = createExecutionContext(setSecurityGroupsRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<SetSecurityGroupsRequest> request = null;
        Response<SetSecurityGroupsResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new SetSecurityGroupsRequestMarshaller().marshall(super.beforeMarshalling(setSecurityGroupsRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Load Balancing v2");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetSecurityGroups");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            StaxResponseHandler<SetSecurityGroupsResult> responseHandler = new StaxResponseHandler<SetSecurityGroupsResult>(
                    new SetSecurityGroupsResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Associates the specified security groups with the specified Application Load Balancer or Network Load Balancer.
The specified security groups override the previously associated security groups.
</p>
<p>
You can't perform this operation on a Network Load Balancer unless you specified a security group for the load
balancer when you created it.
</p>
<p>
You can't associate a security group with a Gateway Load Balancer.
</p>

@param setSecurityGroupsRequest
@return Result of the SetSecurityGroups operation returned by the service.
@throws LoadBalancerNotFoundException
        The specified load balancer does not exist.
@throws InvalidConfigurationRequestException
        The requested configuration is not valid.
@throws InvalidSecurityGroupException
        The specified security group does not exist.
@sample AmazonElasticLoadBalancing.SetSecurityGroups
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01/SetSecurityGroups"
     target="_top">AWS API Documentation</a>
aws-java-sdk-elasticloadbalancingv2/src/main/java/com/amazonaws/services/elasticloadbalancingv2/AmazonElasticLoadBalancingClient.java