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

package bedrockagentcore

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

// Deletes a payment instrument. This is a soft delete operation that preserves
// the record for audit and compliance purposes.
func (c *Client) DeletePaymentInstrument(ctx context.Context, params *DeletePaymentInstrumentInput, optFns ...func(*Options)) (*DeletePaymentInstrumentOutput, error) {
	if params == nil {
		params = &DeletePaymentInstrumentInput{}
	}

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

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

// Request structure for deleting a payment instrument.
type DeletePaymentInstrumentInput struct {

	// The payment connector ID. Must match the instrument's paymentConnectorId.
	//
	// This member is required.
	PaymentConnectorId *string

	// The payment instrument ID to delete.
	//
	// This member is required.
	PaymentInstrumentId *string

	// The payment manager ARN. Must match the instrument's paymentManagerArn.
	//
	// This member is required.
	PaymentManagerArn *string

	// The user ID making the delete request. Must match the instrument's userId.
	UserId *string

	noSmithyDocumentSerde
}

// Response structure for deleting a payment instrument.
type DeletePaymentInstrumentOutput struct {

	// The status of the instrument after deletion. Always DELETED for successful soft
	// delete.
	//
	// This member is required.
	Status types.PaymentInstrumentStatus

	// Metadata pertaining to the operation's result.
	ResultMetadata middleware.Metadata

	noSmithyDocumentSerde
}

func (c *Client) addOperationDeletePaymentInstrumentMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePaymentInstrument{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePaymentInstrument{}, 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 = addCredentialSource(stack, options); err != nil {
		return err
	}
	if err = addOpDeletePaymentInstrumentValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "DeletePaymentInstrument"), 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
}
