1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package storagegateway
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/storagegateway/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates a Server Message Block (SMB) file share. This operation is only
15// supported for file gateways. To leave a file share field unchanged, set the
16// corresponding input field to null. File gateways require AWS Security Token
17// Service (AWS STS) to be activated to enable you to create a file share. Make
18// sure that AWS STS is activated in the AWS Region you are creating your file
19// gateway in. If AWS STS is not activated in this AWS Region, activate it. For
20// information about how to activate AWS STS, see Activating and deactivating AWS
21// STS in an AWS Region
22// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
23// in the AWS Identity and Access Management User Guide. File gateways don't
24// support creating hard or symbolic links on a file share.
25func (c *Client) UpdateSMBFileShare(ctx context.Context, params *UpdateSMBFileShareInput, optFns ...func(*Options)) (*UpdateSMBFileShareOutput, error) {
26	if params == nil {
27		params = &UpdateSMBFileShareInput{}
28	}
29
30	result, metadata, err := c.invokeOperation(ctx, "UpdateSMBFileShare", params, optFns, addOperationUpdateSMBFileShareMiddlewares)
31	if err != nil {
32		return nil, err
33	}
34
35	out := result.(*UpdateSMBFileShareOutput)
36	out.ResultMetadata = metadata
37	return out, nil
38}
39
40// UpdateSMBFileShareInput
41type UpdateSMBFileShareInput struct {
42
43	// The Amazon Resource Name (ARN) of the SMB file share that you want to update.
44	//
45	// This member is required.
46	FileShareARN *string
47
48	// The files and folders on this share will only be visible to users with read
49	// access.
50	AccessBasedEnumeration *bool
51
52	// A list of users or groups in the Active Directory that have administrator rights
53	// to the file share. A group must be prefixed with the @ character. Acceptable
54	// formats include: DOMAIN\User1, user1, @group1, and @DOMAIN\group1. Can only be
55	// set if Authentication is set to ActiveDirectory.
56	AdminUserList []string
57
58	// The Amazon Resource Name (ARN) of the storage used for audit logs.
59	AuditDestinationARN *string
60
61	// Specifies refresh cache information for the file share.
62	CacheAttributes *types.CacheAttributes
63
64	// The case of an object name in an Amazon S3 bucket. For ClientSpecified, the
65	// client determines the case sensitivity. For CaseSensitive, the gateway
66	// determines the case sensitivity. The default value is ClientSpecified.
67	CaseSensitivity types.CaseSensitivity
68
69	// The default storage class for objects put into an Amazon S3 bucket by the file
70	// gateway. The default value is S3_INTELLIGENT_TIERING. Optional. Valid Values:
71	// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
72	DefaultStorageClass *string
73
74	// The name of the file share. Optional. FileShareName must be set if an S3 prefix
75	// name is set in LocationARN.
76	FileShareName *string
77
78	// A value that enables guessing of the MIME type for uploaded objects based on
79	// file extensions. Set this value to true to enable MIME type guessing, otherwise
80	// set to false. The default value is true. Valid Values: true | false
81	GuessMIMETypeEnabled *bool
82
83	// A list of users or groups in the Active Directory that are not allowed to access
84	// the file share. A group must be prefixed with the @ character. Acceptable
85	// formats include: DOMAIN\User1, user1, @group1, and @DOMAIN\group1. Can only be
86	// set if Authentication is set to ActiveDirectory.
87	InvalidUserList []string
88
89	// Set to true to use Amazon S3 server-side encryption with your own AWS KMS key,
90	// or false to use a key managed by Amazon S3. Optional. Valid Values: true | false
91	KMSEncrypted *bool
92
93	// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for
94	// Amazon S3 server-side encryption. Storage Gateway does not support asymmetric
95	// CMKs. This value can only be set when KMSEncrypted is true. Optional.
96	KMSKey *string
97
98	// The notification policy of the file share. SettlingTimeInSeconds controls the
99	// number of seconds to wait after the last point in time a client wrote to a file
100	// before generating an ObjectUploaded notification. Because clients can make many
101	// small writes to files, it's best to set this parameter for as long as possible
102	// to avoid generating multiple notifications for the same file in a small time
103	// period. SettlingTimeInSeconds has no effect on the timing of the object
104	// uploading to Amazon S3, only the timing of the notification. The following
105	// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
106	// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
107	// NotificationPolicy off. {}
108	NotificationPolicy *string
109
110	// A value that sets the access control list (ACL) permission for objects in the S3
111	// bucket that a file gateway puts objects into. The default value is private.
112	ObjectACL types.ObjectACL
113
114	// A value that sets the write status of a file share. Set this value to true to
115	// set write status to read-only, otherwise set to false. Valid Values: true |
116	// false
117	ReadOnly *bool
118
119	// A value that sets who pays the cost of the request and the cost associated with
120	// data download from the S3 bucket. If this value is set to true, the requester
121	// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
122	// owner always pays the cost of storing data. RequesterPays is a configuration for
123	// the S3 bucket that backs the file share, so make sure that the configuration on
124	// the file share is the same as the S3 bucket configuration. Valid Values: true |
125	// false
126	RequesterPays *bool
127
128	// Set this value to true to enable access control list (ACL) on the SMB file
129	// share. Set it to false to map file and directory permissions to the POSIX
130	// permissions. For more information, see Using Microsoft Windows ACLs to control
131	// access to an SMB file share
132	// (https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.html) in
133	// the AWS Storage Gateway User Guide. Valid Values: true | false
134	SMBACLEnabled *bool
135
136	// A list of users or groups in the Active Directory that are allowed to access the
137	// file share. A group must be prefixed with the @ character. Acceptable formats
138	// include: DOMAIN\User1, user1, @group1, and @DOMAIN\group1. Can only be set if
139	// Authentication is set to ActiveDirectory.
140	ValidUserList []string
141}
142
143// UpdateSMBFileShareOutput
144type UpdateSMBFileShareOutput struct {
145
146	// The Amazon Resource Name (ARN) of the updated SMB file share.
147	FileShareARN *string
148
149	// Metadata pertaining to the operation's result.
150	ResultMetadata middleware.Metadata
151}
152
153func addOperationUpdateSMBFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
154	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSMBFileShare{}, middleware.After)
155	if err != nil {
156		return err
157	}
158	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSMBFileShare{}, middleware.After)
159	if err != nil {
160		return err
161	}
162	if err = addSetLoggerMiddleware(stack, options); err != nil {
163		return err
164	}
165	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
166		return err
167	}
168	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
169		return err
170	}
171	if err = addResolveEndpointMiddleware(stack, options); err != nil {
172		return err
173	}
174	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
175		return err
176	}
177	if err = addRetryMiddlewares(stack, options); err != nil {
178		return err
179	}
180	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
181		return err
182	}
183	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
184		return err
185	}
186	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
187		return err
188	}
189	if err = addClientUserAgent(stack); err != nil {
190		return err
191	}
192	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
193		return err
194	}
195	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
196		return err
197	}
198	if err = addOpUpdateSMBFileShareValidationMiddleware(stack); err != nil {
199		return err
200	}
201	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSMBFileShare(options.Region), middleware.Before); err != nil {
202		return err
203	}
204	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
205		return err
206	}
207	if err = addResponseErrorMiddleware(stack); err != nil {
208		return err
209	}
210	if err = addRequestResponseLogging(stack, options); err != nil {
211		return err
212	}
213	return nil
214}
215
216func newServiceMetadataMiddleware_opUpdateSMBFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
217	return &awsmiddleware.RegisterServiceMetadata{
218		Region:        region,
219		ServiceID:     ServiceID,
220		SigningName:   "storagegateway",
221		OperationName: "UpdateSMBFileShare",
222	}
223}
224