// 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 a metadata-only summary of a specific policy engine without
// decrypting customer content. This lightweight read operation returns resource
// identifiers, status, timestamps, and the encryption key ARN, but does not
// include the description or status reasons. Because this operation does not
// require access to the customer's KMS key, it is suitable for resource discovery,
// inventory, and integration scenarios where only metadata is needed.
func (c *Client) GetPolicyEngineSummary(ctx context.Context, params *GetPolicyEngineSummaryInput, optFns ...func(*Options)) (*GetPolicyEngineSummaryOutput, error) {
	if params == nil {
		params = &GetPolicyEngineSummaryInput{}
	}

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

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

type GetPolicyEngineSummaryInput struct {

	// The unique identifier of the policy engine to retrieve the summary for. This
	// must be a valid policy engine ID that exists within the account.
	//
	// This member is required.
	PolicyEngineId *string

	noSmithyDocumentSerde
}

type GetPolicyEngineSummaryOutput struct {

	// The timestamp when the policy engine was originally created.
	//
	// This member is required.
	CreatedAt *time.Time

	// The customer-assigned name of the policy engine.
	//
	// This member is required.
	Name *string

	// The Amazon Resource Name (ARN) of the policy engine.
	//
	// This member is required.
	PolicyEngineArn *string

	// The unique identifier of the policy engine.
	//
	// This member is required.
	PolicyEngineId *string

	// The current status of the policy engine.
	//
	// This member is required.
	Status types.PolicyEngineStatus

	// The timestamp when the policy engine was last modified.
	//
	// This member is required.
	UpdatedAt *time.Time

	// The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy engine
	// data.
	EncryptionKeyArn *string

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

	noSmithyDocumentSerde
}

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