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