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 the audit logs.
59	AuditDestinationARN *string
60
61	// Refresh cache information.
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.
99	NotificationPolicy *string
100
101	// A value that sets the access control list (ACL) permission for objects in the S3
102	// bucket that a file gateway puts objects into. The default value is private.
103	ObjectACL types.ObjectACL
104
105	// A value that sets the write status of a file share. Set this value to true to
106	// set write status to read-only, otherwise set to false. Valid Values: true |
107	// false
108	ReadOnly *bool
109
110	// A value that sets who pays the cost of the request and the cost associated with
111	// data download from the S3 bucket. If this value is set to true, the requester
112	// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
113	// owner always pays the cost of storing data. RequesterPays is a configuration for
114	// the S3 bucket that backs the file share, so make sure that the configuration on
115	// the file share is the same as the S3 bucket configuration. Valid Values: true |
116	// false
117	RequesterPays *bool
118
119	// Set this value to true to enable access control list (ACL) on the SMB file
120	// share. Set it to false to map file and directory permissions to the POSIX
121	// permissions. For more information, see Using Microsoft Windows ACLs to control
122	// access to an SMB file share
123	// (https://docs.aws.amazon.com/storagegateway/latest/userguide/smb-acl.html) in
124	// the AWS Storage Gateway User Guide. Valid Values: true | false
125	SMBACLEnabled *bool
126
127	// A list of users or groups in the Active Directory that are allowed to access the
128	// file share. A group must be prefixed with the @ character. Acceptable formats
129	// include: DOMAIN\User1, user1, @group1, and @DOMAIN\group1. Can only be set if
130	// Authentication is set to ActiveDirectory.
131	ValidUserList []string
132}
133
134// UpdateSMBFileShareOutput
135type UpdateSMBFileShareOutput struct {
136
137	// The Amazon Resource Name (ARN) of the updated SMB file share.
138	FileShareARN *string
139
140	// Metadata pertaining to the operation's result.
141	ResultMetadata middleware.Metadata
142}
143
144func addOperationUpdateSMBFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
145	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSMBFileShare{}, middleware.After)
146	if err != nil {
147		return err
148	}
149	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSMBFileShare{}, middleware.After)
150	if err != nil {
151		return err
152	}
153	if err = addSetLoggerMiddleware(stack, options); err != nil {
154		return err
155	}
156	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
157		return err
158	}
159	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
160		return err
161	}
162	if err = addResolveEndpointMiddleware(stack, options); err != nil {
163		return err
164	}
165	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
166		return err
167	}
168	if err = addRetryMiddlewares(stack, options); err != nil {
169		return err
170	}
171	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
172		return err
173	}
174	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
175		return err
176	}
177	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
178		return err
179	}
180	if err = addClientUserAgent(stack); err != nil {
181		return err
182	}
183	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
184		return err
185	}
186	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
187		return err
188	}
189	if err = addOpUpdateSMBFileShareValidationMiddleware(stack); err != nil {
190		return err
191	}
192	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSMBFileShare(options.Region), middleware.Before); err != nil {
193		return err
194	}
195	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
196		return err
197	}
198	if err = addResponseErrorMiddleware(stack); err != nil {
199		return err
200	}
201	if err = addRequestResponseLogging(stack, options); err != nil {
202		return err
203	}
204	return nil
205}
206
207func newServiceMetadataMiddleware_opUpdateSMBFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
208	return &awsmiddleware.RegisterServiceMetadata{
209		Region:        region,
210		ServiceID:     ServiceID,
211		SigningName:   "storagegateway",
212		OperationName: "UpdateSMBFileShare",
213	}
214}
215