1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package docdb 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/docdb/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Adds an attribute and values to, or removes an attribute and values from, a 15// manual DB cluster snapshot. To share a manual cluster snapshot with other AWS 16// accounts, specify restore as the AttributeName, and use the ValuesToAdd 17// parameter to add a list of IDs of the AWS accounts that are authorized to 18// restore the manual cluster snapshot. Use the value all to make the manual 19// cluster snapshot public, which means that it can be copied or restored by all 20// AWS accounts. Do not add the all value for any manual DB cluster snapshots that 21// contain private information that you don't want available to all AWS accounts. 22// If a manual cluster snapshot is encrypted, it can be shared, but only by 23// specifying a list of authorized AWS account IDs for the ValuesToAdd parameter. 24// You can't use all as a value for that parameter in this case. 25func (c *Client) ModifyDBClusterSnapshotAttribute(ctx context.Context, params *ModifyDBClusterSnapshotAttributeInput, optFns ...func(*Options)) (*ModifyDBClusterSnapshotAttributeOutput, error) { 26 if params == nil { 27 params = &ModifyDBClusterSnapshotAttributeInput{} 28 } 29 30 result, metadata, err := c.invokeOperation(ctx, "ModifyDBClusterSnapshotAttribute", params, optFns, addOperationModifyDBClusterSnapshotAttributeMiddlewares) 31 if err != nil { 32 return nil, err 33 } 34 35 out := result.(*ModifyDBClusterSnapshotAttributeOutput) 36 out.ResultMetadata = metadata 37 return out, nil 38} 39 40// Represents the input to ModifyDBClusterSnapshotAttribute. 41type ModifyDBClusterSnapshotAttributeInput struct { 42 43 // The name of the cluster snapshot attribute to modify. To manage authorization 44 // for other AWS accounts to copy or restore a manual cluster snapshot, set this 45 // value to restore. 46 // 47 // This member is required. 48 AttributeName *string 49 50 // The identifier for the cluster snapshot to modify the attributes for. 51 // 52 // This member is required. 53 DBClusterSnapshotIdentifier *string 54 55 // A list of cluster snapshot attributes to add to the attribute specified by 56 // AttributeName. To authorize other AWS accounts to copy or restore a manual 57 // cluster snapshot, set this list to include one or more AWS account IDs. To make 58 // the manual cluster snapshot restorable by any AWS account, set it to all. Do not 59 // add the all value for any manual cluster snapshots that contain private 60 // information that you don't want to be available to all AWS accounts. 61 ValuesToAdd []string 62 63 // A list of cluster snapshot attributes to remove from the attribute specified by 64 // AttributeName. To remove authorization for other AWS accounts to copy or restore 65 // a manual cluster snapshot, set this list to include one or more AWS account 66 // identifiers. To remove authorization for any AWS account to copy or restore the 67 // cluster snapshot, set it to all . If you specify all, an AWS account whose 68 // account ID is explicitly added to the restore attribute can still copy or 69 // restore a manual cluster snapshot. 70 ValuesToRemove []string 71} 72 73type ModifyDBClusterSnapshotAttributeOutput struct { 74 75 // Detailed information about the attributes that are associated with a cluster 76 // snapshot. 77 DBClusterSnapshotAttributesResult *types.DBClusterSnapshotAttributesResult 78 79 // Metadata pertaining to the operation's result. 80 ResultMetadata middleware.Metadata 81} 82 83func addOperationModifyDBClusterSnapshotAttributeMiddlewares(stack *middleware.Stack, options Options) (err error) { 84 err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBClusterSnapshotAttribute{}, middleware.After) 85 if err != nil { 86 return err 87 } 88 err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBClusterSnapshotAttribute{}, middleware.After) 89 if err != nil { 90 return err 91 } 92 if err = addSetLoggerMiddleware(stack, options); err != nil { 93 return err 94 } 95 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 96 return err 97 } 98 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 99 return err 100 } 101 if err = addResolveEndpointMiddleware(stack, options); err != nil { 102 return err 103 } 104 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 105 return err 106 } 107 if err = addRetryMiddlewares(stack, options); err != nil { 108 return err 109 } 110 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 111 return err 112 } 113 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 114 return err 115 } 116 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 117 return err 118 } 119 if err = addClientUserAgent(stack); err != nil { 120 return err 121 } 122 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 123 return err 124 } 125 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 126 return err 127 } 128 if err = addOpModifyDBClusterSnapshotAttributeValidationMiddleware(stack); err != nil { 129 return err 130 } 131 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBClusterSnapshotAttribute(options.Region), middleware.Before); err != nil { 132 return err 133 } 134 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 135 return err 136 } 137 if err = addResponseErrorMiddleware(stack); err != nil { 138 return err 139 } 140 if err = addRequestResponseLogging(stack, options); err != nil { 141 return err 142 } 143 return nil 144} 145 146func newServiceMetadataMiddleware_opModifyDBClusterSnapshotAttribute(region string) *awsmiddleware.RegisterServiceMetadata { 147 return &awsmiddleware.RegisterServiceMetadata{ 148 Region: region, 149 ServiceID: ServiceID, 150 SigningName: "rds", 151 OperationName: "ModifyDBClusterSnapshotAttribute", 152 } 153} 154