// Code generated by smithy-go-codegen DO NOT EDIT.

package arcregionswitch

import (
	"context"
	"github.com/aws/aws-sdk-go-v2/service/arcregionswitch/types"
	"github.com/aws/smithy-go/middleware"
	smithyhttp "github.com/aws/smithy-go/transport/http"
)

// Updates a specific step in an in-progress plan execution. This operation allows
// you to modify the step's comment or action.
func (c *Client) UpdatePlanExecutionStep(ctx context.Context, params *UpdatePlanExecutionStepInput, optFns ...func(*Options)) (*UpdatePlanExecutionStepOutput, error) {
	if params == nil {
		params = &UpdatePlanExecutionStepInput{}
	}

	result, metadata, err := c.invokeOperation(ctx, "UpdatePlanExecutionStep", params, optFns, c.addOperationUpdatePlanExecutionStepMiddlewares)
	if err != nil {
		return nil, err
	}

	out := result.(*UpdatePlanExecutionStepOutput)
	out.ResultMetadata = metadata
	return out, nil
}

type UpdatePlanExecutionStepInput struct {

	// The updated action to take for the step. This can be used to skip or retry a
	// step.
	//
	// This member is required.
	ActionToTake types.UpdatePlanExecutionStepAction

	// An optional comment about the plan execution.
	//
	// This member is required.
	Comment *string

	// The unique identifier of the plan execution containing the step to update.
	//
	// This member is required.
	ExecutionId *string

	// The Amazon Resource Name (ARN) of the plan containing the execution step to
	// update.
	//
	// This member is required.
	PlanArn *string

	// The name of the execution step to update.
	//
	// This member is required.
	StepName *string

	noSmithyDocumentSerde
}

type UpdatePlanExecutionStepOutput struct {
	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationUpdatePlanExecutionStepMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&smithyRpcv2cbor_serializeOpUpdatePlanExecutionStep{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&smithyRpcv2cbor_deserializeOpUpdatePlanExecutionStep{}, middleware.After)
	if err != nil {
		return err
	}

	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
		return err
	}
	if err = addComputeContentLength(stack); err != nil {
		return err
	}
	if err = addResolveEndpointMiddleware(stack, options); err != nil {
		return err
	}
	if err = addComputePayloadSHA256(stack); err != nil {
		return err
	}
	if err = addRecordResponseTiming(stack, options); err != nil {
		return err
	}
	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
		return err
	}
	if err = addUserAgentFeatureProtocolRPCV2CBOR(stack, options); err != nil {
		return err
	}
	if err = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpUpdatePlanExecutionStepValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "UpdatePlanExecutionStep"), middleware.Before); err != nil {
		return err
	}
	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
		return err
	}
	if err = addResponseErrorMiddleware(stack); err != nil {
		return err
	}
	if err = addRequestResponseLogging(stack, options); err != nil {
		return err
	}
	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
		return err
	}
	if err = addInterceptors(stack, options); err != nil {
		return err
	}
	return nil
}
