123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- // Code generated by smithy-go-codegen DO NOT EDIT.
- package cloudwatchlogs
- import (
- "context"
- "fmt"
- awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
- "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
- "github.com/aws/smithy-go/middleware"
- smithyhttp "github.com/aws/smithy-go/transport/http"
- )
- // Returns information about a log group data protection policy.
- func (c *Client) GetDataProtectionPolicy(ctx context.Context, params *GetDataProtectionPolicyInput, optFns ...func(*Options)) (*GetDataProtectionPolicyOutput, error) {
- if params == nil {
- params = &GetDataProtectionPolicyInput{}
- }
- result, metadata, err := c.invokeOperation(ctx, "GetDataProtectionPolicy", params, optFns, c.addOperationGetDataProtectionPolicyMiddlewares)
- if err != nil {
- return nil, err
- }
- out := result.(*GetDataProtectionPolicyOutput)
- out.ResultMetadata = metadata
- return out, nil
- }
- type GetDataProtectionPolicyInput struct {
- // The name or ARN of the log group that contains the data protection policy that
- // you want to see.
- //
- // This member is required.
- LogGroupIdentifier *string
- noSmithyDocumentSerde
- }
- type GetDataProtectionPolicyOutput struct {
- // The date and time that this policy was most recently updated.
- LastUpdatedTime *int64
- // The log group name or ARN that you specified in your request.
- LogGroupIdentifier *string
- // The data protection policy document for this log group.
- PolicyDocument *string
- // Metadata pertaining to the operation's result.
- ResultMetadata middleware.Metadata
- noSmithyDocumentSerde
- }
- func (c *Client) addOperationGetDataProtectionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
- if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
- return err
- }
- err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDataProtectionPolicy{}, middleware.After)
- if err != nil {
- return err
- }
- err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDataProtectionPolicy{}, middleware.After)
- if err != nil {
- return err
- }
- if err := addProtocolFinalizerMiddlewares(stack, options, "GetDataProtectionPolicy"); err != nil {
- return fmt.Errorf("add protocol finalizers: %v", err)
- }
- if err = addlegacyEndpointContextSetter(stack, options); err != nil {
- return err
- }
- if err = addSetLoggerMiddleware(stack, options); err != nil {
- return err
- }
- if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
- return err
- }
- if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
- return err
- }
- if err = addResolveEndpointMiddleware(stack, options); err != nil {
- return err
- }
- if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
- return err
- }
- if err = addRetryMiddlewares(stack, options); err != nil {
- return err
- }
- if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
- return err
- }
- if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
- return err
- }
- if err = addClientUserAgent(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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
- return err
- }
- if err = addOpGetDataProtectionPolicyValidationMiddleware(stack); err != nil {
- return err
- }
- if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataProtectionPolicy(options.Region), middleware.Before); err != nil {
- return err
- }
- if err = awsmiddleware.AddRecursionDetection(stack); 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
- }
- return nil
- }
- func newServiceMetadataMiddleware_opGetDataProtectionPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
- return &awsmiddleware.RegisterServiceMetadata{
- Region: region,
- ServiceID: ServiceID,
- OperationName: "GetDataProtectionPolicy",
- }
- }
|