// 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 manager.
func (c *Client) GetPaymentManager(ctx context.Context, params *GetPaymentManagerInput, optFns ...func(*Options)) (*GetPaymentManagerOutput, error) {
	if params == nil {
		params = &GetPaymentManagerInput{}
	}

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

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

type GetPaymentManagerInput struct {

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

	noSmithyDocumentSerde
}

type GetPaymentManagerOutput struct {

	// The type of authorizer used by the payment manager.
	//
	//   - CUSTOM_JWT - Authorize with a bearer token.
	//
	//   - AWS_IAM - Authorize with your Amazon Web Services IAM credentials.
	//
	// This member is required.
	AuthorizerType types.PaymentsAuthorizerType

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

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

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

	// The Amazon Resource Name (ARN) of the payment manager.
	//
	// This member is required.
	PaymentManagerArn *string

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

	// The Amazon Resource Name (ARN) of the IAM role associated with the payment
	// manager.
	//
	// This member is required.
	RoleArn *string

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

	// Represents inbound authorization configuration options used to authenticate
	// incoming requests.
	AuthorizerConfiguration types.AuthorizerConfiguration

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

	// The tags associated with the payment manager.
	Tags map[string]string

	// The information about the workload identity.
	WorkloadIdentityDetails *types.WorkloadIdentityDetails

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

	noSmithyDocumentSerde
}

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