1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package dlm
4
5import (
6	"fmt"
7	"time"
8
9	"github.com/aws/aws-sdk-go/aws"
10	"github.com/aws/aws-sdk-go/aws/awsutil"
11	"github.com/aws/aws-sdk-go/aws/request"
12	"github.com/aws/aws-sdk-go/private/protocol"
13	"github.com/aws/aws-sdk-go/private/protocol/restjson"
14)
15
16const opCreateLifecyclePolicy = "CreateLifecyclePolicy"
17
18// CreateLifecyclePolicyRequest generates a "aws/request.Request" representing the
19// client's request for the CreateLifecyclePolicy operation. The "output" return
20// value will be populated with the request's response once the request completes
21// successfully.
22//
23// Use "Send" method on the returned Request to send the API call to the service.
24// the "output" return value is not valid until after Send returns without error.
25//
26// See CreateLifecyclePolicy for more information on using the CreateLifecyclePolicy
27// API call, and error handling.
28//
29// This method is useful when you want to inject custom logic or configuration
30// into the SDK's request lifecycle. Such as custom headers, or retry logic.
31//
32//
33//    // Example sending a request using the CreateLifecyclePolicyRequest method.
34//    req, resp := client.CreateLifecyclePolicyRequest(params)
35//
36//    err := req.Send()
37//    if err == nil { // resp is now filled
38//        fmt.Println(resp)
39//    }
40//
41// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/CreateLifecyclePolicy
42func (c *DLM) CreateLifecyclePolicyRequest(input *CreateLifecyclePolicyInput) (req *request.Request, output *CreateLifecyclePolicyOutput) {
43	op := &request.Operation{
44		Name:       opCreateLifecyclePolicy,
45		HTTPMethod: "POST",
46		HTTPPath:   "/policies",
47	}
48
49	if input == nil {
50		input = &CreateLifecyclePolicyInput{}
51	}
52
53	output = &CreateLifecyclePolicyOutput{}
54	req = c.newRequest(op, input, output)
55	return
56}
57
58// CreateLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
59//
60// Creates a policy to manage the lifecycle of the specified AWS resources.
61// You can create up to 100 lifecycle policies.
62//
63// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
64// with awserr.Error's Code and Message methods to get detailed information about
65// the error.
66//
67// See the AWS API reference guide for Amazon Data Lifecycle Manager's
68// API operation CreateLifecyclePolicy for usage and error information.
69//
70// Returned Error Types:
71//   * InvalidRequestException
72//   Bad request. The request is missing required parameters or has invalid parameters.
73//
74//   * LimitExceededException
75//   The request failed because a limit was exceeded.
76//
77//   * InternalServerException
78//   The service failed in an unexpected way.
79//
80// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/CreateLifecyclePolicy
81func (c *DLM) CreateLifecyclePolicy(input *CreateLifecyclePolicyInput) (*CreateLifecyclePolicyOutput, error) {
82	req, out := c.CreateLifecyclePolicyRequest(input)
83	return out, req.Send()
84}
85
86// CreateLifecyclePolicyWithContext is the same as CreateLifecyclePolicy with the addition of
87// the ability to pass a context and additional request options.
88//
89// See CreateLifecyclePolicy for details on how to use this API operation.
90//
91// The context must be non-nil and will be used for request cancellation. If
92// the context is nil a panic will occur. In the future the SDK may create
93// sub-contexts for http.Requests. See https://golang.org/pkg/context/
94// for more information on using Contexts.
95func (c *DLM) CreateLifecyclePolicyWithContext(ctx aws.Context, input *CreateLifecyclePolicyInput, opts ...request.Option) (*CreateLifecyclePolicyOutput, error) {
96	req, out := c.CreateLifecyclePolicyRequest(input)
97	req.SetContext(ctx)
98	req.ApplyOptions(opts...)
99	return out, req.Send()
100}
101
102const opDeleteLifecyclePolicy = "DeleteLifecyclePolicy"
103
104// DeleteLifecyclePolicyRequest generates a "aws/request.Request" representing the
105// client's request for the DeleteLifecyclePolicy operation. The "output" return
106// value will be populated with the request's response once the request completes
107// successfully.
108//
109// Use "Send" method on the returned Request to send the API call to the service.
110// the "output" return value is not valid until after Send returns without error.
111//
112// See DeleteLifecyclePolicy for more information on using the DeleteLifecyclePolicy
113// API call, and error handling.
114//
115// This method is useful when you want to inject custom logic or configuration
116// into the SDK's request lifecycle. Such as custom headers, or retry logic.
117//
118//
119//    // Example sending a request using the DeleteLifecyclePolicyRequest method.
120//    req, resp := client.DeleteLifecyclePolicyRequest(params)
121//
122//    err := req.Send()
123//    if err == nil { // resp is now filled
124//        fmt.Println(resp)
125//    }
126//
127// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/DeleteLifecyclePolicy
128func (c *DLM) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) (req *request.Request, output *DeleteLifecyclePolicyOutput) {
129	op := &request.Operation{
130		Name:       opDeleteLifecyclePolicy,
131		HTTPMethod: "DELETE",
132		HTTPPath:   "/policies/{policyId}/",
133	}
134
135	if input == nil {
136		input = &DeleteLifecyclePolicyInput{}
137	}
138
139	output = &DeleteLifecyclePolicyOutput{}
140	req = c.newRequest(op, input, output)
141	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
142	return
143}
144
145// DeleteLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
146//
147// Deletes the specified lifecycle policy and halts the automated operations
148// that the policy specified.
149//
150// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
151// with awserr.Error's Code and Message methods to get detailed information about
152// the error.
153//
154// See the AWS API reference guide for Amazon Data Lifecycle Manager's
155// API operation DeleteLifecyclePolicy for usage and error information.
156//
157// Returned Error Types:
158//   * ResourceNotFoundException
159//   A requested resource was not found.
160//
161//   * InternalServerException
162//   The service failed in an unexpected way.
163//
164//   * LimitExceededException
165//   The request failed because a limit was exceeded.
166//
167// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/DeleteLifecyclePolicy
168func (c *DLM) DeleteLifecyclePolicy(input *DeleteLifecyclePolicyInput) (*DeleteLifecyclePolicyOutput, error) {
169	req, out := c.DeleteLifecyclePolicyRequest(input)
170	return out, req.Send()
171}
172
173// DeleteLifecyclePolicyWithContext is the same as DeleteLifecyclePolicy with the addition of
174// the ability to pass a context and additional request options.
175//
176// See DeleteLifecyclePolicy for details on how to use this API operation.
177//
178// The context must be non-nil and will be used for request cancellation. If
179// the context is nil a panic will occur. In the future the SDK may create
180// sub-contexts for http.Requests. See https://golang.org/pkg/context/
181// for more information on using Contexts.
182func (c *DLM) DeleteLifecyclePolicyWithContext(ctx aws.Context, input *DeleteLifecyclePolicyInput, opts ...request.Option) (*DeleteLifecyclePolicyOutput, error) {
183	req, out := c.DeleteLifecyclePolicyRequest(input)
184	req.SetContext(ctx)
185	req.ApplyOptions(opts...)
186	return out, req.Send()
187}
188
189const opGetLifecyclePolicies = "GetLifecyclePolicies"
190
191// GetLifecyclePoliciesRequest generates a "aws/request.Request" representing the
192// client's request for the GetLifecyclePolicies operation. The "output" return
193// value will be populated with the request's response once the request completes
194// successfully.
195//
196// Use "Send" method on the returned Request to send the API call to the service.
197// the "output" return value is not valid until after Send returns without error.
198//
199// See GetLifecyclePolicies for more information on using the GetLifecyclePolicies
200// API call, and error handling.
201//
202// This method is useful when you want to inject custom logic or configuration
203// into the SDK's request lifecycle. Such as custom headers, or retry logic.
204//
205//
206//    // Example sending a request using the GetLifecyclePoliciesRequest method.
207//    req, resp := client.GetLifecyclePoliciesRequest(params)
208//
209//    err := req.Send()
210//    if err == nil { // resp is now filled
211//        fmt.Println(resp)
212//    }
213//
214// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicies
215func (c *DLM) GetLifecyclePoliciesRequest(input *GetLifecyclePoliciesInput) (req *request.Request, output *GetLifecyclePoliciesOutput) {
216	op := &request.Operation{
217		Name:       opGetLifecyclePolicies,
218		HTTPMethod: "GET",
219		HTTPPath:   "/policies",
220	}
221
222	if input == nil {
223		input = &GetLifecyclePoliciesInput{}
224	}
225
226	output = &GetLifecyclePoliciesOutput{}
227	req = c.newRequest(op, input, output)
228	return
229}
230
231// GetLifecyclePolicies API operation for Amazon Data Lifecycle Manager.
232//
233// Gets summary information about all or the specified data lifecycle policies.
234//
235// To get complete information about a policy, use GetLifecyclePolicy.
236//
237// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
238// with awserr.Error's Code and Message methods to get detailed information about
239// the error.
240//
241// See the AWS API reference guide for Amazon Data Lifecycle Manager's
242// API operation GetLifecyclePolicies for usage and error information.
243//
244// Returned Error Types:
245//   * ResourceNotFoundException
246//   A requested resource was not found.
247//
248//   * InvalidRequestException
249//   Bad request. The request is missing required parameters or has invalid parameters.
250//
251//   * InternalServerException
252//   The service failed in an unexpected way.
253//
254//   * LimitExceededException
255//   The request failed because a limit was exceeded.
256//
257// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicies
258func (c *DLM) GetLifecyclePolicies(input *GetLifecyclePoliciesInput) (*GetLifecyclePoliciesOutput, error) {
259	req, out := c.GetLifecyclePoliciesRequest(input)
260	return out, req.Send()
261}
262
263// GetLifecyclePoliciesWithContext is the same as GetLifecyclePolicies with the addition of
264// the ability to pass a context and additional request options.
265//
266// See GetLifecyclePolicies for details on how to use this API operation.
267//
268// The context must be non-nil and will be used for request cancellation. If
269// the context is nil a panic will occur. In the future the SDK may create
270// sub-contexts for http.Requests. See https://golang.org/pkg/context/
271// for more information on using Contexts.
272func (c *DLM) GetLifecyclePoliciesWithContext(ctx aws.Context, input *GetLifecyclePoliciesInput, opts ...request.Option) (*GetLifecyclePoliciesOutput, error) {
273	req, out := c.GetLifecyclePoliciesRequest(input)
274	req.SetContext(ctx)
275	req.ApplyOptions(opts...)
276	return out, req.Send()
277}
278
279const opGetLifecyclePolicy = "GetLifecyclePolicy"
280
281// GetLifecyclePolicyRequest generates a "aws/request.Request" representing the
282// client's request for the GetLifecyclePolicy operation. The "output" return
283// value will be populated with the request's response once the request completes
284// successfully.
285//
286// Use "Send" method on the returned Request to send the API call to the service.
287// the "output" return value is not valid until after Send returns without error.
288//
289// See GetLifecyclePolicy for more information on using the GetLifecyclePolicy
290// API call, and error handling.
291//
292// This method is useful when you want to inject custom logic or configuration
293// into the SDK's request lifecycle. Such as custom headers, or retry logic.
294//
295//
296//    // Example sending a request using the GetLifecyclePolicyRequest method.
297//    req, resp := client.GetLifecyclePolicyRequest(params)
298//
299//    err := req.Send()
300//    if err == nil { // resp is now filled
301//        fmt.Println(resp)
302//    }
303//
304// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicy
305func (c *DLM) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) (req *request.Request, output *GetLifecyclePolicyOutput) {
306	op := &request.Operation{
307		Name:       opGetLifecyclePolicy,
308		HTTPMethod: "GET",
309		HTTPPath:   "/policies/{policyId}/",
310	}
311
312	if input == nil {
313		input = &GetLifecyclePolicyInput{}
314	}
315
316	output = &GetLifecyclePolicyOutput{}
317	req = c.newRequest(op, input, output)
318	return
319}
320
321// GetLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
322//
323// Gets detailed information about the specified lifecycle policy.
324//
325// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
326// with awserr.Error's Code and Message methods to get detailed information about
327// the error.
328//
329// See the AWS API reference guide for Amazon Data Lifecycle Manager's
330// API operation GetLifecyclePolicy for usage and error information.
331//
332// Returned Error Types:
333//   * ResourceNotFoundException
334//   A requested resource was not found.
335//
336//   * InternalServerException
337//   The service failed in an unexpected way.
338//
339//   * LimitExceededException
340//   The request failed because a limit was exceeded.
341//
342// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicy
343func (c *DLM) GetLifecyclePolicy(input *GetLifecyclePolicyInput) (*GetLifecyclePolicyOutput, error) {
344	req, out := c.GetLifecyclePolicyRequest(input)
345	return out, req.Send()
346}
347
348// GetLifecyclePolicyWithContext is the same as GetLifecyclePolicy with the addition of
349// the ability to pass a context and additional request options.
350//
351// See GetLifecyclePolicy for details on how to use this API operation.
352//
353// The context must be non-nil and will be used for request cancellation. If
354// the context is nil a panic will occur. In the future the SDK may create
355// sub-contexts for http.Requests. See https://golang.org/pkg/context/
356// for more information on using Contexts.
357func (c *DLM) GetLifecyclePolicyWithContext(ctx aws.Context, input *GetLifecyclePolicyInput, opts ...request.Option) (*GetLifecyclePolicyOutput, error) {
358	req, out := c.GetLifecyclePolicyRequest(input)
359	req.SetContext(ctx)
360	req.ApplyOptions(opts...)
361	return out, req.Send()
362}
363
364const opListTagsForResource = "ListTagsForResource"
365
366// ListTagsForResourceRequest generates a "aws/request.Request" representing the
367// client's request for the ListTagsForResource operation. The "output" return
368// value will be populated with the request's response once the request completes
369// successfully.
370//
371// Use "Send" method on the returned Request to send the API call to the service.
372// the "output" return value is not valid until after Send returns without error.
373//
374// See ListTagsForResource for more information on using the ListTagsForResource
375// API call, and error handling.
376//
377// This method is useful when you want to inject custom logic or configuration
378// into the SDK's request lifecycle. Such as custom headers, or retry logic.
379//
380//
381//    // Example sending a request using the ListTagsForResourceRequest method.
382//    req, resp := client.ListTagsForResourceRequest(params)
383//
384//    err := req.Send()
385//    if err == nil { // resp is now filled
386//        fmt.Println(resp)
387//    }
388//
389// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/ListTagsForResource
390func (c *DLM) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) {
391	op := &request.Operation{
392		Name:       opListTagsForResource,
393		HTTPMethod: "GET",
394		HTTPPath:   "/tags/{resourceArn}",
395	}
396
397	if input == nil {
398		input = &ListTagsForResourceInput{}
399	}
400
401	output = &ListTagsForResourceOutput{}
402	req = c.newRequest(op, input, output)
403	return
404}
405
406// ListTagsForResource API operation for Amazon Data Lifecycle Manager.
407//
408// Lists the tags for the specified resource.
409//
410// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
411// with awserr.Error's Code and Message methods to get detailed information about
412// the error.
413//
414// See the AWS API reference guide for Amazon Data Lifecycle Manager's
415// API operation ListTagsForResource for usage and error information.
416//
417// Returned Error Types:
418//   * InternalServerException
419//   The service failed in an unexpected way.
420//
421//   * InvalidRequestException
422//   Bad request. The request is missing required parameters or has invalid parameters.
423//
424//   * ResourceNotFoundException
425//   A requested resource was not found.
426//
427// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/ListTagsForResource
428func (c *DLM) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) {
429	req, out := c.ListTagsForResourceRequest(input)
430	return out, req.Send()
431}
432
433// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of
434// the ability to pass a context and additional request options.
435//
436// See ListTagsForResource for details on how to use this API operation.
437//
438// The context must be non-nil and will be used for request cancellation. If
439// the context is nil a panic will occur. In the future the SDK may create
440// sub-contexts for http.Requests. See https://golang.org/pkg/context/
441// for more information on using Contexts.
442func (c *DLM) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) {
443	req, out := c.ListTagsForResourceRequest(input)
444	req.SetContext(ctx)
445	req.ApplyOptions(opts...)
446	return out, req.Send()
447}
448
449const opTagResource = "TagResource"
450
451// TagResourceRequest generates a "aws/request.Request" representing the
452// client's request for the TagResource operation. The "output" return
453// value will be populated with the request's response once the request completes
454// successfully.
455//
456// Use "Send" method on the returned Request to send the API call to the service.
457// the "output" return value is not valid until after Send returns without error.
458//
459// See TagResource for more information on using the TagResource
460// API call, and error handling.
461//
462// This method is useful when you want to inject custom logic or configuration
463// into the SDK's request lifecycle. Such as custom headers, or retry logic.
464//
465//
466//    // Example sending a request using the TagResourceRequest method.
467//    req, resp := client.TagResourceRequest(params)
468//
469//    err := req.Send()
470//    if err == nil { // resp is now filled
471//        fmt.Println(resp)
472//    }
473//
474// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/TagResource
475func (c *DLM) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) {
476	op := &request.Operation{
477		Name:       opTagResource,
478		HTTPMethod: "POST",
479		HTTPPath:   "/tags/{resourceArn}",
480	}
481
482	if input == nil {
483		input = &TagResourceInput{}
484	}
485
486	output = &TagResourceOutput{}
487	req = c.newRequest(op, input, output)
488	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
489	return
490}
491
492// TagResource API operation for Amazon Data Lifecycle Manager.
493//
494// Adds the specified tags to the specified resource.
495//
496// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
497// with awserr.Error's Code and Message methods to get detailed information about
498// the error.
499//
500// See the AWS API reference guide for Amazon Data Lifecycle Manager's
501// API operation TagResource for usage and error information.
502//
503// Returned Error Types:
504//   * InternalServerException
505//   The service failed in an unexpected way.
506//
507//   * InvalidRequestException
508//   Bad request. The request is missing required parameters or has invalid parameters.
509//
510//   * ResourceNotFoundException
511//   A requested resource was not found.
512//
513// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/TagResource
514func (c *DLM) TagResource(input *TagResourceInput) (*TagResourceOutput, error) {
515	req, out := c.TagResourceRequest(input)
516	return out, req.Send()
517}
518
519// TagResourceWithContext is the same as TagResource with the addition of
520// the ability to pass a context and additional request options.
521//
522// See TagResource for details on how to use this API operation.
523//
524// The context must be non-nil and will be used for request cancellation. If
525// the context is nil a panic will occur. In the future the SDK may create
526// sub-contexts for http.Requests. See https://golang.org/pkg/context/
527// for more information on using Contexts.
528func (c *DLM) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) {
529	req, out := c.TagResourceRequest(input)
530	req.SetContext(ctx)
531	req.ApplyOptions(opts...)
532	return out, req.Send()
533}
534
535const opUntagResource = "UntagResource"
536
537// UntagResourceRequest generates a "aws/request.Request" representing the
538// client's request for the UntagResource operation. The "output" return
539// value will be populated with the request's response once the request completes
540// successfully.
541//
542// Use "Send" method on the returned Request to send the API call to the service.
543// the "output" return value is not valid until after Send returns without error.
544//
545// See UntagResource for more information on using the UntagResource
546// API call, and error handling.
547//
548// This method is useful when you want to inject custom logic or configuration
549// into the SDK's request lifecycle. Such as custom headers, or retry logic.
550//
551//
552//    // Example sending a request using the UntagResourceRequest method.
553//    req, resp := client.UntagResourceRequest(params)
554//
555//    err := req.Send()
556//    if err == nil { // resp is now filled
557//        fmt.Println(resp)
558//    }
559//
560// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UntagResource
561func (c *DLM) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) {
562	op := &request.Operation{
563		Name:       opUntagResource,
564		HTTPMethod: "DELETE",
565		HTTPPath:   "/tags/{resourceArn}",
566	}
567
568	if input == nil {
569		input = &UntagResourceInput{}
570	}
571
572	output = &UntagResourceOutput{}
573	req = c.newRequest(op, input, output)
574	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
575	return
576}
577
578// UntagResource API operation for Amazon Data Lifecycle Manager.
579//
580// Removes the specified tags from the specified resource.
581//
582// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
583// with awserr.Error's Code and Message methods to get detailed information about
584// the error.
585//
586// See the AWS API reference guide for Amazon Data Lifecycle Manager's
587// API operation UntagResource for usage and error information.
588//
589// Returned Error Types:
590//   * InternalServerException
591//   The service failed in an unexpected way.
592//
593//   * InvalidRequestException
594//   Bad request. The request is missing required parameters or has invalid parameters.
595//
596//   * ResourceNotFoundException
597//   A requested resource was not found.
598//
599// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UntagResource
600func (c *DLM) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) {
601	req, out := c.UntagResourceRequest(input)
602	return out, req.Send()
603}
604
605// UntagResourceWithContext is the same as UntagResource with the addition of
606// the ability to pass a context and additional request options.
607//
608// See UntagResource for details on how to use this API operation.
609//
610// The context must be non-nil and will be used for request cancellation. If
611// the context is nil a panic will occur. In the future the SDK may create
612// sub-contexts for http.Requests. See https://golang.org/pkg/context/
613// for more information on using Contexts.
614func (c *DLM) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) {
615	req, out := c.UntagResourceRequest(input)
616	req.SetContext(ctx)
617	req.ApplyOptions(opts...)
618	return out, req.Send()
619}
620
621const opUpdateLifecyclePolicy = "UpdateLifecyclePolicy"
622
623// UpdateLifecyclePolicyRequest generates a "aws/request.Request" representing the
624// client's request for the UpdateLifecyclePolicy operation. The "output" return
625// value will be populated with the request's response once the request completes
626// successfully.
627//
628// Use "Send" method on the returned Request to send the API call to the service.
629// the "output" return value is not valid until after Send returns without error.
630//
631// See UpdateLifecyclePolicy for more information on using the UpdateLifecyclePolicy
632// API call, and error handling.
633//
634// This method is useful when you want to inject custom logic or configuration
635// into the SDK's request lifecycle. Such as custom headers, or retry logic.
636//
637//
638//    // Example sending a request using the UpdateLifecyclePolicyRequest method.
639//    req, resp := client.UpdateLifecyclePolicyRequest(params)
640//
641//    err := req.Send()
642//    if err == nil { // resp is now filled
643//        fmt.Println(resp)
644//    }
645//
646// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UpdateLifecyclePolicy
647func (c *DLM) UpdateLifecyclePolicyRequest(input *UpdateLifecyclePolicyInput) (req *request.Request, output *UpdateLifecyclePolicyOutput) {
648	op := &request.Operation{
649		Name:       opUpdateLifecyclePolicy,
650		HTTPMethod: "PATCH",
651		HTTPPath:   "/policies/{policyId}",
652	}
653
654	if input == nil {
655		input = &UpdateLifecyclePolicyInput{}
656	}
657
658	output = &UpdateLifecyclePolicyOutput{}
659	req = c.newRequest(op, input, output)
660	req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
661	return
662}
663
664// UpdateLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
665//
666// Updates the specified lifecycle policy.
667//
668// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
669// with awserr.Error's Code and Message methods to get detailed information about
670// the error.
671//
672// See the AWS API reference guide for Amazon Data Lifecycle Manager's
673// API operation UpdateLifecyclePolicy for usage and error information.
674//
675// Returned Error Types:
676//   * ResourceNotFoundException
677//   A requested resource was not found.
678//
679//   * InvalidRequestException
680//   Bad request. The request is missing required parameters or has invalid parameters.
681//
682//   * InternalServerException
683//   The service failed in an unexpected way.
684//
685//   * LimitExceededException
686//   The request failed because a limit was exceeded.
687//
688// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UpdateLifecyclePolicy
689func (c *DLM) UpdateLifecyclePolicy(input *UpdateLifecyclePolicyInput) (*UpdateLifecyclePolicyOutput, error) {
690	req, out := c.UpdateLifecyclePolicyRequest(input)
691	return out, req.Send()
692}
693
694// UpdateLifecyclePolicyWithContext is the same as UpdateLifecyclePolicy with the addition of
695// the ability to pass a context and additional request options.
696//
697// See UpdateLifecyclePolicy for details on how to use this API operation.
698//
699// The context must be non-nil and will be used for request cancellation. If
700// the context is nil a panic will occur. In the future the SDK may create
701// sub-contexts for http.Requests. See https://golang.org/pkg/context/
702// for more information on using Contexts.
703func (c *DLM) UpdateLifecyclePolicyWithContext(ctx aws.Context, input *UpdateLifecyclePolicyInput, opts ...request.Option) (*UpdateLifecyclePolicyOutput, error) {
704	req, out := c.UpdateLifecyclePolicyRequest(input)
705	req.SetContext(ctx)
706	req.ApplyOptions(opts...)
707	return out, req.Send()
708}
709
710// Specifies an action for an event-based policy.
711type Action struct {
712	_ struct{} `type:"structure"`
713
714	// The rule for copying shared snapshots across Regions.
715	//
716	// CrossRegionCopy is a required field
717	CrossRegionCopy []*CrossRegionCopyAction `type:"list" required:"true"`
718
719	// A descriptive name for the action.
720	//
721	// Name is a required field
722	Name *string `type:"string" required:"true"`
723}
724
725// String returns the string representation
726func (s Action) String() string {
727	return awsutil.Prettify(s)
728}
729
730// GoString returns the string representation
731func (s Action) GoString() string {
732	return s.String()
733}
734
735// Validate inspects the fields of the type to determine if they are valid.
736func (s *Action) Validate() error {
737	invalidParams := request.ErrInvalidParams{Context: "Action"}
738	if s.CrossRegionCopy == nil {
739		invalidParams.Add(request.NewErrParamRequired("CrossRegionCopy"))
740	}
741	if s.Name == nil {
742		invalidParams.Add(request.NewErrParamRequired("Name"))
743	}
744	if s.CrossRegionCopy != nil {
745		for i, v := range s.CrossRegionCopy {
746			if v == nil {
747				continue
748			}
749			if err := v.Validate(); err != nil {
750				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CrossRegionCopy", i), err.(request.ErrInvalidParams))
751			}
752		}
753	}
754
755	if invalidParams.Len() > 0 {
756		return invalidParams
757	}
758	return nil
759}
760
761// SetCrossRegionCopy sets the CrossRegionCopy field's value.
762func (s *Action) SetCrossRegionCopy(v []*CrossRegionCopyAction) *Action {
763	s.CrossRegionCopy = v
764	return s
765}
766
767// SetName sets the Name field's value.
768func (s *Action) SetName(v string) *Action {
769	s.Name = &v
770	return s
771}
772
773type CreateLifecyclePolicyInput struct {
774	_ struct{} `type:"structure"`
775
776	// A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$ are
777	// supported.
778	//
779	// Description is a required field
780	Description *string `type:"string" required:"true"`
781
782	// The Amazon Resource Name (ARN) of the IAM role used to run the operations
783	// specified by the lifecycle policy.
784	//
785	// ExecutionRoleArn is a required field
786	ExecutionRoleArn *string `type:"string" required:"true"`
787
788	// The configuration details of the lifecycle policy.
789	//
790	// PolicyDetails is a required field
791	PolicyDetails *PolicyDetails `type:"structure" required:"true"`
792
793	// The desired activation state of the lifecycle policy after creation.
794	//
795	// State is a required field
796	State *string `type:"string" required:"true" enum:"SettablePolicyStateValues"`
797
798	// The tags to apply to the lifecycle policy during creation.
799	Tags map[string]*string `min:"1" type:"map"`
800}
801
802// String returns the string representation
803func (s CreateLifecyclePolicyInput) String() string {
804	return awsutil.Prettify(s)
805}
806
807// GoString returns the string representation
808func (s CreateLifecyclePolicyInput) GoString() string {
809	return s.String()
810}
811
812// Validate inspects the fields of the type to determine if they are valid.
813func (s *CreateLifecyclePolicyInput) Validate() error {
814	invalidParams := request.ErrInvalidParams{Context: "CreateLifecyclePolicyInput"}
815	if s.Description == nil {
816		invalidParams.Add(request.NewErrParamRequired("Description"))
817	}
818	if s.ExecutionRoleArn == nil {
819		invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn"))
820	}
821	if s.PolicyDetails == nil {
822		invalidParams.Add(request.NewErrParamRequired("PolicyDetails"))
823	}
824	if s.State == nil {
825		invalidParams.Add(request.NewErrParamRequired("State"))
826	}
827	if s.Tags != nil && len(s.Tags) < 1 {
828		invalidParams.Add(request.NewErrParamMinLen("Tags", 1))
829	}
830	if s.PolicyDetails != nil {
831		if err := s.PolicyDetails.Validate(); err != nil {
832			invalidParams.AddNested("PolicyDetails", err.(request.ErrInvalidParams))
833		}
834	}
835
836	if invalidParams.Len() > 0 {
837		return invalidParams
838	}
839	return nil
840}
841
842// SetDescription sets the Description field's value.
843func (s *CreateLifecyclePolicyInput) SetDescription(v string) *CreateLifecyclePolicyInput {
844	s.Description = &v
845	return s
846}
847
848// SetExecutionRoleArn sets the ExecutionRoleArn field's value.
849func (s *CreateLifecyclePolicyInput) SetExecutionRoleArn(v string) *CreateLifecyclePolicyInput {
850	s.ExecutionRoleArn = &v
851	return s
852}
853
854// SetPolicyDetails sets the PolicyDetails field's value.
855func (s *CreateLifecyclePolicyInput) SetPolicyDetails(v *PolicyDetails) *CreateLifecyclePolicyInput {
856	s.PolicyDetails = v
857	return s
858}
859
860// SetState sets the State field's value.
861func (s *CreateLifecyclePolicyInput) SetState(v string) *CreateLifecyclePolicyInput {
862	s.State = &v
863	return s
864}
865
866// SetTags sets the Tags field's value.
867func (s *CreateLifecyclePolicyInput) SetTags(v map[string]*string) *CreateLifecyclePolicyInput {
868	s.Tags = v
869	return s
870}
871
872type CreateLifecyclePolicyOutput struct {
873	_ struct{} `type:"structure"`
874
875	// The identifier of the lifecycle policy.
876	PolicyId *string `type:"string"`
877}
878
879// String returns the string representation
880func (s CreateLifecyclePolicyOutput) String() string {
881	return awsutil.Prettify(s)
882}
883
884// GoString returns the string representation
885func (s CreateLifecyclePolicyOutput) GoString() string {
886	return s.String()
887}
888
889// SetPolicyId sets the PolicyId field's value.
890func (s *CreateLifecyclePolicyOutput) SetPolicyId(v string) *CreateLifecyclePolicyOutput {
891	s.PolicyId = &v
892	return s
893}
894
895// Specifies when to create snapshots of EBS volumes.
896//
897// You must specify either a Cron expression or an interval, interval unit,
898// and start time. You cannot specify both.
899type CreateRule struct {
900	_ struct{} `type:"structure"`
901
902	// The schedule, as a Cron expression. The schedule interval must be between
903	// 1 hour and 1 year. For more information, see Cron expressions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions)
904	// in the Amazon CloudWatch User Guide.
905	CronExpression *string `min:"17" type:"string"`
906
907	// The interval between snapshots. The supported values are 1, 2, 3, 4, 6, 8,
908	// 12, and 24.
909	Interval *int64 `min:"1" type:"integer"`
910
911	// The interval unit.
912	IntervalUnit *string `type:"string" enum:"IntervalUnitValues"`
913
914	// Specifies the destination for snapshots created by the policy. To create
915	// snapshots in the same Region as the source resource, specify CLOUD. To create
916	// snapshots on the same Outpost as the source resource, specify OUTPOST_LOCAL.
917	// If you omit this parameter, CLOUD is used by default.
918	//
919	// If the policy targets resources in an AWS Region, then you must create snapshots
920	// in the same Region as the source resource.
921	//
922	// If the policy targets resources on an Outpost, then you can create snapshots
923	// on the same Outpost as the source resource, or in the Region of that Outpost.
924	Location *string `type:"string" enum:"LocationValues"`
925
926	// The time, in UTC, to start the operation. The supported format is hh:mm.
927	//
928	// The operation occurs within a one-hour window following the specified time.
929	// If you do not specify a time, Amazon DLM selects a time within the next 24
930	// hours.
931	Times []*string `type:"list"`
932}
933
934// String returns the string representation
935func (s CreateRule) String() string {
936	return awsutil.Prettify(s)
937}
938
939// GoString returns the string representation
940func (s CreateRule) GoString() string {
941	return s.String()
942}
943
944// Validate inspects the fields of the type to determine if they are valid.
945func (s *CreateRule) Validate() error {
946	invalidParams := request.ErrInvalidParams{Context: "CreateRule"}
947	if s.CronExpression != nil && len(*s.CronExpression) < 17 {
948		invalidParams.Add(request.NewErrParamMinLen("CronExpression", 17))
949	}
950	if s.Interval != nil && *s.Interval < 1 {
951		invalidParams.Add(request.NewErrParamMinValue("Interval", 1))
952	}
953
954	if invalidParams.Len() > 0 {
955		return invalidParams
956	}
957	return nil
958}
959
960// SetCronExpression sets the CronExpression field's value.
961func (s *CreateRule) SetCronExpression(v string) *CreateRule {
962	s.CronExpression = &v
963	return s
964}
965
966// SetInterval sets the Interval field's value.
967func (s *CreateRule) SetInterval(v int64) *CreateRule {
968	s.Interval = &v
969	return s
970}
971
972// SetIntervalUnit sets the IntervalUnit field's value.
973func (s *CreateRule) SetIntervalUnit(v string) *CreateRule {
974	s.IntervalUnit = &v
975	return s
976}
977
978// SetLocation sets the Location field's value.
979func (s *CreateRule) SetLocation(v string) *CreateRule {
980	s.Location = &v
981	return s
982}
983
984// SetTimes sets the Times field's value.
985func (s *CreateRule) SetTimes(v []*string) *CreateRule {
986	s.Times = v
987	return s
988}
989
990// Specifies a rule for copying shared snapshots across Regions.
991type CrossRegionCopyAction struct {
992	_ struct{} `type:"structure"`
993
994	// The encryption settings for the copied snapshot.
995	//
996	// EncryptionConfiguration is a required field
997	EncryptionConfiguration *EncryptionConfiguration `type:"structure" required:"true"`
998
999	// Specifies the retention rule for cross-Region snapshot copies.
1000	RetainRule *CrossRegionCopyRetainRule `type:"structure"`
1001
1002	// The target Region.
1003	//
1004	// Target is a required field
1005	Target *string `type:"string" required:"true"`
1006}
1007
1008// String returns the string representation
1009func (s CrossRegionCopyAction) String() string {
1010	return awsutil.Prettify(s)
1011}
1012
1013// GoString returns the string representation
1014func (s CrossRegionCopyAction) GoString() string {
1015	return s.String()
1016}
1017
1018// Validate inspects the fields of the type to determine if they are valid.
1019func (s *CrossRegionCopyAction) Validate() error {
1020	invalidParams := request.ErrInvalidParams{Context: "CrossRegionCopyAction"}
1021	if s.EncryptionConfiguration == nil {
1022		invalidParams.Add(request.NewErrParamRequired("EncryptionConfiguration"))
1023	}
1024	if s.Target == nil {
1025		invalidParams.Add(request.NewErrParamRequired("Target"))
1026	}
1027	if s.EncryptionConfiguration != nil {
1028		if err := s.EncryptionConfiguration.Validate(); err != nil {
1029			invalidParams.AddNested("EncryptionConfiguration", err.(request.ErrInvalidParams))
1030		}
1031	}
1032	if s.RetainRule != nil {
1033		if err := s.RetainRule.Validate(); err != nil {
1034			invalidParams.AddNested("RetainRule", err.(request.ErrInvalidParams))
1035		}
1036	}
1037
1038	if invalidParams.Len() > 0 {
1039		return invalidParams
1040	}
1041	return nil
1042}
1043
1044// SetEncryptionConfiguration sets the EncryptionConfiguration field's value.
1045func (s *CrossRegionCopyAction) SetEncryptionConfiguration(v *EncryptionConfiguration) *CrossRegionCopyAction {
1046	s.EncryptionConfiguration = v
1047	return s
1048}
1049
1050// SetRetainRule sets the RetainRule field's value.
1051func (s *CrossRegionCopyAction) SetRetainRule(v *CrossRegionCopyRetainRule) *CrossRegionCopyAction {
1052	s.RetainRule = v
1053	return s
1054}
1055
1056// SetTarget sets the Target field's value.
1057func (s *CrossRegionCopyAction) SetTarget(v string) *CrossRegionCopyAction {
1058	s.Target = &v
1059	return s
1060}
1061
1062// Specifies the retention rule for cross-Region snapshot copies.
1063type CrossRegionCopyRetainRule struct {
1064	_ struct{} `type:"structure"`
1065
1066	// The amount of time to retain each snapshot. The maximum is 100 years. This
1067	// is equivalent to 1200 months, 5200 weeks, or 36500 days.
1068	Interval *int64 `min:"1" type:"integer"`
1069
1070	// The unit of time for time-based retention.
1071	IntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"`
1072}
1073
1074// String returns the string representation
1075func (s CrossRegionCopyRetainRule) String() string {
1076	return awsutil.Prettify(s)
1077}
1078
1079// GoString returns the string representation
1080func (s CrossRegionCopyRetainRule) GoString() string {
1081	return s.String()
1082}
1083
1084// Validate inspects the fields of the type to determine if they are valid.
1085func (s *CrossRegionCopyRetainRule) Validate() error {
1086	invalidParams := request.ErrInvalidParams{Context: "CrossRegionCopyRetainRule"}
1087	if s.Interval != nil && *s.Interval < 1 {
1088		invalidParams.Add(request.NewErrParamMinValue("Interval", 1))
1089	}
1090
1091	if invalidParams.Len() > 0 {
1092		return invalidParams
1093	}
1094	return nil
1095}
1096
1097// SetInterval sets the Interval field's value.
1098func (s *CrossRegionCopyRetainRule) SetInterval(v int64) *CrossRegionCopyRetainRule {
1099	s.Interval = &v
1100	return s
1101}
1102
1103// SetIntervalUnit sets the IntervalUnit field's value.
1104func (s *CrossRegionCopyRetainRule) SetIntervalUnit(v string) *CrossRegionCopyRetainRule {
1105	s.IntervalUnit = &v
1106	return s
1107}
1108
1109// Specifies a rule for cross-Region snapshot copies.
1110type CrossRegionCopyRule struct {
1111	_ struct{} `type:"structure"`
1112
1113	// The Amazon Resource Name (ARN) of the AWS KMS customer master key (CMK) to
1114	// use for EBS encryption. If this parameter is not specified, your AWS managed
1115	// CMK for EBS is used.
1116	CmkArn *string `type:"string"`
1117
1118	// Copy all user-defined tags from the source snapshot to the copied snapshot.
1119	CopyTags *bool `type:"boolean"`
1120
1121	// To encrypt a copy of an unencrypted snapshot if encryption by default is
1122	// not enabled, enable encryption using this parameter. Copies of encrypted
1123	// snapshots are encrypted, even if this parameter is false or if encryption
1124	// by default is not enabled.
1125	//
1126	// Encrypted is a required field
1127	Encrypted *bool `type:"boolean" required:"true"`
1128
1129	// The retention rule.
1130	RetainRule *CrossRegionCopyRetainRule `type:"structure"`
1131
1132	// The Amazon Resource Name (ARN) of the target AWS Outpost for the snapshot
1133	// copies.
1134	//
1135	// If you specify an ARN, you must omit TargetRegion. You cannot specify a target
1136	// Region and a target Outpost in the same rule.
1137	Target *string `type:"string"`
1138
1139	// The target Region for the snapshot copies.
1140	//
1141	// If you specify a target Region, you must omit Target. You cannot specify
1142	// a target Region and a target Outpost in the same rule.
1143	TargetRegion *string `type:"string"`
1144}
1145
1146// String returns the string representation
1147func (s CrossRegionCopyRule) String() string {
1148	return awsutil.Prettify(s)
1149}
1150
1151// GoString returns the string representation
1152func (s CrossRegionCopyRule) GoString() string {
1153	return s.String()
1154}
1155
1156// Validate inspects the fields of the type to determine if they are valid.
1157func (s *CrossRegionCopyRule) Validate() error {
1158	invalidParams := request.ErrInvalidParams{Context: "CrossRegionCopyRule"}
1159	if s.Encrypted == nil {
1160		invalidParams.Add(request.NewErrParamRequired("Encrypted"))
1161	}
1162	if s.RetainRule != nil {
1163		if err := s.RetainRule.Validate(); err != nil {
1164			invalidParams.AddNested("RetainRule", err.(request.ErrInvalidParams))
1165		}
1166	}
1167
1168	if invalidParams.Len() > 0 {
1169		return invalidParams
1170	}
1171	return nil
1172}
1173
1174// SetCmkArn sets the CmkArn field's value.
1175func (s *CrossRegionCopyRule) SetCmkArn(v string) *CrossRegionCopyRule {
1176	s.CmkArn = &v
1177	return s
1178}
1179
1180// SetCopyTags sets the CopyTags field's value.
1181func (s *CrossRegionCopyRule) SetCopyTags(v bool) *CrossRegionCopyRule {
1182	s.CopyTags = &v
1183	return s
1184}
1185
1186// SetEncrypted sets the Encrypted field's value.
1187func (s *CrossRegionCopyRule) SetEncrypted(v bool) *CrossRegionCopyRule {
1188	s.Encrypted = &v
1189	return s
1190}
1191
1192// SetRetainRule sets the RetainRule field's value.
1193func (s *CrossRegionCopyRule) SetRetainRule(v *CrossRegionCopyRetainRule) *CrossRegionCopyRule {
1194	s.RetainRule = v
1195	return s
1196}
1197
1198// SetTarget sets the Target field's value.
1199func (s *CrossRegionCopyRule) SetTarget(v string) *CrossRegionCopyRule {
1200	s.Target = &v
1201	return s
1202}
1203
1204// SetTargetRegion sets the TargetRegion field's value.
1205func (s *CrossRegionCopyRule) SetTargetRegion(v string) *CrossRegionCopyRule {
1206	s.TargetRegion = &v
1207	return s
1208}
1209
1210type DeleteLifecyclePolicyInput struct {
1211	_ struct{} `type:"structure"`
1212
1213	// The identifier of the lifecycle policy.
1214	//
1215	// PolicyId is a required field
1216	PolicyId *string `location:"uri" locationName:"policyId" type:"string" required:"true"`
1217}
1218
1219// String returns the string representation
1220func (s DeleteLifecyclePolicyInput) String() string {
1221	return awsutil.Prettify(s)
1222}
1223
1224// GoString returns the string representation
1225func (s DeleteLifecyclePolicyInput) GoString() string {
1226	return s.String()
1227}
1228
1229// Validate inspects the fields of the type to determine if they are valid.
1230func (s *DeleteLifecyclePolicyInput) Validate() error {
1231	invalidParams := request.ErrInvalidParams{Context: "DeleteLifecyclePolicyInput"}
1232	if s.PolicyId == nil {
1233		invalidParams.Add(request.NewErrParamRequired("PolicyId"))
1234	}
1235	if s.PolicyId != nil && len(*s.PolicyId) < 1 {
1236		invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1))
1237	}
1238
1239	if invalidParams.Len() > 0 {
1240		return invalidParams
1241	}
1242	return nil
1243}
1244
1245// SetPolicyId sets the PolicyId field's value.
1246func (s *DeleteLifecyclePolicyInput) SetPolicyId(v string) *DeleteLifecyclePolicyInput {
1247	s.PolicyId = &v
1248	return s
1249}
1250
1251type DeleteLifecyclePolicyOutput struct {
1252	_ struct{} `type:"structure"`
1253}
1254
1255// String returns the string representation
1256func (s DeleteLifecyclePolicyOutput) String() string {
1257	return awsutil.Prettify(s)
1258}
1259
1260// GoString returns the string representation
1261func (s DeleteLifecyclePolicyOutput) GoString() string {
1262	return s.String()
1263}
1264
1265// Specifies the encryption settings for shared snapshots that are copied across
1266// Regions.
1267type EncryptionConfiguration struct {
1268	_ struct{} `type:"structure"`
1269
1270	// The Amazon Resource Name (ARN) of the AWS KMS customer master key (CMK) to
1271	// use for EBS encryption. If this parameter is not specified, your AWS managed
1272	// CMK for EBS is used.
1273	CmkArn *string `type:"string"`
1274
1275	// To encrypt a copy of an unencrypted snapshot when encryption by default is
1276	// not enabled, enable encryption using this parameter. Copies of encrypted
1277	// snapshots are encrypted, even if this parameter is false or when encryption
1278	// by default is not enabled.
1279	//
1280	// Encrypted is a required field
1281	Encrypted *bool `type:"boolean" required:"true"`
1282}
1283
1284// String returns the string representation
1285func (s EncryptionConfiguration) String() string {
1286	return awsutil.Prettify(s)
1287}
1288
1289// GoString returns the string representation
1290func (s EncryptionConfiguration) GoString() string {
1291	return s.String()
1292}
1293
1294// Validate inspects the fields of the type to determine if they are valid.
1295func (s *EncryptionConfiguration) Validate() error {
1296	invalidParams := request.ErrInvalidParams{Context: "EncryptionConfiguration"}
1297	if s.Encrypted == nil {
1298		invalidParams.Add(request.NewErrParamRequired("Encrypted"))
1299	}
1300
1301	if invalidParams.Len() > 0 {
1302		return invalidParams
1303	}
1304	return nil
1305}
1306
1307// SetCmkArn sets the CmkArn field's value.
1308func (s *EncryptionConfiguration) SetCmkArn(v string) *EncryptionConfiguration {
1309	s.CmkArn = &v
1310	return s
1311}
1312
1313// SetEncrypted sets the Encrypted field's value.
1314func (s *EncryptionConfiguration) SetEncrypted(v bool) *EncryptionConfiguration {
1315	s.Encrypted = &v
1316	return s
1317}
1318
1319// Specifies an event that triggers an event-based policy.
1320type EventParameters struct {
1321	_ struct{} `type:"structure"`
1322
1323	// The snapshot description that can trigger the policy. The description pattern
1324	// is specified using a regular expression. The policy runs only if a snapshot
1325	// with a description that matches the specified pattern is shared with your
1326	// account.
1327	//
1328	// For example, specifying ^.*Created for policy: policy-1234567890abcdef0.*$
1329	// configures the policy to run only if snapshots created by policy policy-1234567890abcdef0
1330	// are shared with your account.
1331	//
1332	// DescriptionRegex is a required field
1333	DescriptionRegex *string `type:"string" required:"true"`
1334
1335	// The type of event. Currently, only snapshot sharing events are supported.
1336	//
1337	// EventType is a required field
1338	EventType *string `type:"string" required:"true" enum:"EventTypeValues"`
1339
1340	// The IDs of the AWS accounts that can trigger policy by sharing snapshots
1341	// with your account. The policy only runs if one of the specified AWS accounts
1342	// shares a snapshot with your account.
1343	//
1344	// SnapshotOwner is a required field
1345	SnapshotOwner []*string `type:"list" required:"true"`
1346}
1347
1348// String returns the string representation
1349func (s EventParameters) String() string {
1350	return awsutil.Prettify(s)
1351}
1352
1353// GoString returns the string representation
1354func (s EventParameters) GoString() string {
1355	return s.String()
1356}
1357
1358// Validate inspects the fields of the type to determine if they are valid.
1359func (s *EventParameters) Validate() error {
1360	invalidParams := request.ErrInvalidParams{Context: "EventParameters"}
1361	if s.DescriptionRegex == nil {
1362		invalidParams.Add(request.NewErrParamRequired("DescriptionRegex"))
1363	}
1364	if s.EventType == nil {
1365		invalidParams.Add(request.NewErrParamRequired("EventType"))
1366	}
1367	if s.SnapshotOwner == nil {
1368		invalidParams.Add(request.NewErrParamRequired("SnapshotOwner"))
1369	}
1370
1371	if invalidParams.Len() > 0 {
1372		return invalidParams
1373	}
1374	return nil
1375}
1376
1377// SetDescriptionRegex sets the DescriptionRegex field's value.
1378func (s *EventParameters) SetDescriptionRegex(v string) *EventParameters {
1379	s.DescriptionRegex = &v
1380	return s
1381}
1382
1383// SetEventType sets the EventType field's value.
1384func (s *EventParameters) SetEventType(v string) *EventParameters {
1385	s.EventType = &v
1386	return s
1387}
1388
1389// SetSnapshotOwner sets the SnapshotOwner field's value.
1390func (s *EventParameters) SetSnapshotOwner(v []*string) *EventParameters {
1391	s.SnapshotOwner = v
1392	return s
1393}
1394
1395// Specifies an event that triggers an event-based policy.
1396type EventSource struct {
1397	_ struct{} `type:"structure"`
1398
1399	// Information about the event.
1400	Parameters *EventParameters `type:"structure"`
1401
1402	// The source of the event. Currently only managed AWS CloudWatch Events rules
1403	// are supported.
1404	//
1405	// Type is a required field
1406	Type *string `type:"string" required:"true" enum:"EventSourceValues"`
1407}
1408
1409// String returns the string representation
1410func (s EventSource) String() string {
1411	return awsutil.Prettify(s)
1412}
1413
1414// GoString returns the string representation
1415func (s EventSource) GoString() string {
1416	return s.String()
1417}
1418
1419// Validate inspects the fields of the type to determine if they are valid.
1420func (s *EventSource) Validate() error {
1421	invalidParams := request.ErrInvalidParams{Context: "EventSource"}
1422	if s.Type == nil {
1423		invalidParams.Add(request.NewErrParamRequired("Type"))
1424	}
1425	if s.Parameters != nil {
1426		if err := s.Parameters.Validate(); err != nil {
1427			invalidParams.AddNested("Parameters", err.(request.ErrInvalidParams))
1428		}
1429	}
1430
1431	if invalidParams.Len() > 0 {
1432		return invalidParams
1433	}
1434	return nil
1435}
1436
1437// SetParameters sets the Parameters field's value.
1438func (s *EventSource) SetParameters(v *EventParameters) *EventSource {
1439	s.Parameters = v
1440	return s
1441}
1442
1443// SetType sets the Type field's value.
1444func (s *EventSource) SetType(v string) *EventSource {
1445	s.Type = &v
1446	return s
1447}
1448
1449// Specifies a rule for enabling fast snapshot restore. You can enable fast
1450// snapshot restore based on either a count or a time interval.
1451type FastRestoreRule struct {
1452	_ struct{} `type:"structure"`
1453
1454	// The Availability Zones in which to enable fast snapshot restore.
1455	//
1456	// AvailabilityZones is a required field
1457	AvailabilityZones []*string `min:"1" type:"list" required:"true"`
1458
1459	// The number of snapshots to be enabled with fast snapshot restore.
1460	Count *int64 `min:"1" type:"integer"`
1461
1462	// The amount of time to enable fast snapshot restore. The maximum is 100 years.
1463	// This is equivalent to 1200 months, 5200 weeks, or 36500 days.
1464	Interval *int64 `min:"1" type:"integer"`
1465
1466	// The unit of time for enabling fast snapshot restore.
1467	IntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"`
1468}
1469
1470// String returns the string representation
1471func (s FastRestoreRule) String() string {
1472	return awsutil.Prettify(s)
1473}
1474
1475// GoString returns the string representation
1476func (s FastRestoreRule) GoString() string {
1477	return s.String()
1478}
1479
1480// Validate inspects the fields of the type to determine if they are valid.
1481func (s *FastRestoreRule) Validate() error {
1482	invalidParams := request.ErrInvalidParams{Context: "FastRestoreRule"}
1483	if s.AvailabilityZones == nil {
1484		invalidParams.Add(request.NewErrParamRequired("AvailabilityZones"))
1485	}
1486	if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 {
1487		invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1))
1488	}
1489	if s.Count != nil && *s.Count < 1 {
1490		invalidParams.Add(request.NewErrParamMinValue("Count", 1))
1491	}
1492	if s.Interval != nil && *s.Interval < 1 {
1493		invalidParams.Add(request.NewErrParamMinValue("Interval", 1))
1494	}
1495
1496	if invalidParams.Len() > 0 {
1497		return invalidParams
1498	}
1499	return nil
1500}
1501
1502// SetAvailabilityZones sets the AvailabilityZones field's value.
1503func (s *FastRestoreRule) SetAvailabilityZones(v []*string) *FastRestoreRule {
1504	s.AvailabilityZones = v
1505	return s
1506}
1507
1508// SetCount sets the Count field's value.
1509func (s *FastRestoreRule) SetCount(v int64) *FastRestoreRule {
1510	s.Count = &v
1511	return s
1512}
1513
1514// SetInterval sets the Interval field's value.
1515func (s *FastRestoreRule) SetInterval(v int64) *FastRestoreRule {
1516	s.Interval = &v
1517	return s
1518}
1519
1520// SetIntervalUnit sets the IntervalUnit field's value.
1521func (s *FastRestoreRule) SetIntervalUnit(v string) *FastRestoreRule {
1522	s.IntervalUnit = &v
1523	return s
1524}
1525
1526type GetLifecyclePoliciesInput struct {
1527	_ struct{} `type:"structure"`
1528
1529	// The identifiers of the data lifecycle policies.
1530	PolicyIds []*string `location:"querystring" locationName:"policyIds" type:"list"`
1531
1532	// The resource type.
1533	ResourceTypes []*string `location:"querystring" locationName:"resourceTypes" min:"1" type:"list"`
1534
1535	// The activation state.
1536	State *string `location:"querystring" locationName:"state" type:"string" enum:"GettablePolicyStateValues"`
1537
1538	// The tags to add to objects created by the policy.
1539	//
1540	// Tags are strings in the format key=value.
1541	//
1542	// These user-defined tags are added in addition to the AWS-added lifecycle
1543	// tags.
1544	TagsToAdd []*string `location:"querystring" locationName:"tagsToAdd" type:"list"`
1545
1546	// The target tag for a policy.
1547	//
1548	// Tags are strings in the format key=value.
1549	TargetTags []*string `location:"querystring" locationName:"targetTags" min:"1" type:"list"`
1550}
1551
1552// String returns the string representation
1553func (s GetLifecyclePoliciesInput) String() string {
1554	return awsutil.Prettify(s)
1555}
1556
1557// GoString returns the string representation
1558func (s GetLifecyclePoliciesInput) GoString() string {
1559	return s.String()
1560}
1561
1562// Validate inspects the fields of the type to determine if they are valid.
1563func (s *GetLifecyclePoliciesInput) Validate() error {
1564	invalidParams := request.ErrInvalidParams{Context: "GetLifecyclePoliciesInput"}
1565	if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 {
1566		invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1))
1567	}
1568	if s.TargetTags != nil && len(s.TargetTags) < 1 {
1569		invalidParams.Add(request.NewErrParamMinLen("TargetTags", 1))
1570	}
1571
1572	if invalidParams.Len() > 0 {
1573		return invalidParams
1574	}
1575	return nil
1576}
1577
1578// SetPolicyIds sets the PolicyIds field's value.
1579func (s *GetLifecyclePoliciesInput) SetPolicyIds(v []*string) *GetLifecyclePoliciesInput {
1580	s.PolicyIds = v
1581	return s
1582}
1583
1584// SetResourceTypes sets the ResourceTypes field's value.
1585func (s *GetLifecyclePoliciesInput) SetResourceTypes(v []*string) *GetLifecyclePoliciesInput {
1586	s.ResourceTypes = v
1587	return s
1588}
1589
1590// SetState sets the State field's value.
1591func (s *GetLifecyclePoliciesInput) SetState(v string) *GetLifecyclePoliciesInput {
1592	s.State = &v
1593	return s
1594}
1595
1596// SetTagsToAdd sets the TagsToAdd field's value.
1597func (s *GetLifecyclePoliciesInput) SetTagsToAdd(v []*string) *GetLifecyclePoliciesInput {
1598	s.TagsToAdd = v
1599	return s
1600}
1601
1602// SetTargetTags sets the TargetTags field's value.
1603func (s *GetLifecyclePoliciesInput) SetTargetTags(v []*string) *GetLifecyclePoliciesInput {
1604	s.TargetTags = v
1605	return s
1606}
1607
1608type GetLifecyclePoliciesOutput struct {
1609	_ struct{} `type:"structure"`
1610
1611	// Summary information about the lifecycle policies.
1612	Policies []*LifecyclePolicySummary `type:"list"`
1613}
1614
1615// String returns the string representation
1616func (s GetLifecyclePoliciesOutput) String() string {
1617	return awsutil.Prettify(s)
1618}
1619
1620// GoString returns the string representation
1621func (s GetLifecyclePoliciesOutput) GoString() string {
1622	return s.String()
1623}
1624
1625// SetPolicies sets the Policies field's value.
1626func (s *GetLifecyclePoliciesOutput) SetPolicies(v []*LifecyclePolicySummary) *GetLifecyclePoliciesOutput {
1627	s.Policies = v
1628	return s
1629}
1630
1631type GetLifecyclePolicyInput struct {
1632	_ struct{} `type:"structure"`
1633
1634	// The identifier of the lifecycle policy.
1635	//
1636	// PolicyId is a required field
1637	PolicyId *string `location:"uri" locationName:"policyId" type:"string" required:"true"`
1638}
1639
1640// String returns the string representation
1641func (s GetLifecyclePolicyInput) String() string {
1642	return awsutil.Prettify(s)
1643}
1644
1645// GoString returns the string representation
1646func (s GetLifecyclePolicyInput) GoString() string {
1647	return s.String()
1648}
1649
1650// Validate inspects the fields of the type to determine if they are valid.
1651func (s *GetLifecyclePolicyInput) Validate() error {
1652	invalidParams := request.ErrInvalidParams{Context: "GetLifecyclePolicyInput"}
1653	if s.PolicyId == nil {
1654		invalidParams.Add(request.NewErrParamRequired("PolicyId"))
1655	}
1656	if s.PolicyId != nil && len(*s.PolicyId) < 1 {
1657		invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1))
1658	}
1659
1660	if invalidParams.Len() > 0 {
1661		return invalidParams
1662	}
1663	return nil
1664}
1665
1666// SetPolicyId sets the PolicyId field's value.
1667func (s *GetLifecyclePolicyInput) SetPolicyId(v string) *GetLifecyclePolicyInput {
1668	s.PolicyId = &v
1669	return s
1670}
1671
1672type GetLifecyclePolicyOutput struct {
1673	_ struct{} `type:"structure"`
1674
1675	// Detailed information about the lifecycle policy.
1676	Policy *LifecyclePolicy `type:"structure"`
1677}
1678
1679// String returns the string representation
1680func (s GetLifecyclePolicyOutput) String() string {
1681	return awsutil.Prettify(s)
1682}
1683
1684// GoString returns the string representation
1685func (s GetLifecyclePolicyOutput) GoString() string {
1686	return s.String()
1687}
1688
1689// SetPolicy sets the Policy field's value.
1690func (s *GetLifecyclePolicyOutput) SetPolicy(v *LifecyclePolicy) *GetLifecyclePolicyOutput {
1691	s.Policy = v
1692	return s
1693}
1694
1695// The service failed in an unexpected way.
1696type InternalServerException struct {
1697	_            struct{}                  `type:"structure"`
1698	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1699
1700	Code_ *string `locationName:"Code" type:"string"`
1701
1702	Message_ *string `locationName:"Message" type:"string"`
1703}
1704
1705// String returns the string representation
1706func (s InternalServerException) String() string {
1707	return awsutil.Prettify(s)
1708}
1709
1710// GoString returns the string representation
1711func (s InternalServerException) GoString() string {
1712	return s.String()
1713}
1714
1715func newErrorInternalServerException(v protocol.ResponseMetadata) error {
1716	return &InternalServerException{
1717		RespMetadata: v,
1718	}
1719}
1720
1721// Code returns the exception type name.
1722func (s *InternalServerException) Code() string {
1723	return "InternalServerException"
1724}
1725
1726// Message returns the exception's message.
1727func (s *InternalServerException) Message() string {
1728	if s.Message_ != nil {
1729		return *s.Message_
1730	}
1731	return ""
1732}
1733
1734// OrigErr always returns nil, satisfies awserr.Error interface.
1735func (s *InternalServerException) OrigErr() error {
1736	return nil
1737}
1738
1739func (s *InternalServerException) Error() string {
1740	return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
1741}
1742
1743// Status code returns the HTTP status code for the request's response error.
1744func (s *InternalServerException) StatusCode() int {
1745	return s.RespMetadata.StatusCode
1746}
1747
1748// RequestID returns the service's response RequestID for request.
1749func (s *InternalServerException) RequestID() string {
1750	return s.RespMetadata.RequestID
1751}
1752
1753// Bad request. The request is missing required parameters or has invalid parameters.
1754type InvalidRequestException struct {
1755	_            struct{}                  `type:"structure"`
1756	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1757
1758	Code_ *string `locationName:"Code" type:"string"`
1759
1760	Message_ *string `locationName:"Message" type:"string"`
1761
1762	// The request included parameters that cannot be provided together.
1763	MutuallyExclusiveParameters []*string `type:"list"`
1764
1765	// The request omitted one or more required parameters.
1766	RequiredParameters []*string `type:"list"`
1767}
1768
1769// String returns the string representation
1770func (s InvalidRequestException) String() string {
1771	return awsutil.Prettify(s)
1772}
1773
1774// GoString returns the string representation
1775func (s InvalidRequestException) GoString() string {
1776	return s.String()
1777}
1778
1779func newErrorInvalidRequestException(v protocol.ResponseMetadata) error {
1780	return &InvalidRequestException{
1781		RespMetadata: v,
1782	}
1783}
1784
1785// Code returns the exception type name.
1786func (s *InvalidRequestException) Code() string {
1787	return "InvalidRequestException"
1788}
1789
1790// Message returns the exception's message.
1791func (s *InvalidRequestException) Message() string {
1792	if s.Message_ != nil {
1793		return *s.Message_
1794	}
1795	return ""
1796}
1797
1798// OrigErr always returns nil, satisfies awserr.Error interface.
1799func (s *InvalidRequestException) OrigErr() error {
1800	return nil
1801}
1802
1803func (s *InvalidRequestException) Error() string {
1804	return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
1805}
1806
1807// Status code returns the HTTP status code for the request's response error.
1808func (s *InvalidRequestException) StatusCode() int {
1809	return s.RespMetadata.StatusCode
1810}
1811
1812// RequestID returns the service's response RequestID for request.
1813func (s *InvalidRequestException) RequestID() string {
1814	return s.RespMetadata.RequestID
1815}
1816
1817// Detailed information about a lifecycle policy.
1818type LifecyclePolicy struct {
1819	_ struct{} `type:"structure"`
1820
1821	// The local date and time when the lifecycle policy was created.
1822	DateCreated *time.Time `type:"timestamp" timestampFormat:"iso8601"`
1823
1824	// The local date and time when the lifecycle policy was last modified.
1825	DateModified *time.Time `type:"timestamp" timestampFormat:"iso8601"`
1826
1827	// The description of the lifecycle policy.
1828	Description *string `type:"string"`
1829
1830	// The Amazon Resource Name (ARN) of the IAM role used to run the operations
1831	// specified by the lifecycle policy.
1832	ExecutionRoleArn *string `type:"string"`
1833
1834	// The Amazon Resource Name (ARN) of the policy.
1835	PolicyArn *string `type:"string"`
1836
1837	// The configuration of the lifecycle policy
1838	PolicyDetails *PolicyDetails `type:"structure"`
1839
1840	// The identifier of the lifecycle policy.
1841	PolicyId *string `type:"string"`
1842
1843	// The activation state of the lifecycle policy.
1844	State *string `type:"string" enum:"GettablePolicyStateValues"`
1845
1846	// The description of the status.
1847	StatusMessage *string `type:"string"`
1848
1849	// The tags.
1850	Tags map[string]*string `min:"1" type:"map"`
1851}
1852
1853// String returns the string representation
1854func (s LifecyclePolicy) String() string {
1855	return awsutil.Prettify(s)
1856}
1857
1858// GoString returns the string representation
1859func (s LifecyclePolicy) GoString() string {
1860	return s.String()
1861}
1862
1863// SetDateCreated sets the DateCreated field's value.
1864func (s *LifecyclePolicy) SetDateCreated(v time.Time) *LifecyclePolicy {
1865	s.DateCreated = &v
1866	return s
1867}
1868
1869// SetDateModified sets the DateModified field's value.
1870func (s *LifecyclePolicy) SetDateModified(v time.Time) *LifecyclePolicy {
1871	s.DateModified = &v
1872	return s
1873}
1874
1875// SetDescription sets the Description field's value.
1876func (s *LifecyclePolicy) SetDescription(v string) *LifecyclePolicy {
1877	s.Description = &v
1878	return s
1879}
1880
1881// SetExecutionRoleArn sets the ExecutionRoleArn field's value.
1882func (s *LifecyclePolicy) SetExecutionRoleArn(v string) *LifecyclePolicy {
1883	s.ExecutionRoleArn = &v
1884	return s
1885}
1886
1887// SetPolicyArn sets the PolicyArn field's value.
1888func (s *LifecyclePolicy) SetPolicyArn(v string) *LifecyclePolicy {
1889	s.PolicyArn = &v
1890	return s
1891}
1892
1893// SetPolicyDetails sets the PolicyDetails field's value.
1894func (s *LifecyclePolicy) SetPolicyDetails(v *PolicyDetails) *LifecyclePolicy {
1895	s.PolicyDetails = v
1896	return s
1897}
1898
1899// SetPolicyId sets the PolicyId field's value.
1900func (s *LifecyclePolicy) SetPolicyId(v string) *LifecyclePolicy {
1901	s.PolicyId = &v
1902	return s
1903}
1904
1905// SetState sets the State field's value.
1906func (s *LifecyclePolicy) SetState(v string) *LifecyclePolicy {
1907	s.State = &v
1908	return s
1909}
1910
1911// SetStatusMessage sets the StatusMessage field's value.
1912func (s *LifecyclePolicy) SetStatusMessage(v string) *LifecyclePolicy {
1913	s.StatusMessage = &v
1914	return s
1915}
1916
1917// SetTags sets the Tags field's value.
1918func (s *LifecyclePolicy) SetTags(v map[string]*string) *LifecyclePolicy {
1919	s.Tags = v
1920	return s
1921}
1922
1923// Summary information about a lifecycle policy.
1924type LifecyclePolicySummary struct {
1925	_ struct{} `type:"structure"`
1926
1927	// The description of the lifecycle policy.
1928	Description *string `type:"string"`
1929
1930	// The identifier of the lifecycle policy.
1931	PolicyId *string `type:"string"`
1932
1933	// The type of policy. EBS_SNAPSHOT_MANAGEMENT indicates that the policy manages
1934	// the lifecycle of Amazon EBS snapshots. IMAGE_MANAGEMENT indicates that the
1935	// policy manages the lifecycle of EBS-backed AMIs.
1936	PolicyType *string `type:"string" enum:"PolicyTypeValues"`
1937
1938	// The activation state of the lifecycle policy.
1939	State *string `type:"string" enum:"GettablePolicyStateValues"`
1940
1941	// The tags.
1942	Tags map[string]*string `min:"1" type:"map"`
1943}
1944
1945// String returns the string representation
1946func (s LifecyclePolicySummary) String() string {
1947	return awsutil.Prettify(s)
1948}
1949
1950// GoString returns the string representation
1951func (s LifecyclePolicySummary) GoString() string {
1952	return s.String()
1953}
1954
1955// SetDescription sets the Description field's value.
1956func (s *LifecyclePolicySummary) SetDescription(v string) *LifecyclePolicySummary {
1957	s.Description = &v
1958	return s
1959}
1960
1961// SetPolicyId sets the PolicyId field's value.
1962func (s *LifecyclePolicySummary) SetPolicyId(v string) *LifecyclePolicySummary {
1963	s.PolicyId = &v
1964	return s
1965}
1966
1967// SetPolicyType sets the PolicyType field's value.
1968func (s *LifecyclePolicySummary) SetPolicyType(v string) *LifecyclePolicySummary {
1969	s.PolicyType = &v
1970	return s
1971}
1972
1973// SetState sets the State field's value.
1974func (s *LifecyclePolicySummary) SetState(v string) *LifecyclePolicySummary {
1975	s.State = &v
1976	return s
1977}
1978
1979// SetTags sets the Tags field's value.
1980func (s *LifecyclePolicySummary) SetTags(v map[string]*string) *LifecyclePolicySummary {
1981	s.Tags = v
1982	return s
1983}
1984
1985// The request failed because a limit was exceeded.
1986type LimitExceededException struct {
1987	_            struct{}                  `type:"structure"`
1988	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
1989
1990	Code_ *string `locationName:"Code" type:"string"`
1991
1992	Message_ *string `locationName:"Message" type:"string"`
1993
1994	// Value is the type of resource for which a limit was exceeded.
1995	ResourceType *string `type:"string"`
1996}
1997
1998// String returns the string representation
1999func (s LimitExceededException) String() string {
2000	return awsutil.Prettify(s)
2001}
2002
2003// GoString returns the string representation
2004func (s LimitExceededException) GoString() string {
2005	return s.String()
2006}
2007
2008func newErrorLimitExceededException(v protocol.ResponseMetadata) error {
2009	return &LimitExceededException{
2010		RespMetadata: v,
2011	}
2012}
2013
2014// Code returns the exception type name.
2015func (s *LimitExceededException) Code() string {
2016	return "LimitExceededException"
2017}
2018
2019// Message returns the exception's message.
2020func (s *LimitExceededException) Message() string {
2021	if s.Message_ != nil {
2022		return *s.Message_
2023	}
2024	return ""
2025}
2026
2027// OrigErr always returns nil, satisfies awserr.Error interface.
2028func (s *LimitExceededException) OrigErr() error {
2029	return nil
2030}
2031
2032func (s *LimitExceededException) Error() string {
2033	return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
2034}
2035
2036// Status code returns the HTTP status code for the request's response error.
2037func (s *LimitExceededException) StatusCode() int {
2038	return s.RespMetadata.StatusCode
2039}
2040
2041// RequestID returns the service's response RequestID for request.
2042func (s *LimitExceededException) RequestID() string {
2043	return s.RespMetadata.RequestID
2044}
2045
2046type ListTagsForResourceInput struct {
2047	_ struct{} `type:"structure"`
2048
2049	// The Amazon Resource Name (ARN) of the resource.
2050	//
2051	// ResourceArn is a required field
2052	ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"`
2053}
2054
2055// String returns the string representation
2056func (s ListTagsForResourceInput) String() string {
2057	return awsutil.Prettify(s)
2058}
2059
2060// GoString returns the string representation
2061func (s ListTagsForResourceInput) GoString() string {
2062	return s.String()
2063}
2064
2065// Validate inspects the fields of the type to determine if they are valid.
2066func (s *ListTagsForResourceInput) Validate() error {
2067	invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"}
2068	if s.ResourceArn == nil {
2069		invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
2070	}
2071	if s.ResourceArn != nil && len(*s.ResourceArn) < 1 {
2072		invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1))
2073	}
2074
2075	if invalidParams.Len() > 0 {
2076		return invalidParams
2077	}
2078	return nil
2079}
2080
2081// SetResourceArn sets the ResourceArn field's value.
2082func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput {
2083	s.ResourceArn = &v
2084	return s
2085}
2086
2087type ListTagsForResourceOutput struct {
2088	_ struct{} `type:"structure"`
2089
2090	// Information about the tags.
2091	Tags map[string]*string `min:"1" type:"map"`
2092}
2093
2094// String returns the string representation
2095func (s ListTagsForResourceOutput) String() string {
2096	return awsutil.Prettify(s)
2097}
2098
2099// GoString returns the string representation
2100func (s ListTagsForResourceOutput) GoString() string {
2101	return s.String()
2102}
2103
2104// SetTags sets the Tags field's value.
2105func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput {
2106	s.Tags = v
2107	return s
2108}
2109
2110// Specifies optional parameters to add to a policy. The set of valid parameters
2111// depends on the combination of policy type and resource type.
2112type Parameters struct {
2113	_ struct{} `type:"structure"`
2114
2115	// [EBS Snapshot Management – Instance policies only] Indicates whether to
2116	// exclude the root volume from snapshots created using CreateSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html).
2117	// The default is false.
2118	ExcludeBootVolume *bool `type:"boolean"`
2119
2120	// Applies to AMI lifecycle policies only. Indicates whether targeted instances
2121	// are rebooted when the lifecycle policy runs. true indicates that targeted
2122	// instances are not rebooted when the policy runs. false indicates that target
2123	// instances are rebooted when the policy runs. The default is true (instances
2124	// are not rebooted).
2125	NoReboot *bool `type:"boolean"`
2126}
2127
2128// String returns the string representation
2129func (s Parameters) String() string {
2130	return awsutil.Prettify(s)
2131}
2132
2133// GoString returns the string representation
2134func (s Parameters) GoString() string {
2135	return s.String()
2136}
2137
2138// SetExcludeBootVolume sets the ExcludeBootVolume field's value.
2139func (s *Parameters) SetExcludeBootVolume(v bool) *Parameters {
2140	s.ExcludeBootVolume = &v
2141	return s
2142}
2143
2144// SetNoReboot sets the NoReboot field's value.
2145func (s *Parameters) SetNoReboot(v bool) *Parameters {
2146	s.NoReboot = &v
2147	return s
2148}
2149
2150// Specifies the configuration of a lifecycle policy.
2151type PolicyDetails struct {
2152	_ struct{} `type:"structure"`
2153
2154	// The actions to be performed when the event-based policy is triggered. You
2155	// can specify only one action per policy.
2156	//
2157	// This parameter is required for event-based policies only. If you are creating
2158	// a snapshot or AMI policy, omit this parameter.
2159	Actions []*Action `min:"1" type:"list"`
2160
2161	// The event that triggers the event-based policy.
2162	//
2163	// This parameter is required for event-based policies only. If you are creating
2164	// a snapshot or AMI policy, omit this parameter.
2165	EventSource *EventSource `type:"structure"`
2166
2167	// A set of optional parameters for snapshot and AMI lifecycle policies.
2168	//
2169	// This parameter is required for snapshot and AMI policies only. If you are
2170	// creating an event-based policy, omit this parameter.
2171	Parameters *Parameters `type:"structure"`
2172
2173	// The valid target resource types and actions a policy can manage. Specify
2174	// EBS_SNAPSHOT_MANAGEMENT to create a lifecycle policy that manages the lifecycle
2175	// of Amazon EBS snapshots. Specify IMAGE_MANAGEMENT to create a lifecycle policy
2176	// that manages the lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY
2177	// to create an event-based policy that performs specific actions when a defined
2178	// event occurs in your AWS account.
2179	//
2180	// The default is EBS_SNAPSHOT_MANAGEMENT.
2181	PolicyType *string `type:"string" enum:"PolicyTypeValues"`
2182
2183	// The location of the resources to backup. If the source resources are located
2184	// in an AWS Region, specify CLOUD. If the source resources are located on an
2185	// AWS Outpost in your account, specify OUTPOST.
2186	//
2187	// If you specify OUTPOST, Amazon Data Lifecycle Manager backs up all resources
2188	// of the specified type with matching target tags across all of the Outposts
2189	// in your account.
2190	ResourceLocations []*string `min:"1" type:"list"`
2191
2192	// The target resource type for snapshot and AMI lifecycle policies. Use VOLUME
2193	// to create snapshots of individual volumes or use INSTANCE to create multi-volume
2194	// snapshots from the volumes for an instance.
2195	//
2196	// This parameter is required for snapshot and AMI policies only. If you are
2197	// creating an event-based policy, omit this parameter.
2198	ResourceTypes []*string `min:"1" type:"list"`
2199
2200	// The schedules of policy-defined actions for snapshot and AMI lifecycle policies.
2201	// A policy can have up to four schedules—one mandatory schedule and up to
2202	// three optional schedules.
2203	//
2204	// This parameter is required for snapshot and AMI policies only. If you are
2205	// creating an event-based policy, omit this parameter.
2206	Schedules []*Schedule `min:"1" type:"list"`
2207
2208	// The single tag that identifies targeted resources for this policy.
2209	//
2210	// This parameter is required for snapshot and AMI policies only. If you are
2211	// creating an event-based policy, omit this parameter.
2212	TargetTags []*Tag `min:"1" type:"list"`
2213}
2214
2215// String returns the string representation
2216func (s PolicyDetails) String() string {
2217	return awsutil.Prettify(s)
2218}
2219
2220// GoString returns the string representation
2221func (s PolicyDetails) GoString() string {
2222	return s.String()
2223}
2224
2225// Validate inspects the fields of the type to determine if they are valid.
2226func (s *PolicyDetails) Validate() error {
2227	invalidParams := request.ErrInvalidParams{Context: "PolicyDetails"}
2228	if s.Actions != nil && len(s.Actions) < 1 {
2229		invalidParams.Add(request.NewErrParamMinLen("Actions", 1))
2230	}
2231	if s.ResourceLocations != nil && len(s.ResourceLocations) < 1 {
2232		invalidParams.Add(request.NewErrParamMinLen("ResourceLocations", 1))
2233	}
2234	if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 {
2235		invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1))
2236	}
2237	if s.Schedules != nil && len(s.Schedules) < 1 {
2238		invalidParams.Add(request.NewErrParamMinLen("Schedules", 1))
2239	}
2240	if s.TargetTags != nil && len(s.TargetTags) < 1 {
2241		invalidParams.Add(request.NewErrParamMinLen("TargetTags", 1))
2242	}
2243	if s.Actions != nil {
2244		for i, v := range s.Actions {
2245			if v == nil {
2246				continue
2247			}
2248			if err := v.Validate(); err != nil {
2249				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Actions", i), err.(request.ErrInvalidParams))
2250			}
2251		}
2252	}
2253	if s.EventSource != nil {
2254		if err := s.EventSource.Validate(); err != nil {
2255			invalidParams.AddNested("EventSource", err.(request.ErrInvalidParams))
2256		}
2257	}
2258	if s.Schedules != nil {
2259		for i, v := range s.Schedules {
2260			if v == nil {
2261				continue
2262			}
2263			if err := v.Validate(); err != nil {
2264				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Schedules", i), err.(request.ErrInvalidParams))
2265			}
2266		}
2267	}
2268	if s.TargetTags != nil {
2269		for i, v := range s.TargetTags {
2270			if v == nil {
2271				continue
2272			}
2273			if err := v.Validate(); err != nil {
2274				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetTags", i), err.(request.ErrInvalidParams))
2275			}
2276		}
2277	}
2278
2279	if invalidParams.Len() > 0 {
2280		return invalidParams
2281	}
2282	return nil
2283}
2284
2285// SetActions sets the Actions field's value.
2286func (s *PolicyDetails) SetActions(v []*Action) *PolicyDetails {
2287	s.Actions = v
2288	return s
2289}
2290
2291// SetEventSource sets the EventSource field's value.
2292func (s *PolicyDetails) SetEventSource(v *EventSource) *PolicyDetails {
2293	s.EventSource = v
2294	return s
2295}
2296
2297// SetParameters sets the Parameters field's value.
2298func (s *PolicyDetails) SetParameters(v *Parameters) *PolicyDetails {
2299	s.Parameters = v
2300	return s
2301}
2302
2303// SetPolicyType sets the PolicyType field's value.
2304func (s *PolicyDetails) SetPolicyType(v string) *PolicyDetails {
2305	s.PolicyType = &v
2306	return s
2307}
2308
2309// SetResourceLocations sets the ResourceLocations field's value.
2310func (s *PolicyDetails) SetResourceLocations(v []*string) *PolicyDetails {
2311	s.ResourceLocations = v
2312	return s
2313}
2314
2315// SetResourceTypes sets the ResourceTypes field's value.
2316func (s *PolicyDetails) SetResourceTypes(v []*string) *PolicyDetails {
2317	s.ResourceTypes = v
2318	return s
2319}
2320
2321// SetSchedules sets the Schedules field's value.
2322func (s *PolicyDetails) SetSchedules(v []*Schedule) *PolicyDetails {
2323	s.Schedules = v
2324	return s
2325}
2326
2327// SetTargetTags sets the TargetTags field's value.
2328func (s *PolicyDetails) SetTargetTags(v []*Tag) *PolicyDetails {
2329	s.TargetTags = v
2330	return s
2331}
2332
2333// A requested resource was not found.
2334type ResourceNotFoundException struct {
2335	_            struct{}                  `type:"structure"`
2336	RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"`
2337
2338	Code_ *string `locationName:"Code" type:"string"`
2339
2340	Message_ *string `locationName:"Message" type:"string"`
2341
2342	// Value is a list of resource IDs that were not found.
2343	ResourceIds []*string `type:"list"`
2344
2345	// Value is the type of resource that was not found.
2346	ResourceType *string `type:"string"`
2347}
2348
2349// String returns the string representation
2350func (s ResourceNotFoundException) String() string {
2351	return awsutil.Prettify(s)
2352}
2353
2354// GoString returns the string representation
2355func (s ResourceNotFoundException) GoString() string {
2356	return s.String()
2357}
2358
2359func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error {
2360	return &ResourceNotFoundException{
2361		RespMetadata: v,
2362	}
2363}
2364
2365// Code returns the exception type name.
2366func (s *ResourceNotFoundException) Code() string {
2367	return "ResourceNotFoundException"
2368}
2369
2370// Message returns the exception's message.
2371func (s *ResourceNotFoundException) Message() string {
2372	if s.Message_ != nil {
2373		return *s.Message_
2374	}
2375	return ""
2376}
2377
2378// OrigErr always returns nil, satisfies awserr.Error interface.
2379func (s *ResourceNotFoundException) OrigErr() error {
2380	return nil
2381}
2382
2383func (s *ResourceNotFoundException) Error() string {
2384	return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String())
2385}
2386
2387// Status code returns the HTTP status code for the request's response error.
2388func (s *ResourceNotFoundException) StatusCode() int {
2389	return s.RespMetadata.StatusCode
2390}
2391
2392// RequestID returns the service's response RequestID for request.
2393func (s *ResourceNotFoundException) RequestID() string {
2394	return s.RespMetadata.RequestID
2395}
2396
2397// Specifies the retention rule for a lifecycle policy. You can retain snapshots
2398// based on either a count or a time interval.
2399type RetainRule struct {
2400	_ struct{} `type:"structure"`
2401
2402	// The number of snapshots to retain for each volume, up to a maximum of 1000.
2403	Count *int64 `min:"1" type:"integer"`
2404
2405	// The amount of time to retain each snapshot. The maximum is 100 years. This
2406	// is equivalent to 1200 months, 5200 weeks, or 36500 days.
2407	Interval *int64 `min:"1" type:"integer"`
2408
2409	// The unit of time for time-based retention.
2410	IntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"`
2411}
2412
2413// String returns the string representation
2414func (s RetainRule) String() string {
2415	return awsutil.Prettify(s)
2416}
2417
2418// GoString returns the string representation
2419func (s RetainRule) GoString() string {
2420	return s.String()
2421}
2422
2423// Validate inspects the fields of the type to determine if they are valid.
2424func (s *RetainRule) Validate() error {
2425	invalidParams := request.ErrInvalidParams{Context: "RetainRule"}
2426	if s.Count != nil && *s.Count < 1 {
2427		invalidParams.Add(request.NewErrParamMinValue("Count", 1))
2428	}
2429	if s.Interval != nil && *s.Interval < 1 {
2430		invalidParams.Add(request.NewErrParamMinValue("Interval", 1))
2431	}
2432
2433	if invalidParams.Len() > 0 {
2434		return invalidParams
2435	}
2436	return nil
2437}
2438
2439// SetCount sets the Count field's value.
2440func (s *RetainRule) SetCount(v int64) *RetainRule {
2441	s.Count = &v
2442	return s
2443}
2444
2445// SetInterval sets the Interval field's value.
2446func (s *RetainRule) SetInterval(v int64) *RetainRule {
2447	s.Interval = &v
2448	return s
2449}
2450
2451// SetIntervalUnit sets the IntervalUnit field's value.
2452func (s *RetainRule) SetIntervalUnit(v string) *RetainRule {
2453	s.IntervalUnit = &v
2454	return s
2455}
2456
2457// Specifies a backup schedule for a snapshot or AMI lifecycle policy.
2458type Schedule struct {
2459	_ struct{} `type:"structure"`
2460
2461	// Copy all user-defined tags on a source volume to snapshots of the volume
2462	// created by this policy.
2463	CopyTags *bool `type:"boolean"`
2464
2465	// The creation rule.
2466	CreateRule *CreateRule `type:"structure"`
2467
2468	// The rule for cross-Region snapshot copies.
2469	//
2470	// You can only specify cross-Region copy rules for policies that create snapshots
2471	// in a Region. If the policy creates snapshots on an Outpost, then you cannot
2472	// copy the snapshots to a Region or to an Outpost. If the policy creates snapshots
2473	// in a Region, then snapshots can be copied to up to three Regions or Outposts.
2474	CrossRegionCopyRules []*CrossRegionCopyRule `type:"list"`
2475
2476	// The rule for enabling fast snapshot restore.
2477	FastRestoreRule *FastRestoreRule `type:"structure"`
2478
2479	// The name of the schedule.
2480	Name *string `type:"string"`
2481
2482	// The retention rule.
2483	RetainRule *RetainRule `type:"structure"`
2484
2485	// The rule for sharing snapshots with other AWS accounts.
2486	ShareRules []*ShareRule `type:"list"`
2487
2488	// The tags to apply to policy-created resources. These user-defined tags are
2489	// in addition to the AWS-added lifecycle tags.
2490	TagsToAdd []*Tag `type:"list"`
2491
2492	// A collection of key/value pairs with values determined dynamically when the
2493	// policy is executed. Keys may be any valid Amazon EC2 tag key. Values must
2494	// be in one of the two following formats: $(instance-id) or $(timestamp). Variable
2495	// tags are only valid for EBS Snapshot Management – Instance policies.
2496	VariableTags []*Tag `type:"list"`
2497}
2498
2499// String returns the string representation
2500func (s Schedule) String() string {
2501	return awsutil.Prettify(s)
2502}
2503
2504// GoString returns the string representation
2505func (s Schedule) GoString() string {
2506	return s.String()
2507}
2508
2509// Validate inspects the fields of the type to determine if they are valid.
2510func (s *Schedule) Validate() error {
2511	invalidParams := request.ErrInvalidParams{Context: "Schedule"}
2512	if s.CreateRule != nil {
2513		if err := s.CreateRule.Validate(); err != nil {
2514			invalidParams.AddNested("CreateRule", err.(request.ErrInvalidParams))
2515		}
2516	}
2517	if s.CrossRegionCopyRules != nil {
2518		for i, v := range s.CrossRegionCopyRules {
2519			if v == nil {
2520				continue
2521			}
2522			if err := v.Validate(); err != nil {
2523				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CrossRegionCopyRules", i), err.(request.ErrInvalidParams))
2524			}
2525		}
2526	}
2527	if s.FastRestoreRule != nil {
2528		if err := s.FastRestoreRule.Validate(); err != nil {
2529			invalidParams.AddNested("FastRestoreRule", err.(request.ErrInvalidParams))
2530		}
2531	}
2532	if s.RetainRule != nil {
2533		if err := s.RetainRule.Validate(); err != nil {
2534			invalidParams.AddNested("RetainRule", err.(request.ErrInvalidParams))
2535		}
2536	}
2537	if s.ShareRules != nil {
2538		for i, v := range s.ShareRules {
2539			if v == nil {
2540				continue
2541			}
2542			if err := v.Validate(); err != nil {
2543				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ShareRules", i), err.(request.ErrInvalidParams))
2544			}
2545		}
2546	}
2547	if s.TagsToAdd != nil {
2548		for i, v := range s.TagsToAdd {
2549			if v == nil {
2550				continue
2551			}
2552			if err := v.Validate(); err != nil {
2553				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsToAdd", i), err.(request.ErrInvalidParams))
2554			}
2555		}
2556	}
2557	if s.VariableTags != nil {
2558		for i, v := range s.VariableTags {
2559			if v == nil {
2560				continue
2561			}
2562			if err := v.Validate(); err != nil {
2563				invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VariableTags", i), err.(request.ErrInvalidParams))
2564			}
2565		}
2566	}
2567
2568	if invalidParams.Len() > 0 {
2569		return invalidParams
2570	}
2571	return nil
2572}
2573
2574// SetCopyTags sets the CopyTags field's value.
2575func (s *Schedule) SetCopyTags(v bool) *Schedule {
2576	s.CopyTags = &v
2577	return s
2578}
2579
2580// SetCreateRule sets the CreateRule field's value.
2581func (s *Schedule) SetCreateRule(v *CreateRule) *Schedule {
2582	s.CreateRule = v
2583	return s
2584}
2585
2586// SetCrossRegionCopyRules sets the CrossRegionCopyRules field's value.
2587func (s *Schedule) SetCrossRegionCopyRules(v []*CrossRegionCopyRule) *Schedule {
2588	s.CrossRegionCopyRules = v
2589	return s
2590}
2591
2592// SetFastRestoreRule sets the FastRestoreRule field's value.
2593func (s *Schedule) SetFastRestoreRule(v *FastRestoreRule) *Schedule {
2594	s.FastRestoreRule = v
2595	return s
2596}
2597
2598// SetName sets the Name field's value.
2599func (s *Schedule) SetName(v string) *Schedule {
2600	s.Name = &v
2601	return s
2602}
2603
2604// SetRetainRule sets the RetainRule field's value.
2605func (s *Schedule) SetRetainRule(v *RetainRule) *Schedule {
2606	s.RetainRule = v
2607	return s
2608}
2609
2610// SetShareRules sets the ShareRules field's value.
2611func (s *Schedule) SetShareRules(v []*ShareRule) *Schedule {
2612	s.ShareRules = v
2613	return s
2614}
2615
2616// SetTagsToAdd sets the TagsToAdd field's value.
2617func (s *Schedule) SetTagsToAdd(v []*Tag) *Schedule {
2618	s.TagsToAdd = v
2619	return s
2620}
2621
2622// SetVariableTags sets the VariableTags field's value.
2623func (s *Schedule) SetVariableTags(v []*Tag) *Schedule {
2624	s.VariableTags = v
2625	return s
2626}
2627
2628// Specifies a rule for sharing snapshots across AWS accounts.
2629type ShareRule struct {
2630	_ struct{} `type:"structure"`
2631
2632	// The IDs of the AWS accounts with which to share the snapshots.
2633	//
2634	// TargetAccounts is a required field
2635	TargetAccounts []*string `min:"1" type:"list" required:"true"`
2636
2637	// The period after which snapshots that are shared with other AWS accounts
2638	// are automatically unshared.
2639	UnshareInterval *int64 `min:"1" type:"integer"`
2640
2641	// The unit of time for the automatic unsharing interval.
2642	UnshareIntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"`
2643}
2644
2645// String returns the string representation
2646func (s ShareRule) String() string {
2647	return awsutil.Prettify(s)
2648}
2649
2650// GoString returns the string representation
2651func (s ShareRule) GoString() string {
2652	return s.String()
2653}
2654
2655// Validate inspects the fields of the type to determine if they are valid.
2656func (s *ShareRule) Validate() error {
2657	invalidParams := request.ErrInvalidParams{Context: "ShareRule"}
2658	if s.TargetAccounts == nil {
2659		invalidParams.Add(request.NewErrParamRequired("TargetAccounts"))
2660	}
2661	if s.TargetAccounts != nil && len(s.TargetAccounts) < 1 {
2662		invalidParams.Add(request.NewErrParamMinLen("TargetAccounts", 1))
2663	}
2664	if s.UnshareInterval != nil && *s.UnshareInterval < 1 {
2665		invalidParams.Add(request.NewErrParamMinValue("UnshareInterval", 1))
2666	}
2667
2668	if invalidParams.Len() > 0 {
2669		return invalidParams
2670	}
2671	return nil
2672}
2673
2674// SetTargetAccounts sets the TargetAccounts field's value.
2675func (s *ShareRule) SetTargetAccounts(v []*string) *ShareRule {
2676	s.TargetAccounts = v
2677	return s
2678}
2679
2680// SetUnshareInterval sets the UnshareInterval field's value.
2681func (s *ShareRule) SetUnshareInterval(v int64) *ShareRule {
2682	s.UnshareInterval = &v
2683	return s
2684}
2685
2686// SetUnshareIntervalUnit sets the UnshareIntervalUnit field's value.
2687func (s *ShareRule) SetUnshareIntervalUnit(v string) *ShareRule {
2688	s.UnshareIntervalUnit = &v
2689	return s
2690}
2691
2692// Specifies a tag for a resource.
2693type Tag struct {
2694	_ struct{} `type:"structure"`
2695
2696	// The tag key.
2697	//
2698	// Key is a required field
2699	Key *string `type:"string" required:"true"`
2700
2701	// The tag value.
2702	//
2703	// Value is a required field
2704	Value *string `type:"string" required:"true"`
2705}
2706
2707// String returns the string representation
2708func (s Tag) String() string {
2709	return awsutil.Prettify(s)
2710}
2711
2712// GoString returns the string representation
2713func (s Tag) GoString() string {
2714	return s.String()
2715}
2716
2717// Validate inspects the fields of the type to determine if they are valid.
2718func (s *Tag) Validate() error {
2719	invalidParams := request.ErrInvalidParams{Context: "Tag"}
2720	if s.Key == nil {
2721		invalidParams.Add(request.NewErrParamRequired("Key"))
2722	}
2723	if s.Value == nil {
2724		invalidParams.Add(request.NewErrParamRequired("Value"))
2725	}
2726
2727	if invalidParams.Len() > 0 {
2728		return invalidParams
2729	}
2730	return nil
2731}
2732
2733// SetKey sets the Key field's value.
2734func (s *Tag) SetKey(v string) *Tag {
2735	s.Key = &v
2736	return s
2737}
2738
2739// SetValue sets the Value field's value.
2740func (s *Tag) SetValue(v string) *Tag {
2741	s.Value = &v
2742	return s
2743}
2744
2745type TagResourceInput struct {
2746	_ struct{} `type:"structure"`
2747
2748	// The Amazon Resource Name (ARN) of the resource.
2749	//
2750	// ResourceArn is a required field
2751	ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"`
2752
2753	// One or more tags.
2754	//
2755	// Tags is a required field
2756	Tags map[string]*string `min:"1" type:"map" required:"true"`
2757}
2758
2759// String returns the string representation
2760func (s TagResourceInput) String() string {
2761	return awsutil.Prettify(s)
2762}
2763
2764// GoString returns the string representation
2765func (s TagResourceInput) GoString() string {
2766	return s.String()
2767}
2768
2769// Validate inspects the fields of the type to determine if they are valid.
2770func (s *TagResourceInput) Validate() error {
2771	invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"}
2772	if s.ResourceArn == nil {
2773		invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
2774	}
2775	if s.ResourceArn != nil && len(*s.ResourceArn) < 1 {
2776		invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1))
2777	}
2778	if s.Tags == nil {
2779		invalidParams.Add(request.NewErrParamRequired("Tags"))
2780	}
2781	if s.Tags != nil && len(s.Tags) < 1 {
2782		invalidParams.Add(request.NewErrParamMinLen("Tags", 1))
2783	}
2784
2785	if invalidParams.Len() > 0 {
2786		return invalidParams
2787	}
2788	return nil
2789}
2790
2791// SetResourceArn sets the ResourceArn field's value.
2792func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput {
2793	s.ResourceArn = &v
2794	return s
2795}
2796
2797// SetTags sets the Tags field's value.
2798func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput {
2799	s.Tags = v
2800	return s
2801}
2802
2803type TagResourceOutput struct {
2804	_ struct{} `type:"structure"`
2805}
2806
2807// String returns the string representation
2808func (s TagResourceOutput) String() string {
2809	return awsutil.Prettify(s)
2810}
2811
2812// GoString returns the string representation
2813func (s TagResourceOutput) GoString() string {
2814	return s.String()
2815}
2816
2817type UntagResourceInput struct {
2818	_ struct{} `type:"structure"`
2819
2820	// The Amazon Resource Name (ARN) of the resource.
2821	//
2822	// ResourceArn is a required field
2823	ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"`
2824
2825	// The tag keys.
2826	//
2827	// TagKeys is a required field
2828	TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" required:"true"`
2829}
2830
2831// String returns the string representation
2832func (s UntagResourceInput) String() string {
2833	return awsutil.Prettify(s)
2834}
2835
2836// GoString returns the string representation
2837func (s UntagResourceInput) GoString() string {
2838	return s.String()
2839}
2840
2841// Validate inspects the fields of the type to determine if they are valid.
2842func (s *UntagResourceInput) Validate() error {
2843	invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"}
2844	if s.ResourceArn == nil {
2845		invalidParams.Add(request.NewErrParamRequired("ResourceArn"))
2846	}
2847	if s.ResourceArn != nil && len(*s.ResourceArn) < 1 {
2848		invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1))
2849	}
2850	if s.TagKeys == nil {
2851		invalidParams.Add(request.NewErrParamRequired("TagKeys"))
2852	}
2853	if s.TagKeys != nil && len(s.TagKeys) < 1 {
2854		invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1))
2855	}
2856
2857	if invalidParams.Len() > 0 {
2858		return invalidParams
2859	}
2860	return nil
2861}
2862
2863// SetResourceArn sets the ResourceArn field's value.
2864func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput {
2865	s.ResourceArn = &v
2866	return s
2867}
2868
2869// SetTagKeys sets the TagKeys field's value.
2870func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput {
2871	s.TagKeys = v
2872	return s
2873}
2874
2875type UntagResourceOutput struct {
2876	_ struct{} `type:"structure"`
2877}
2878
2879// String returns the string representation
2880func (s UntagResourceOutput) String() string {
2881	return awsutil.Prettify(s)
2882}
2883
2884// GoString returns the string representation
2885func (s UntagResourceOutput) GoString() string {
2886	return s.String()
2887}
2888
2889type UpdateLifecyclePolicyInput struct {
2890	_ struct{} `type:"structure"`
2891
2892	// A description of the lifecycle policy.
2893	Description *string `type:"string"`
2894
2895	// The Amazon Resource Name (ARN) of the IAM role used to run the operations
2896	// specified by the lifecycle policy.
2897	ExecutionRoleArn *string `type:"string"`
2898
2899	// The configuration of the lifecycle policy. You cannot update the policy type
2900	// or the resource type.
2901	PolicyDetails *PolicyDetails `type:"structure"`
2902
2903	// The identifier of the lifecycle policy.
2904	//
2905	// PolicyId is a required field
2906	PolicyId *string `location:"uri" locationName:"policyId" type:"string" required:"true"`
2907
2908	// The desired activation state of the lifecycle policy after creation.
2909	State *string `type:"string" enum:"SettablePolicyStateValues"`
2910}
2911
2912// String returns the string representation
2913func (s UpdateLifecyclePolicyInput) String() string {
2914	return awsutil.Prettify(s)
2915}
2916
2917// GoString returns the string representation
2918func (s UpdateLifecyclePolicyInput) GoString() string {
2919	return s.String()
2920}
2921
2922// Validate inspects the fields of the type to determine if they are valid.
2923func (s *UpdateLifecyclePolicyInput) Validate() error {
2924	invalidParams := request.ErrInvalidParams{Context: "UpdateLifecyclePolicyInput"}
2925	if s.PolicyId == nil {
2926		invalidParams.Add(request.NewErrParamRequired("PolicyId"))
2927	}
2928	if s.PolicyId != nil && len(*s.PolicyId) < 1 {
2929		invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1))
2930	}
2931	if s.PolicyDetails != nil {
2932		if err := s.PolicyDetails.Validate(); err != nil {
2933			invalidParams.AddNested("PolicyDetails", err.(request.ErrInvalidParams))
2934		}
2935	}
2936
2937	if invalidParams.Len() > 0 {
2938		return invalidParams
2939	}
2940	return nil
2941}
2942
2943// SetDescription sets the Description field's value.
2944func (s *UpdateLifecyclePolicyInput) SetDescription(v string) *UpdateLifecyclePolicyInput {
2945	s.Description = &v
2946	return s
2947}
2948
2949// SetExecutionRoleArn sets the ExecutionRoleArn field's value.
2950func (s *UpdateLifecyclePolicyInput) SetExecutionRoleArn(v string) *UpdateLifecyclePolicyInput {
2951	s.ExecutionRoleArn = &v
2952	return s
2953}
2954
2955// SetPolicyDetails sets the PolicyDetails field's value.
2956func (s *UpdateLifecyclePolicyInput) SetPolicyDetails(v *PolicyDetails) *UpdateLifecyclePolicyInput {
2957	s.PolicyDetails = v
2958	return s
2959}
2960
2961// SetPolicyId sets the PolicyId field's value.
2962func (s *UpdateLifecyclePolicyInput) SetPolicyId(v string) *UpdateLifecyclePolicyInput {
2963	s.PolicyId = &v
2964	return s
2965}
2966
2967// SetState sets the State field's value.
2968func (s *UpdateLifecyclePolicyInput) SetState(v string) *UpdateLifecyclePolicyInput {
2969	s.State = &v
2970	return s
2971}
2972
2973type UpdateLifecyclePolicyOutput struct {
2974	_ struct{} `type:"structure"`
2975}
2976
2977// String returns the string representation
2978func (s UpdateLifecyclePolicyOutput) String() string {
2979	return awsutil.Prettify(s)
2980}
2981
2982// GoString returns the string representation
2983func (s UpdateLifecyclePolicyOutput) GoString() string {
2984	return s.String()
2985}
2986
2987const (
2988	// EventSourceValuesManagedCwe is a EventSourceValues enum value
2989	EventSourceValuesManagedCwe = "MANAGED_CWE"
2990)
2991
2992// EventSourceValues_Values returns all elements of the EventSourceValues enum
2993func EventSourceValues_Values() []string {
2994	return []string{
2995		EventSourceValuesManagedCwe,
2996	}
2997}
2998
2999const (
3000	// EventTypeValuesShareSnapshot is a EventTypeValues enum value
3001	EventTypeValuesShareSnapshot = "shareSnapshot"
3002)
3003
3004// EventTypeValues_Values returns all elements of the EventTypeValues enum
3005func EventTypeValues_Values() []string {
3006	return []string{
3007		EventTypeValuesShareSnapshot,
3008	}
3009}
3010
3011const (
3012	// GettablePolicyStateValuesEnabled is a GettablePolicyStateValues enum value
3013	GettablePolicyStateValuesEnabled = "ENABLED"
3014
3015	// GettablePolicyStateValuesDisabled is a GettablePolicyStateValues enum value
3016	GettablePolicyStateValuesDisabled = "DISABLED"
3017
3018	// GettablePolicyStateValuesError is a GettablePolicyStateValues enum value
3019	GettablePolicyStateValuesError = "ERROR"
3020)
3021
3022// GettablePolicyStateValues_Values returns all elements of the GettablePolicyStateValues enum
3023func GettablePolicyStateValues_Values() []string {
3024	return []string{
3025		GettablePolicyStateValuesEnabled,
3026		GettablePolicyStateValuesDisabled,
3027		GettablePolicyStateValuesError,
3028	}
3029}
3030
3031const (
3032	// IntervalUnitValuesHours is a IntervalUnitValues enum value
3033	IntervalUnitValuesHours = "HOURS"
3034)
3035
3036// IntervalUnitValues_Values returns all elements of the IntervalUnitValues enum
3037func IntervalUnitValues_Values() []string {
3038	return []string{
3039		IntervalUnitValuesHours,
3040	}
3041}
3042
3043const (
3044	// LocationValuesCloud is a LocationValues enum value
3045	LocationValuesCloud = "CLOUD"
3046
3047	// LocationValuesOutpostLocal is a LocationValues enum value
3048	LocationValuesOutpostLocal = "OUTPOST_LOCAL"
3049)
3050
3051// LocationValues_Values returns all elements of the LocationValues enum
3052func LocationValues_Values() []string {
3053	return []string{
3054		LocationValuesCloud,
3055		LocationValuesOutpostLocal,
3056	}
3057}
3058
3059const (
3060	// PolicyTypeValuesEbsSnapshotManagement is a PolicyTypeValues enum value
3061	PolicyTypeValuesEbsSnapshotManagement = "EBS_SNAPSHOT_MANAGEMENT"
3062
3063	// PolicyTypeValuesImageManagement is a PolicyTypeValues enum value
3064	PolicyTypeValuesImageManagement = "IMAGE_MANAGEMENT"
3065
3066	// PolicyTypeValuesEventBasedPolicy is a PolicyTypeValues enum value
3067	PolicyTypeValuesEventBasedPolicy = "EVENT_BASED_POLICY"
3068)
3069
3070// PolicyTypeValues_Values returns all elements of the PolicyTypeValues enum
3071func PolicyTypeValues_Values() []string {
3072	return []string{
3073		PolicyTypeValuesEbsSnapshotManagement,
3074		PolicyTypeValuesImageManagement,
3075		PolicyTypeValuesEventBasedPolicy,
3076	}
3077}
3078
3079const (
3080	// ResourceLocationValuesCloud is a ResourceLocationValues enum value
3081	ResourceLocationValuesCloud = "CLOUD"
3082
3083	// ResourceLocationValuesOutpost is a ResourceLocationValues enum value
3084	ResourceLocationValuesOutpost = "OUTPOST"
3085)
3086
3087// ResourceLocationValues_Values returns all elements of the ResourceLocationValues enum
3088func ResourceLocationValues_Values() []string {
3089	return []string{
3090		ResourceLocationValuesCloud,
3091		ResourceLocationValuesOutpost,
3092	}
3093}
3094
3095const (
3096	// ResourceTypeValuesVolume is a ResourceTypeValues enum value
3097	ResourceTypeValuesVolume = "VOLUME"
3098
3099	// ResourceTypeValuesInstance is a ResourceTypeValues enum value
3100	ResourceTypeValuesInstance = "INSTANCE"
3101)
3102
3103// ResourceTypeValues_Values returns all elements of the ResourceTypeValues enum
3104func ResourceTypeValues_Values() []string {
3105	return []string{
3106		ResourceTypeValuesVolume,
3107		ResourceTypeValuesInstance,
3108	}
3109}
3110
3111const (
3112	// RetentionIntervalUnitValuesDays is a RetentionIntervalUnitValues enum value
3113	RetentionIntervalUnitValuesDays = "DAYS"
3114
3115	// RetentionIntervalUnitValuesWeeks is a RetentionIntervalUnitValues enum value
3116	RetentionIntervalUnitValuesWeeks = "WEEKS"
3117
3118	// RetentionIntervalUnitValuesMonths is a RetentionIntervalUnitValues enum value
3119	RetentionIntervalUnitValuesMonths = "MONTHS"
3120
3121	// RetentionIntervalUnitValuesYears is a RetentionIntervalUnitValues enum value
3122	RetentionIntervalUnitValuesYears = "YEARS"
3123)
3124
3125// RetentionIntervalUnitValues_Values returns all elements of the RetentionIntervalUnitValues enum
3126func RetentionIntervalUnitValues_Values() []string {
3127	return []string{
3128		RetentionIntervalUnitValuesDays,
3129		RetentionIntervalUnitValuesWeeks,
3130		RetentionIntervalUnitValuesMonths,
3131		RetentionIntervalUnitValuesYears,
3132	}
3133}
3134
3135const (
3136	// SettablePolicyStateValuesEnabled is a SettablePolicyStateValues enum value
3137	SettablePolicyStateValuesEnabled = "ENABLED"
3138
3139	// SettablePolicyStateValuesDisabled is a SettablePolicyStateValues enum value
3140	SettablePolicyStateValuesDisabled = "DISABLED"
3141)
3142
3143// SettablePolicyStateValues_Values returns all elements of the SettablePolicyStateValues enum
3144func SettablePolicyStateValues_Values() []string {
3145	return []string{
3146		SettablePolicyStateValuesEnabled,
3147		SettablePolicyStateValuesDisabled,
3148	}
3149}
3150