@SdkInternalApi
    final UpdateStateMachineResult executeUpdateStateMachine(UpdateStateMachineRequest updateStateMachineRequest) {

        ExecutionContext executionContext = createExecutionContext(updateStateMachineRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<UpdateStateMachineRequest> request = null;
        Response<UpdateStateMachineResult> response = null;

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

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

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

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Updates an existing state machine by modifying its <code>definition</code>, <code>roleArn</code>,
<code>loggingConfiguration</code>, or <code>EncryptionConfiguration</code>. Running executions will continue to
use the previous <code>definition</code> and <code>roleArn</code>. You must include at least one of
<code>definition</code> or <code>roleArn</code> or you will receive a <code>MissingRequiredParameter</code>
error.
</p>
<p>
A qualified state machine ARN refers to a <i>Distributed Map state</i> defined within a state machine. For
example, the qualified state machine ARN
<code>arn:partition:states:region:account-id:stateMachine:stateMachineName/mapStateLabel</code> refers to a
<i>Distributed Map state</i> with a label <code>mapStateLabel</code> in the state machine named
<code>stateMachineName</code>.
</p>
<p>
A qualified state machine ARN can either refer to a <i>Distributed Map state</i> defined within a state machine,
a version ARN, or an alias ARN.
</p>
<p>
The following are some examples of qualified and unqualified state machine ARNs:
</p>
<ul>
<li>
<p>
The following qualified state machine ARN refers to a <i>Distributed Map state</i> with a label
<code>mapStateLabel</code> in a state machine named <code>myStateMachine</code>.
</p>
<p>
<code>arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel</code>
</p>
<note>
<p>
If you provide a qualified state machine ARN that refers to a <i>Distributed Map state</i>, the request fails
with <code>ValidationException</code>.
</p>
</note></li>
<li>
<p>
The following qualified state machine ARN refers to an alias named <code>PROD</code>.
</p>
<p>
<code>arn:&lt;partition&gt;:states:&lt;region&gt;:&lt;account-id&gt;:stateMachine:&lt;myStateMachine:PROD&gt;</code>
</p>
<note>
<p>
If you provide a qualified state machine ARN that refers to a version ARN or an alias ARN, the request starts
execution for that version or alias.
</p>
</note></li>
<li>
<p>
The following unqualified state machine ARN refers to a state machine named <code>myStateMachine</code>.
</p>
<p>
<code>arn:&lt;partition&gt;:states:&lt;region&gt;:&lt;account-id&gt;:stateMachine:&lt;myStateMachine&gt;</code>
</p>
</li>
</ul>
<p>
After you update your state machine, you can set the <code>publish</code> parameter to <code>true</code> in the
same action to publish a new <a
href="https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html">version</a>. This
way, you can opt-in to strict versioning of your state machine.
</p>
<note>
<p>
Step Functions assigns monotonically increasing integers for state machine versions, starting at version number
1.
</p>
</note> <note>
<p>
All <code>StartExecution</code> calls within a few seconds use the updated <code>definition</code> and
<code>roleArn</code>. Executions started immediately after you call <code>UpdateStateMachine</code> may use the
previous state machine <code>definition</code> and <code>roleArn</code>.
</p>
</note>

@param updateStateMachineRequest
@return Result of the UpdateStateMachine operation returned by the service.
@throws InvalidArnException
        The provided Amazon Resource Name (ARN) is not valid.
@throws InvalidDefinitionException
        The provided Amazon States Language definition is not valid.
@throws InvalidLoggingConfigurationException
        Configuration is not valid.
@throws InvalidTracingConfigurationException
        Your <code>tracingConfiguration</code> key does not match, or <code>enabled</code> has not been set to
        <code>true</code> or <code>false</code>.
@throws MissingRequiredParameterException
        Request is missing a required parameter. This error occurs if both <code>definition</code> and
        <code>roleArn</code> are not specified.
@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 ValidationException
        The input does not satisfy the constraints specified by an Amazon Web Services service.
@throws InvalidEncryptionConfigurationException
        Received when <code>encryptionConfiguration</code> is specified but various conditions exist which make
        the configuration invalid. For example, if <code>type</code> is set to
        <code>CUSTOMER_MANAGED_KMS_KEY</code>, but <code>kmsKeyId</code> is null, or
        <code>kmsDataKeyReusePeriodSeconds</code> is not between 60 and 900, or the KMS key is not symmetric or
        inactive.
@throws KmsAccessDeniedException
        Either your KMS key policy or API caller does not have the required permissions.
@throws KmsThrottlingException
        Received when KMS returns <code>ThrottlingException</code> for a KMS call that Step Functions makes on
        behalf of the caller.
@sample AWSStepFunctions.UpdateStateMachine
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/UpdateStateMachine" target="_top">AWS API
     Documentation</a>
aws-java-sdk-stepfunctions/src/main/java/com/amazonaws/services/stepfunctions/AWSStepFunctionsClient.java