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 Network File System (NFS) file share. This operation is only supported
15// in the file gateway type. To leave a file share field unchanged, set the
16// corresponding input field to null. Updates the following file share settings:
17//
18// *
19// Default storage class for your S3 bucket
20//
21// * Metadata defaults for your S3
22// bucket
23//
24// * Allowed NFS clients for your file share
25//
26// * Squash settings
27//
28// * Write
29// status of your file share
30func (c *Client) UpdateNFSFileShare(ctx context.Context, params *UpdateNFSFileShareInput, optFns ...func(*Options)) (*UpdateNFSFileShareOutput, error) {
31	if params == nil {
32		params = &UpdateNFSFileShareInput{}
33	}
34
35	result, metadata, err := c.invokeOperation(ctx, "UpdateNFSFileShare", params, optFns, addOperationUpdateNFSFileShareMiddlewares)
36	if err != nil {
37		return nil, err
38	}
39
40	out := result.(*UpdateNFSFileShareOutput)
41	out.ResultMetadata = metadata
42	return out, nil
43}
44
45// UpdateNFSFileShareInput
46type UpdateNFSFileShareInput struct {
47
48	// The Amazon Resource Name (ARN) of the file share to be updated.
49	//
50	// This member is required.
51	FileShareARN *string
52
53	// specifies refresh cache information for the file share.
54	CacheAttributes *types.CacheAttributes
55
56	// The list of clients that are allowed to access the file gateway. The list must
57	// contain either valid IP addresses or valid CIDR blocks.
58	ClientList []string
59
60	// The default storage class for objects put into an Amazon S3 bucket by the file
61	// gateway. The default value is S3_INTELLIGENT_TIERING. Optional. Valid Values:
62	// S3_STANDARD | S3_INTELLIGENT_TIERING | S3_STANDARD_IA | S3_ONEZONE_IA
63	DefaultStorageClass *string
64
65	// The name of the file share. Optional. FileShareName must be set if an S3 prefix
66	// name is set in LocationARN.
67	FileShareName *string
68
69	// A value that enables guessing of the MIME type for uploaded objects based on
70	// file extensions. Set this value to true to enable MIME type guessing, otherwise
71	// set to false. The default value is true. Valid Values: true | false
72	GuessMIMETypeEnabled *bool
73
74	// Set to true to use Amazon S3 server-side encryption with your own AWS KMS key,
75	// or false to use a key managed by Amazon S3. Optional. Valid Values: true | false
76	KMSEncrypted *bool
77
78	// The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for
79	// Amazon S3 server-side encryption. Storage Gateway does not support asymmetric
80	// CMKs. This value can only be set when KMSEncrypted is true. Optional.
81	KMSKey *string
82
83	// The default values for the file share. Optional.
84	NFSFileShareDefaults *types.NFSFileShareDefaults
85
86	// The notification policy of the file share. SettlingTimeInSeconds controls the
87	// number of seconds to wait after the last point in time a client wrote to a file
88	// before generating an ObjectUploaded notification. Because clients can make many
89	// small writes to files, it's best to set this parameter for as long as possible
90	// to avoid generating multiple notifications for the same file in a small time
91	// period. SettlingTimeInSeconds has no effect on the timing of the object
92	// uploading to Amazon S3, only the timing of the notification. The following
93	// example sets NotificationPolicy on with SettlingTimeInSeconds set to 60.
94	// {"Upload": {"SettlingTimeInSeconds": 60}} The following example sets
95	// NotificationPolicy off. {}
96	NotificationPolicy *string
97
98	// A value that sets the access control list (ACL) permission for objects in the S3
99	// bucket that a file gateway puts objects into. The default value is private.
100	ObjectACL types.ObjectACL
101
102	// A value that sets the write status of a file share. Set this value to true to
103	// set the write status to read-only, otherwise set to false. Valid Values: true |
104	// false
105	ReadOnly *bool
106
107	// A value that sets who pays the cost of the request and the cost associated with
108	// data download from the S3 bucket. If this value is set to true, the requester
109	// pays the costs; otherwise, the S3 bucket owner pays. However, the S3 bucket
110	// owner always pays the cost of storing data. RequesterPays is a configuration for
111	// the S3 bucket that backs the file share, so make sure that the configuration on
112	// the file share is the same as the S3 bucket configuration. Valid Values: true |
113	// false
114	RequesterPays *bool
115
116	// The user mapped to anonymous user. Valid values are the following:
117	//
118	// *
119	// RootSquash: Only root is mapped to anonymous user.
120	//
121	// * NoSquash: No one is mapped
122	// to anonymous user.
123	//
124	// * AllSquash: Everyone is mapped to anonymous user.
125	Squash *string
126}
127
128// UpdateNFSFileShareOutput
129type UpdateNFSFileShareOutput struct {
130
131	// The Amazon Resource Name (ARN) of the updated file share.
132	FileShareARN *string
133
134	// Metadata pertaining to the operation's result.
135	ResultMetadata middleware.Metadata
136}
137
138func addOperationUpdateNFSFileShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
139	err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateNFSFileShare{}, middleware.After)
140	if err != nil {
141		return err
142	}
143	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateNFSFileShare{}, middleware.After)
144	if err != nil {
145		return err
146	}
147	if err = addSetLoggerMiddleware(stack, options); err != nil {
148		return err
149	}
150	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
151		return err
152	}
153	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
154		return err
155	}
156	if err = addResolveEndpointMiddleware(stack, options); err != nil {
157		return err
158	}
159	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
160		return err
161	}
162	if err = addRetryMiddlewares(stack, options); err != nil {
163		return err
164	}
165	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
166		return err
167	}
168	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
169		return err
170	}
171	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
172		return err
173	}
174	if err = addClientUserAgent(stack); err != nil {
175		return err
176	}
177	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
178		return err
179	}
180	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
181		return err
182	}
183	if err = addOpUpdateNFSFileShareValidationMiddleware(stack); err != nil {
184		return err
185	}
186	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNFSFileShare(options.Region), middleware.Before); err != nil {
187		return err
188	}
189	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
190		return err
191	}
192	if err = addResponseErrorMiddleware(stack); err != nil {
193		return err
194	}
195	if err = addRequestResponseLogging(stack, options); err != nil {
196		return err
197	}
198	return nil
199}
200
201func newServiceMetadataMiddleware_opUpdateNFSFileShare(region string) *awsmiddleware.RegisterServiceMetadata {
202	return &awsmiddleware.RegisterServiceMetadata{
203		Region:        region,
204		ServiceID:     ServiceID,
205		SigningName:   "storagegateway",
206		OperationName: "UpdateNFSFileShare",
207	}
208}
209