@SdkInternalApi
    final RemovePermissionResult executeRemovePermission(RemovePermissionRequest removePermissionRequest) {

        ExecutionContext executionContext = createExecutionContext(removePermissionRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<RemovePermissionRequest> request = null;
        Response<RemovePermissionResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new RemovePermissionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(removePermissionRequest));
                // 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, "CodeGuruProfiler");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemovePermission");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            HttpResponseHandler<AmazonWebServiceResponse<RemovePermissionResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RemovePermissionResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Removes permissions from a profiling group's resource-based policy that are provided using an action group. The
one supported action group that can be removed is <code>agentPermission</code> which grants
<code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a
href="https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html">Resource-based
policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a
href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html">
<code>ConfigureAgent</code> </a>, and <a
href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html">
<code>PostAgentProfile</code> </a>.
</p>

@param removePermissionRequest
       <pre>
<code> The structure representing the &lt;code&gt;removePermissionRequest&lt;/code&gt;.&lt;/p&gt; </code>
@return Result of the RemovePermission operation returned by the service.
@throws InternalServerException The server encountered an internal error and is unable to complete the request.
@throws ConflictException The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.
@throws ValidationException The parameter is not valid.
@throws ThrottlingException The request was denied due to request throttling.
@throws ResourceNotFoundException The resource specified in the request does not exist.
@sample AmazonCodeGuruProfiler.RemovePermission
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/codeguruprofiler-2019-07-18/RemovePermission" target="_top">AWS API Documentation</a>
aws-java-sdk-codeguruprofiler/src/main/java/com/amazonaws/services/codeguruprofiler/AmazonCodeGuruProfilerClient.java