@SdkInternalApi
    final PublishStateMachineVersionResult executePublishStateMachineVersion(PublishStateMachineVersionRequest publishStateMachineVersionRequest) {

        ExecutionContext executionContext = createExecutionContext(publishStateMachineVersionRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<PublishStateMachineVersionRequest> request = null;
        Response<PublishStateMachineVersionResult> response = null;

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

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

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

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Creates a <a
href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">version</a> from
the current revision of a state machine. Use versions to create immutable snapshots of your state machine. You
can start executions from versions either directly or with an alias. To create an alias, use
<a>CreateStateMachineAlias</a>.
</p>
<p>
You can publish up to 1000 versions for each state machine. You must manually delete unused versions using the
<a>DeleteStateMachineVersion</a> API action.
</p>
<p>
<code>PublishStateMachineVersion</code> is an idempotent API. It doesn't create a duplicate state machine version
if it already exists for the current revision. Step Functions bases <code>PublishStateMachineVersion</code>'s
idempotency check on the <code>stateMachineArn</code>, <code>name</code>, and <code>revisionId</code> parameters.
Requests with the same parameters return a successful idempotent response. If you don't specify a
<code>revisionId</code>, Step Functions checks for a previously published version of the state machine's current
revision.
</p>
<p>
<b>Related operations:</b>
</p>
<ul>
<li>
<p>
<a>DeleteStateMachineVersion</a>
</p>
</li>
<li>
<p>
<a>ListStateMachineVersions</a>
</p>
</li>
</ul>

@param publishStateMachineVersionRequest
@return Result of the PublishStateMachineVersion operation returned by the service.
@throws ValidationException
        The input does not satisfy the constraints specified by an Amazon Web Services service.
@throws StateMachineDeletingException
        The specified state machine is being deleted.
@throws StateMachineDoesNotExistException
        The specified state machine does not exist.
@throws ServiceQuotaExceededException
        The request would cause a service quota to be exceeded.</p>
        <p>
        HTTP Status Code: 402
@throws ConflictException
        Updating or deleting a resource can cause an inconsistent state. This error occurs when there're
        concurrent requests for <a>DeleteStateMachineVersion</a>, <a>PublishStateMachineVersion</a>, or
        <a>UpdateStateMachine</a> with the <code>publish</code> parameter set to <code>true</code>.
        </p>
        <p>
        HTTP Status Code: 409
@throws InvalidArnException
        The provided Amazon Resource Name (ARN) is not valid.
@sample AWSStepFunctions.PublishStateMachineVersion
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/PublishStateMachineVersion"
     target="_top">AWS API Documentation</a>
aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/AWSStepFunctionsClient.java