-
Notifications
You must be signed in to change notification settings - Fork 604
/
api_op_RefreshCache.go
159 lines (133 loc) · 5.42 KB
/
api_op_RefreshCache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package storagegateway
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// RefreshCacheInput
// Please also see https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/RefreshCacheInput
type RefreshCacheInput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the file share you want to refresh.
//
// FileShareARN is a required field
FileShareARN *string `min:"50" type:"string" required:"true"`
// A comma-separated list of the paths of folders to refresh in the cache. The
// default is ["/"]. The default refreshes objects and folders at the root of
// the Amazon S3 bucket. If Recursive is set to "true", the entire S3 bucket
// that the file share has access to is refreshed.
FolderList []string `min:"1" type:"list"`
// A value that specifies whether to recursively refresh folders in the cache.
// The refresh includes folders that were in the cache the last time the gateway
// listed the folder's contents. If this value set to "true", each folder that
// is listed in FolderList is recursively updated. Otherwise, subfolders listed
// in FolderList are not refreshed. Only objects that are in folders listed
// directly under FolderList are found and used for the update. The default
// is "true".
Recursive *bool `type:"boolean"`
}
// String returns the string representation
func (s RefreshCacheInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *RefreshCacheInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "RefreshCacheInput"}
if s.FileShareARN == nil {
invalidParams.Add(aws.NewErrParamRequired("FileShareARN"))
}
if s.FileShareARN != nil && len(*s.FileShareARN) < 50 {
invalidParams.Add(aws.NewErrParamMinLen("FileShareARN", 50))
}
if s.FolderList != nil && len(s.FolderList) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("FolderList", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// RefreshCacheOutput
// Please also see https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/RefreshCacheOutput
type RefreshCacheOutput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the file share.
FileShareARN *string `min:"50" type:"string"`
// The randomly generated ID of the notification that was sent. This ID is in
// UUID format.
NotificationId *string `min:"1" type:"string"`
}
// String returns the string representation
func (s RefreshCacheOutput) String() string {
return awsutil.Prettify(s)
}
const opRefreshCache = "RefreshCache"
// RefreshCacheRequest returns a request value for making API operation for
// AWS Storage Gateway.
//
// Refreshes the cache for the specified file share. This operation finds objects
// in the Amazon S3 bucket that were added, removed or replaced since the gateway
// last listed the bucket's contents and cached the results. This operation
// is only supported in the file gateway type. You can subscribe to be notified
// through an Amazon CloudWatch event when your RefreshCache operation completes.
// For more information, see Getting Notified About File Operations (https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-notification).
//
// When this API is called, it only initiates the refresh operation. When the
// API call completes and returns a success code, it doesn't necessarily mean
// that the file refresh has completed. You should use the refresh-complete
// notification to determine that the operation has completed before you check
// for new files on the gateway file share. You can subscribe to be notified
// through an CloudWatch event when your RefreshCache operation completes.
//
// // Example sending a request using RefreshCacheRequest.
// req := client.RefreshCacheRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/RefreshCache
func (c *Client) RefreshCacheRequest(input *RefreshCacheInput) RefreshCacheRequest {
op := &aws.Operation{
Name: opRefreshCache,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RefreshCacheInput{}
}
req := c.newRequest(op, input, &RefreshCacheOutput{})
return RefreshCacheRequest{Request: req, Input: input, Copy: c.RefreshCacheRequest}
}
// RefreshCacheRequest is the request type for the
// RefreshCache API operation.
type RefreshCacheRequest struct {
*aws.Request
Input *RefreshCacheInput
Copy func(*RefreshCacheInput) RefreshCacheRequest
}
// Send marshals and sends the RefreshCache API request.
func (r RefreshCacheRequest) Send(ctx context.Context) (*RefreshCacheResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &RefreshCacheResponse{
RefreshCacheOutput: r.Request.Data.(*RefreshCacheOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// RefreshCacheResponse is the response type for the
// RefreshCache API operation.
type RefreshCacheResponse struct {
*RefreshCacheOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// RefreshCache request.
func (r *RefreshCacheResponse) SDKResponseMetdata() *aws.Response {
return r.response
}