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

package bedrockagentcorecontrol

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

// Retrieves information about a specific payment connector.
func (c *Client) GetPaymentConnector(ctx context.Context, params *GetPaymentConnectorInput, optFns ...func(*Options)) (*GetPaymentConnectorOutput, error) {
	if params == nil {
		params = &GetPaymentConnectorInput{}
	}

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

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

type GetPaymentConnectorInput struct {

	// The unique identifier of the payment connector to retrieve.
	//
	// This member is required.
	PaymentConnectorId *string

	// The unique identifier of the parent payment manager.
	//
	// This member is required.
	PaymentManagerId *string

	noSmithyDocumentSerde
}

type GetPaymentConnectorOutput struct {

	// The timestamp when the payment connector was created.
	//
	// This member is required.
	CreatedAt *time.Time

	// The credential provider configurations for the payment connector.
	//
	// This member is required.
	CredentialProviderConfigurations []types.CredentialsProviderConfiguration

	// The timestamp when the payment connector was last updated.
	//
	// This member is required.
	LastUpdatedAt *time.Time

	// The name of the payment connector.
	//
	// This member is required.
	Name *string

	// The unique identifier of the payment connector.
	//
	// This member is required.
	PaymentConnectorId *string

	// The current status of the payment connector. Possible values include CREATING ,
	// READY , UPDATING , DELETING , CREATE_FAILED , UPDATE_FAILED , and DELETE_FAILED .
	//
	// This member is required.
	Status types.PaymentConnectorStatus

	// The type of the payment connector, which determines the payment provider
	// integration.
	//
	// This member is required.
	Type types.PaymentConnectorType

	// The description of the payment connector.
	Description *string

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

	noSmithyDocumentSerde
}

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