@Override
    public PutPermissionResult putPermission(PutPermissionRequest request) {
        request = beforeClientExecution(request);
        return executePutPermission(request);
    }
<p>
Adds permissions to a profiling group's resource-based policy that are provided using an action group. If a
profiling group doesn't have a resource-based policy, one is created for it using the permissions in the action
group and the roles and users in the <code>principals</code> parameter.
</p>

<pre>
<code> &lt;p&gt; The one supported action group that can be added is &lt;code&gt;agentPermission&lt;/code&gt; which grants &lt;code&gt;ConfigureAgent&lt;/code&gt; and &lt;code&gt;PostAgent&lt;/code&gt; permissions. For more information, see &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html&quot;&gt;Resource-based policies in CodeGuru Profiler&lt;/a&gt; in the &lt;i&gt;Amazon CodeGuru Profiler User Guide&lt;/i&gt;, &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html&quot;&gt; &lt;code&gt;ConfigureAgent&lt;/code&gt; &lt;/a&gt;, and &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html&quot;&gt; &lt;code&gt;PostAgentProfile&lt;/code&gt; &lt;/a&gt;. &lt;/p&gt; &lt;p&gt; The first time you call &lt;code&gt;PutPermission&lt;/code&gt; on a profiling group, do not specify a &lt;code&gt;revisionId&lt;/code&gt; because it doesn't have a resource-based policy. Subsequent calls must provide a &lt;code&gt;revisionId&lt;/code&gt; to specify which revision of the resource-based policy to add the permissions to. &lt;/p&gt; &lt;p&gt; The response contains the profiling group's JSON-formatted resource policy. &lt;/p&gt; </code>
</pre>

@param putPermissionRequest
       The structure representing the <code>putPermissionRequest</code>.
@return Result of the PutPermission 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.PutPermission
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/codeguruprofiler-2019-07-18/PutPermission" target="_top">AWS
     API Documentation</a>
aws-java-sdk-codeguruprofiler/src/main/java/com/amazonaws/services/codeguruprofiler/AmazonCodeGuruProfilerClient.java