// 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"
)

// Get a payment session.
func (c *Client) GetPaymentSession(ctx context.Context, params *GetPaymentSessionInput, optFns ...func(*Options)) (*GetPaymentSessionOutput, error) {
	if params == nil {
		params = &GetPaymentSessionInput{}
	}

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

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

// Request structure for getting a payment session.
type GetPaymentSessionInput struct {

	// The ARN of the payment manager that owns this session.
	//
	// This member is required.
	PaymentManagerArn *string

	// The ID of the payment session to retrieve.
	//
	// This member is required.
	PaymentSessionId *string

	// The agent name associated with this request, used for observability.
	AgentName *string

	// The user ID associated with this payment session.
	UserId *string

	noSmithyDocumentSerde
}

// Response structure for getting a payment session.
type GetPaymentSessionOutput struct {

	// The payment session details.
	//
	// This member is required.
	PaymentSession *types.PaymentSession

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

	noSmithyDocumentSerde
}

func (c *Client) addOperationGetPaymentSessionMiddlewares(stack *middleware.Stack, options Options) (err error) {
	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPaymentSession{}, middleware.After)
	if err != nil {
		return err
	}
	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPaymentSession{}, 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 = addOpGetPaymentSessionValidationMiddleware(stack); err != nil {
		return err
	}
	if err = stack.Initialize.Add(newServiceMetadataMiddleware(options.Region, "GetPaymentSession"), 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
}
