@SdkInternalApi
    final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {

        ExecutionContext executionContext = createExecutionContext(tagResourceRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<TagResourceRequest> request = null;
        Response<TagResourceResult> response = null;

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

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

            URI endpointTraitHost = null;
            if (!clientConfiguration.isDisableHostPrefixInjection()) {

                String hostPrefix = "cp.metadata.";
                String resolvedHostPrefix = String.format("cp.metadata.");

                endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);
            }

            HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Assigns one or more tags (key-value pairs) to the specified Amazon Location Service resource.
</p>
<p>
Tags can help you organize and categorize your resources. You can also use them to scope user permissions, by
granting a user permission to access or change only resources with certain tag values.
</p>
<p>
You can use the <code>TagResource</code> operation with an Amazon Location Service resource that already has
tags. If you specify a new tag key for the resource, this tag is appended to the tags already associated with the
resource. If you specify a tag key that's already associated with the resource, the new tag value that you
specify replaces the previous value for that tag.
</p>
<p>
You can associate up to 50 tags with a resource.
</p>

@param tagResourceRequest
@return Result of the TagResource operation returned by the service.
@throws InternalServerException
        The request has failed to process because of an unknown server error, exception, or failure.
@throws ResourceNotFoundException
        The resource that you've entered was not found in your AWS account.
@throws AccessDeniedException
        The request was denied because of insufficient access or permissions. Check with an administrator to
        verify your permissions.
@throws ValidationException
        The input failed to meet the constraints specified by the AWS service.
@throws ThrottlingException
        The request was denied because of request throttling.
@sample AmazonLocation.TagResource
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/location-2020-11-19/TagResource" target="_top">AWS API
     Documentation</a>
aws-java-sdk-location/src/main/java/com/amazonaws/services/location/AmazonLocationClient.java