api.go 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package dlm
  3. import (
  4. "fmt"
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws"
  7. "github.com/aws/aws-sdk-go/aws/awsutil"
  8. "github.com/aws/aws-sdk-go/aws/request"
  9. "github.com/aws/aws-sdk-go/private/protocol"
  10. "github.com/aws/aws-sdk-go/private/protocol/restjson"
  11. )
  12. const opCreateLifecyclePolicy = "CreateLifecyclePolicy"
  13. // CreateLifecyclePolicyRequest generates a "aws/request.Request" representing the
  14. // client's request for the CreateLifecyclePolicy operation. The "output" return
  15. // value will be populated with the request's response once the request completes
  16. // successfully.
  17. //
  18. // Use "Send" method on the returned Request to send the API call to the service.
  19. // the "output" return value is not valid until after Send returns without error.
  20. //
  21. // See CreateLifecyclePolicy for more information on using the CreateLifecyclePolicy
  22. // API call, and error handling.
  23. //
  24. // This method is useful when you want to inject custom logic or configuration
  25. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  26. //
  27. //
  28. // // Example sending a request using the CreateLifecyclePolicyRequest method.
  29. // req, resp := client.CreateLifecyclePolicyRequest(params)
  30. //
  31. // err := req.Send()
  32. // if err == nil { // resp is now filled
  33. // fmt.Println(resp)
  34. // }
  35. //
  36. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/CreateLifecyclePolicy
  37. func (c *DLM) CreateLifecyclePolicyRequest(input *CreateLifecyclePolicyInput) (req *request.Request, output *CreateLifecyclePolicyOutput) {
  38. op := &request.Operation{
  39. Name: opCreateLifecyclePolicy,
  40. HTTPMethod: "POST",
  41. HTTPPath: "/policies",
  42. }
  43. if input == nil {
  44. input = &CreateLifecyclePolicyInput{}
  45. }
  46. output = &CreateLifecyclePolicyOutput{}
  47. req = c.newRequest(op, input, output)
  48. return
  49. }
  50. // CreateLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
  51. //
  52. // Creates a policy to manage the lifecycle of the specified AWS resources.
  53. // You can create up to 100 lifecycle policies.
  54. //
  55. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  56. // with awserr.Error's Code and Message methods to get detailed information about
  57. // the error.
  58. //
  59. // See the AWS API reference guide for Amazon Data Lifecycle Manager's
  60. // API operation CreateLifecyclePolicy for usage and error information.
  61. //
  62. // Returned Error Codes:
  63. // * ErrCodeInvalidRequestException "InvalidRequestException"
  64. // Bad request. The request is missing required parameters or has invalid parameters.
  65. //
  66. // * ErrCodeLimitExceededException "LimitExceededException"
  67. // The request failed because a limit was exceeded.
  68. //
  69. // * ErrCodeInternalServerException "InternalServerException"
  70. // The service failed in an unexpected way.
  71. //
  72. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/CreateLifecyclePolicy
  73. func (c *DLM) CreateLifecyclePolicy(input *CreateLifecyclePolicyInput) (*CreateLifecyclePolicyOutput, error) {
  74. req, out := c.CreateLifecyclePolicyRequest(input)
  75. return out, req.Send()
  76. }
  77. // CreateLifecyclePolicyWithContext is the same as CreateLifecyclePolicy with the addition of
  78. // the ability to pass a context and additional request options.
  79. //
  80. // See CreateLifecyclePolicy for details on how to use this API operation.
  81. //
  82. // The context must be non-nil and will be used for request cancellation. If
  83. // the context is nil a panic will occur. In the future the SDK may create
  84. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  85. // for more information on using Contexts.
  86. func (c *DLM) CreateLifecyclePolicyWithContext(ctx aws.Context, input *CreateLifecyclePolicyInput, opts ...request.Option) (*CreateLifecyclePolicyOutput, error) {
  87. req, out := c.CreateLifecyclePolicyRequest(input)
  88. req.SetContext(ctx)
  89. req.ApplyOptions(opts...)
  90. return out, req.Send()
  91. }
  92. const opDeleteLifecyclePolicy = "DeleteLifecyclePolicy"
  93. // DeleteLifecyclePolicyRequest generates a "aws/request.Request" representing the
  94. // client's request for the DeleteLifecyclePolicy operation. The "output" return
  95. // value will be populated with the request's response once the request completes
  96. // successfully.
  97. //
  98. // Use "Send" method on the returned Request to send the API call to the service.
  99. // the "output" return value is not valid until after Send returns without error.
  100. //
  101. // See DeleteLifecyclePolicy for more information on using the DeleteLifecyclePolicy
  102. // API call, and error handling.
  103. //
  104. // This method is useful when you want to inject custom logic or configuration
  105. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  106. //
  107. //
  108. // // Example sending a request using the DeleteLifecyclePolicyRequest method.
  109. // req, resp := client.DeleteLifecyclePolicyRequest(params)
  110. //
  111. // err := req.Send()
  112. // if err == nil { // resp is now filled
  113. // fmt.Println(resp)
  114. // }
  115. //
  116. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/DeleteLifecyclePolicy
  117. func (c *DLM) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) (req *request.Request, output *DeleteLifecyclePolicyOutput) {
  118. op := &request.Operation{
  119. Name: opDeleteLifecyclePolicy,
  120. HTTPMethod: "DELETE",
  121. HTTPPath: "/policies/{policyId}/",
  122. }
  123. if input == nil {
  124. input = &DeleteLifecyclePolicyInput{}
  125. }
  126. output = &DeleteLifecyclePolicyOutput{}
  127. req = c.newRequest(op, input, output)
  128. req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  129. return
  130. }
  131. // DeleteLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
  132. //
  133. // Deletes the specified lifecycle policy and halts the automated operations
  134. // that the policy specified.
  135. //
  136. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  137. // with awserr.Error's Code and Message methods to get detailed information about
  138. // the error.
  139. //
  140. // See the AWS API reference guide for Amazon Data Lifecycle Manager's
  141. // API operation DeleteLifecyclePolicy for usage and error information.
  142. //
  143. // Returned Error Codes:
  144. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  145. // A requested resource was not found.
  146. //
  147. // * ErrCodeInternalServerException "InternalServerException"
  148. // The service failed in an unexpected way.
  149. //
  150. // * ErrCodeLimitExceededException "LimitExceededException"
  151. // The request failed because a limit was exceeded.
  152. //
  153. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/DeleteLifecyclePolicy
  154. func (c *DLM) DeleteLifecyclePolicy(input *DeleteLifecyclePolicyInput) (*DeleteLifecyclePolicyOutput, error) {
  155. req, out := c.DeleteLifecyclePolicyRequest(input)
  156. return out, req.Send()
  157. }
  158. // DeleteLifecyclePolicyWithContext is the same as DeleteLifecyclePolicy with the addition of
  159. // the ability to pass a context and additional request options.
  160. //
  161. // See DeleteLifecyclePolicy for details on how to use this API operation.
  162. //
  163. // The context must be non-nil and will be used for request cancellation. If
  164. // the context is nil a panic will occur. In the future the SDK may create
  165. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  166. // for more information on using Contexts.
  167. func (c *DLM) DeleteLifecyclePolicyWithContext(ctx aws.Context, input *DeleteLifecyclePolicyInput, opts ...request.Option) (*DeleteLifecyclePolicyOutput, error) {
  168. req, out := c.DeleteLifecyclePolicyRequest(input)
  169. req.SetContext(ctx)
  170. req.ApplyOptions(opts...)
  171. return out, req.Send()
  172. }
  173. const opGetLifecyclePolicies = "GetLifecyclePolicies"
  174. // GetLifecyclePoliciesRequest generates a "aws/request.Request" representing the
  175. // client's request for the GetLifecyclePolicies operation. The "output" return
  176. // value will be populated with the request's response once the request completes
  177. // successfully.
  178. //
  179. // Use "Send" method on the returned Request to send the API call to the service.
  180. // the "output" return value is not valid until after Send returns without error.
  181. //
  182. // See GetLifecyclePolicies for more information on using the GetLifecyclePolicies
  183. // API call, and error handling.
  184. //
  185. // This method is useful when you want to inject custom logic or configuration
  186. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  187. //
  188. //
  189. // // Example sending a request using the GetLifecyclePoliciesRequest method.
  190. // req, resp := client.GetLifecyclePoliciesRequest(params)
  191. //
  192. // err := req.Send()
  193. // if err == nil { // resp is now filled
  194. // fmt.Println(resp)
  195. // }
  196. //
  197. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicies
  198. func (c *DLM) GetLifecyclePoliciesRequest(input *GetLifecyclePoliciesInput) (req *request.Request, output *GetLifecyclePoliciesOutput) {
  199. op := &request.Operation{
  200. Name: opGetLifecyclePolicies,
  201. HTTPMethod: "GET",
  202. HTTPPath: "/policies",
  203. }
  204. if input == nil {
  205. input = &GetLifecyclePoliciesInput{}
  206. }
  207. output = &GetLifecyclePoliciesOutput{}
  208. req = c.newRequest(op, input, output)
  209. return
  210. }
  211. // GetLifecyclePolicies API operation for Amazon Data Lifecycle Manager.
  212. //
  213. // Gets summary information about all or the specified data lifecycle policies.
  214. //
  215. // To get complete information about a policy, use GetLifecyclePolicy.
  216. //
  217. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  218. // with awserr.Error's Code and Message methods to get detailed information about
  219. // the error.
  220. //
  221. // See the AWS API reference guide for Amazon Data Lifecycle Manager's
  222. // API operation GetLifecyclePolicies for usage and error information.
  223. //
  224. // Returned Error Codes:
  225. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  226. // A requested resource was not found.
  227. //
  228. // * ErrCodeInvalidRequestException "InvalidRequestException"
  229. // Bad request. The request is missing required parameters or has invalid parameters.
  230. //
  231. // * ErrCodeInternalServerException "InternalServerException"
  232. // The service failed in an unexpected way.
  233. //
  234. // * ErrCodeLimitExceededException "LimitExceededException"
  235. // The request failed because a limit was exceeded.
  236. //
  237. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicies
  238. func (c *DLM) GetLifecyclePolicies(input *GetLifecyclePoliciesInput) (*GetLifecyclePoliciesOutput, error) {
  239. req, out := c.GetLifecyclePoliciesRequest(input)
  240. return out, req.Send()
  241. }
  242. // GetLifecyclePoliciesWithContext is the same as GetLifecyclePolicies with the addition of
  243. // the ability to pass a context and additional request options.
  244. //
  245. // See GetLifecyclePolicies for details on how to use this API operation.
  246. //
  247. // The context must be non-nil and will be used for request cancellation. If
  248. // the context is nil a panic will occur. In the future the SDK may create
  249. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  250. // for more information on using Contexts.
  251. func (c *DLM) GetLifecyclePoliciesWithContext(ctx aws.Context, input *GetLifecyclePoliciesInput, opts ...request.Option) (*GetLifecyclePoliciesOutput, error) {
  252. req, out := c.GetLifecyclePoliciesRequest(input)
  253. req.SetContext(ctx)
  254. req.ApplyOptions(opts...)
  255. return out, req.Send()
  256. }
  257. const opGetLifecyclePolicy = "GetLifecyclePolicy"
  258. // GetLifecyclePolicyRequest generates a "aws/request.Request" representing the
  259. // client's request for the GetLifecyclePolicy operation. The "output" return
  260. // value will be populated with the request's response once the request completes
  261. // successfully.
  262. //
  263. // Use "Send" method on the returned Request to send the API call to the service.
  264. // the "output" return value is not valid until after Send returns without error.
  265. //
  266. // See GetLifecyclePolicy for more information on using the GetLifecyclePolicy
  267. // API call, and error handling.
  268. //
  269. // This method is useful when you want to inject custom logic or configuration
  270. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  271. //
  272. //
  273. // // Example sending a request using the GetLifecyclePolicyRequest method.
  274. // req, resp := client.GetLifecyclePolicyRequest(params)
  275. //
  276. // err := req.Send()
  277. // if err == nil { // resp is now filled
  278. // fmt.Println(resp)
  279. // }
  280. //
  281. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicy
  282. func (c *DLM) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) (req *request.Request, output *GetLifecyclePolicyOutput) {
  283. op := &request.Operation{
  284. Name: opGetLifecyclePolicy,
  285. HTTPMethod: "GET",
  286. HTTPPath: "/policies/{policyId}/",
  287. }
  288. if input == nil {
  289. input = &GetLifecyclePolicyInput{}
  290. }
  291. output = &GetLifecyclePolicyOutput{}
  292. req = c.newRequest(op, input, output)
  293. return
  294. }
  295. // GetLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
  296. //
  297. // Gets detailed information about the specified lifecycle policy.
  298. //
  299. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  300. // with awserr.Error's Code and Message methods to get detailed information about
  301. // the error.
  302. //
  303. // See the AWS API reference guide for Amazon Data Lifecycle Manager's
  304. // API operation GetLifecyclePolicy for usage and error information.
  305. //
  306. // Returned Error Codes:
  307. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  308. // A requested resource was not found.
  309. //
  310. // * ErrCodeInternalServerException "InternalServerException"
  311. // The service failed in an unexpected way.
  312. //
  313. // * ErrCodeLimitExceededException "LimitExceededException"
  314. // The request failed because a limit was exceeded.
  315. //
  316. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicy
  317. func (c *DLM) GetLifecyclePolicy(input *GetLifecyclePolicyInput) (*GetLifecyclePolicyOutput, error) {
  318. req, out := c.GetLifecyclePolicyRequest(input)
  319. return out, req.Send()
  320. }
  321. // GetLifecyclePolicyWithContext is the same as GetLifecyclePolicy with the addition of
  322. // the ability to pass a context and additional request options.
  323. //
  324. // See GetLifecyclePolicy for details on how to use this API operation.
  325. //
  326. // The context must be non-nil and will be used for request cancellation. If
  327. // the context is nil a panic will occur. In the future the SDK may create
  328. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  329. // for more information on using Contexts.
  330. func (c *DLM) GetLifecyclePolicyWithContext(ctx aws.Context, input *GetLifecyclePolicyInput, opts ...request.Option) (*GetLifecyclePolicyOutput, error) {
  331. req, out := c.GetLifecyclePolicyRequest(input)
  332. req.SetContext(ctx)
  333. req.ApplyOptions(opts...)
  334. return out, req.Send()
  335. }
  336. const opUpdateLifecyclePolicy = "UpdateLifecyclePolicy"
  337. // UpdateLifecyclePolicyRequest generates a "aws/request.Request" representing the
  338. // client's request for the UpdateLifecyclePolicy operation. The "output" return
  339. // value will be populated with the request's response once the request completes
  340. // successfully.
  341. //
  342. // Use "Send" method on the returned Request to send the API call to the service.
  343. // the "output" return value is not valid until after Send returns without error.
  344. //
  345. // See UpdateLifecyclePolicy for more information on using the UpdateLifecyclePolicy
  346. // API call, and error handling.
  347. //
  348. // This method is useful when you want to inject custom logic or configuration
  349. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  350. //
  351. //
  352. // // Example sending a request using the UpdateLifecyclePolicyRequest method.
  353. // req, resp := client.UpdateLifecyclePolicyRequest(params)
  354. //
  355. // err := req.Send()
  356. // if err == nil { // resp is now filled
  357. // fmt.Println(resp)
  358. // }
  359. //
  360. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UpdateLifecyclePolicy
  361. func (c *DLM) UpdateLifecyclePolicyRequest(input *UpdateLifecyclePolicyInput) (req *request.Request, output *UpdateLifecyclePolicyOutput) {
  362. op := &request.Operation{
  363. Name: opUpdateLifecyclePolicy,
  364. HTTPMethod: "PATCH",
  365. HTTPPath: "/policies/{policyId}",
  366. }
  367. if input == nil {
  368. input = &UpdateLifecyclePolicyInput{}
  369. }
  370. output = &UpdateLifecyclePolicyOutput{}
  371. req = c.newRequest(op, input, output)
  372. req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  373. return
  374. }
  375. // UpdateLifecyclePolicy API operation for Amazon Data Lifecycle Manager.
  376. //
  377. // Updates the specified lifecycle policy.
  378. //
  379. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  380. // with awserr.Error's Code and Message methods to get detailed information about
  381. // the error.
  382. //
  383. // See the AWS API reference guide for Amazon Data Lifecycle Manager's
  384. // API operation UpdateLifecyclePolicy for usage and error information.
  385. //
  386. // Returned Error Codes:
  387. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  388. // A requested resource was not found.
  389. //
  390. // * ErrCodeInvalidRequestException "InvalidRequestException"
  391. // Bad request. The request is missing required parameters or has invalid parameters.
  392. //
  393. // * ErrCodeInternalServerException "InternalServerException"
  394. // The service failed in an unexpected way.
  395. //
  396. // * ErrCodeLimitExceededException "LimitExceededException"
  397. // The request failed because a limit was exceeded.
  398. //
  399. // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UpdateLifecyclePolicy
  400. func (c *DLM) UpdateLifecyclePolicy(input *UpdateLifecyclePolicyInput) (*UpdateLifecyclePolicyOutput, error) {
  401. req, out := c.UpdateLifecyclePolicyRequest(input)
  402. return out, req.Send()
  403. }
  404. // UpdateLifecyclePolicyWithContext is the same as UpdateLifecyclePolicy with the addition of
  405. // the ability to pass a context and additional request options.
  406. //
  407. // See UpdateLifecyclePolicy for details on how to use this API operation.
  408. //
  409. // The context must be non-nil and will be used for request cancellation. If
  410. // the context is nil a panic will occur. In the future the SDK may create
  411. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  412. // for more information on using Contexts.
  413. func (c *DLM) UpdateLifecyclePolicyWithContext(ctx aws.Context, input *UpdateLifecyclePolicyInput, opts ...request.Option) (*UpdateLifecyclePolicyOutput, error) {
  414. req, out := c.UpdateLifecyclePolicyRequest(input)
  415. req.SetContext(ctx)
  416. req.ApplyOptions(opts...)
  417. return out, req.Send()
  418. }
  419. type CreateLifecyclePolicyInput struct {
  420. _ struct{} `type:"structure"`
  421. // A description of the lifecycle policy. The characters ^[0-9A-Za-z _-]+$ are
  422. // supported.
  423. //
  424. // Description is a required field
  425. Description *string `type:"string" required:"true"`
  426. // The Amazon Resource Name (ARN) of the IAM role used to run the operations
  427. // specified by the lifecycle policy.
  428. //
  429. // ExecutionRoleArn is a required field
  430. ExecutionRoleArn *string `type:"string" required:"true"`
  431. // The configuration details of the lifecycle policy.
  432. //
  433. // Target tags cannot be re-used across lifecycle policies.
  434. //
  435. // PolicyDetails is a required field
  436. PolicyDetails *PolicyDetails `type:"structure" required:"true"`
  437. // The desired activation state of the lifecycle policy after creation.
  438. //
  439. // State is a required field
  440. State *string `type:"string" required:"true" enum:"SettablePolicyStateValues"`
  441. }
  442. // String returns the string representation
  443. func (s CreateLifecyclePolicyInput) String() string {
  444. return awsutil.Prettify(s)
  445. }
  446. // GoString returns the string representation
  447. func (s CreateLifecyclePolicyInput) GoString() string {
  448. return s.String()
  449. }
  450. // Validate inspects the fields of the type to determine if they are valid.
  451. func (s *CreateLifecyclePolicyInput) Validate() error {
  452. invalidParams := request.ErrInvalidParams{Context: "CreateLifecyclePolicyInput"}
  453. if s.Description == nil {
  454. invalidParams.Add(request.NewErrParamRequired("Description"))
  455. }
  456. if s.ExecutionRoleArn == nil {
  457. invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn"))
  458. }
  459. if s.PolicyDetails == nil {
  460. invalidParams.Add(request.NewErrParamRequired("PolicyDetails"))
  461. }
  462. if s.State == nil {
  463. invalidParams.Add(request.NewErrParamRequired("State"))
  464. }
  465. if s.PolicyDetails != nil {
  466. if err := s.PolicyDetails.Validate(); err != nil {
  467. invalidParams.AddNested("PolicyDetails", err.(request.ErrInvalidParams))
  468. }
  469. }
  470. if invalidParams.Len() > 0 {
  471. return invalidParams
  472. }
  473. return nil
  474. }
  475. // SetDescription sets the Description field's value.
  476. func (s *CreateLifecyclePolicyInput) SetDescription(v string) *CreateLifecyclePolicyInput {
  477. s.Description = &v
  478. return s
  479. }
  480. // SetExecutionRoleArn sets the ExecutionRoleArn field's value.
  481. func (s *CreateLifecyclePolicyInput) SetExecutionRoleArn(v string) *CreateLifecyclePolicyInput {
  482. s.ExecutionRoleArn = &v
  483. return s
  484. }
  485. // SetPolicyDetails sets the PolicyDetails field's value.
  486. func (s *CreateLifecyclePolicyInput) SetPolicyDetails(v *PolicyDetails) *CreateLifecyclePolicyInput {
  487. s.PolicyDetails = v
  488. return s
  489. }
  490. // SetState sets the State field's value.
  491. func (s *CreateLifecyclePolicyInput) SetState(v string) *CreateLifecyclePolicyInput {
  492. s.State = &v
  493. return s
  494. }
  495. type CreateLifecyclePolicyOutput struct {
  496. _ struct{} `type:"structure"`
  497. // The identifier of the lifecycle policy.
  498. PolicyId *string `type:"string"`
  499. }
  500. // String returns the string representation
  501. func (s CreateLifecyclePolicyOutput) String() string {
  502. return awsutil.Prettify(s)
  503. }
  504. // GoString returns the string representation
  505. func (s CreateLifecyclePolicyOutput) GoString() string {
  506. return s.String()
  507. }
  508. // SetPolicyId sets the PolicyId field's value.
  509. func (s *CreateLifecyclePolicyOutput) SetPolicyId(v string) *CreateLifecyclePolicyOutput {
  510. s.PolicyId = &v
  511. return s
  512. }
  513. // Specifies when to create snapshots of EBS volumes.
  514. type CreateRule struct {
  515. _ struct{} `type:"structure"`
  516. // The interval. The supported values are 12 and 24.
  517. //
  518. // Interval is a required field
  519. Interval *int64 `min:"1" type:"integer" required:"true"`
  520. // The interval unit.
  521. //
  522. // IntervalUnit is a required field
  523. IntervalUnit *string `type:"string" required:"true" enum:"IntervalUnitValues"`
  524. // The time, in UTC, to start the operation.
  525. //
  526. // The operation occurs within a one-hour window following the specified time.
  527. Times []*string `type:"list"`
  528. }
  529. // String returns the string representation
  530. func (s CreateRule) String() string {
  531. return awsutil.Prettify(s)
  532. }
  533. // GoString returns the string representation
  534. func (s CreateRule) GoString() string {
  535. return s.String()
  536. }
  537. // Validate inspects the fields of the type to determine if they are valid.
  538. func (s *CreateRule) Validate() error {
  539. invalidParams := request.ErrInvalidParams{Context: "CreateRule"}
  540. if s.Interval == nil {
  541. invalidParams.Add(request.NewErrParamRequired("Interval"))
  542. }
  543. if s.Interval != nil && *s.Interval < 1 {
  544. invalidParams.Add(request.NewErrParamMinValue("Interval", 1))
  545. }
  546. if s.IntervalUnit == nil {
  547. invalidParams.Add(request.NewErrParamRequired("IntervalUnit"))
  548. }
  549. if invalidParams.Len() > 0 {
  550. return invalidParams
  551. }
  552. return nil
  553. }
  554. // SetInterval sets the Interval field's value.
  555. func (s *CreateRule) SetInterval(v int64) *CreateRule {
  556. s.Interval = &v
  557. return s
  558. }
  559. // SetIntervalUnit sets the IntervalUnit field's value.
  560. func (s *CreateRule) SetIntervalUnit(v string) *CreateRule {
  561. s.IntervalUnit = &v
  562. return s
  563. }
  564. // SetTimes sets the Times field's value.
  565. func (s *CreateRule) SetTimes(v []*string) *CreateRule {
  566. s.Times = v
  567. return s
  568. }
  569. type DeleteLifecyclePolicyInput struct {
  570. _ struct{} `type:"structure"`
  571. // The identifier of the lifecycle policy.
  572. //
  573. // PolicyId is a required field
  574. PolicyId *string `location:"uri" locationName:"policyId" type:"string" required:"true"`
  575. }
  576. // String returns the string representation
  577. func (s DeleteLifecyclePolicyInput) String() string {
  578. return awsutil.Prettify(s)
  579. }
  580. // GoString returns the string representation
  581. func (s DeleteLifecyclePolicyInput) GoString() string {
  582. return s.String()
  583. }
  584. // Validate inspects the fields of the type to determine if they are valid.
  585. func (s *DeleteLifecyclePolicyInput) Validate() error {
  586. invalidParams := request.ErrInvalidParams{Context: "DeleteLifecyclePolicyInput"}
  587. if s.PolicyId == nil {
  588. invalidParams.Add(request.NewErrParamRequired("PolicyId"))
  589. }
  590. if s.PolicyId != nil && len(*s.PolicyId) < 1 {
  591. invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1))
  592. }
  593. if invalidParams.Len() > 0 {
  594. return invalidParams
  595. }
  596. return nil
  597. }
  598. // SetPolicyId sets the PolicyId field's value.
  599. func (s *DeleteLifecyclePolicyInput) SetPolicyId(v string) *DeleteLifecyclePolicyInput {
  600. s.PolicyId = &v
  601. return s
  602. }
  603. type DeleteLifecyclePolicyOutput struct {
  604. _ struct{} `type:"structure"`
  605. }
  606. // String returns the string representation
  607. func (s DeleteLifecyclePolicyOutput) String() string {
  608. return awsutil.Prettify(s)
  609. }
  610. // GoString returns the string representation
  611. func (s DeleteLifecyclePolicyOutput) GoString() string {
  612. return s.String()
  613. }
  614. type GetLifecyclePoliciesInput struct {
  615. _ struct{} `type:"structure"`
  616. // The identifiers of the data lifecycle policies.
  617. PolicyIds []*string `location:"querystring" locationName:"policyIds" type:"list"`
  618. // The resource type.
  619. ResourceTypes []*string `location:"querystring" locationName:"resourceTypes" min:"1" type:"list"`
  620. // The activation state.
  621. State *string `location:"querystring" locationName:"state" type:"string" enum:"GettablePolicyStateValues"`
  622. // The tags to add to objects created by the policy.
  623. //
  624. // Tags are strings in the format key=value.
  625. //
  626. // These user-defined tags are added in addition to the AWS-added lifecycle
  627. // tags.
  628. TagsToAdd []*string `location:"querystring" locationName:"tagsToAdd" type:"list"`
  629. // The target tag for a policy.
  630. //
  631. // Tags are strings in the format key=value.
  632. TargetTags []*string `location:"querystring" locationName:"targetTags" min:"1" type:"list"`
  633. }
  634. // String returns the string representation
  635. func (s GetLifecyclePoliciesInput) String() string {
  636. return awsutil.Prettify(s)
  637. }
  638. // GoString returns the string representation
  639. func (s GetLifecyclePoliciesInput) GoString() string {
  640. return s.String()
  641. }
  642. // Validate inspects the fields of the type to determine if they are valid.
  643. func (s *GetLifecyclePoliciesInput) Validate() error {
  644. invalidParams := request.ErrInvalidParams{Context: "GetLifecyclePoliciesInput"}
  645. if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 {
  646. invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1))
  647. }
  648. if s.TargetTags != nil && len(s.TargetTags) < 1 {
  649. invalidParams.Add(request.NewErrParamMinLen("TargetTags", 1))
  650. }
  651. if invalidParams.Len() > 0 {
  652. return invalidParams
  653. }
  654. return nil
  655. }
  656. // SetPolicyIds sets the PolicyIds field's value.
  657. func (s *GetLifecyclePoliciesInput) SetPolicyIds(v []*string) *GetLifecyclePoliciesInput {
  658. s.PolicyIds = v
  659. return s
  660. }
  661. // SetResourceTypes sets the ResourceTypes field's value.
  662. func (s *GetLifecyclePoliciesInput) SetResourceTypes(v []*string) *GetLifecyclePoliciesInput {
  663. s.ResourceTypes = v
  664. return s
  665. }
  666. // SetState sets the State field's value.
  667. func (s *GetLifecyclePoliciesInput) SetState(v string) *GetLifecyclePoliciesInput {
  668. s.State = &v
  669. return s
  670. }
  671. // SetTagsToAdd sets the TagsToAdd field's value.
  672. func (s *GetLifecyclePoliciesInput) SetTagsToAdd(v []*string) *GetLifecyclePoliciesInput {
  673. s.TagsToAdd = v
  674. return s
  675. }
  676. // SetTargetTags sets the TargetTags field's value.
  677. func (s *GetLifecyclePoliciesInput) SetTargetTags(v []*string) *GetLifecyclePoliciesInput {
  678. s.TargetTags = v
  679. return s
  680. }
  681. type GetLifecyclePoliciesOutput struct {
  682. _ struct{} `type:"structure"`
  683. // Summary information about the lifecycle policies.
  684. Policies []*LifecyclePolicySummary `type:"list"`
  685. }
  686. // String returns the string representation
  687. func (s GetLifecyclePoliciesOutput) String() string {
  688. return awsutil.Prettify(s)
  689. }
  690. // GoString returns the string representation
  691. func (s GetLifecyclePoliciesOutput) GoString() string {
  692. return s.String()
  693. }
  694. // SetPolicies sets the Policies field's value.
  695. func (s *GetLifecyclePoliciesOutput) SetPolicies(v []*LifecyclePolicySummary) *GetLifecyclePoliciesOutput {
  696. s.Policies = v
  697. return s
  698. }
  699. type GetLifecyclePolicyInput struct {
  700. _ struct{} `type:"structure"`
  701. // The identifier of the lifecycle policy.
  702. //
  703. // PolicyId is a required field
  704. PolicyId *string `location:"uri" locationName:"policyId" type:"string" required:"true"`
  705. }
  706. // String returns the string representation
  707. func (s GetLifecyclePolicyInput) String() string {
  708. return awsutil.Prettify(s)
  709. }
  710. // GoString returns the string representation
  711. func (s GetLifecyclePolicyInput) GoString() string {
  712. return s.String()
  713. }
  714. // Validate inspects the fields of the type to determine if they are valid.
  715. func (s *GetLifecyclePolicyInput) Validate() error {
  716. invalidParams := request.ErrInvalidParams{Context: "GetLifecyclePolicyInput"}
  717. if s.PolicyId == nil {
  718. invalidParams.Add(request.NewErrParamRequired("PolicyId"))
  719. }
  720. if s.PolicyId != nil && len(*s.PolicyId) < 1 {
  721. invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1))
  722. }
  723. if invalidParams.Len() > 0 {
  724. return invalidParams
  725. }
  726. return nil
  727. }
  728. // SetPolicyId sets the PolicyId field's value.
  729. func (s *GetLifecyclePolicyInput) SetPolicyId(v string) *GetLifecyclePolicyInput {
  730. s.PolicyId = &v
  731. return s
  732. }
  733. type GetLifecyclePolicyOutput struct {
  734. _ struct{} `type:"structure"`
  735. // Detailed information about the lifecycle policy.
  736. Policy *LifecyclePolicy `type:"structure"`
  737. }
  738. // String returns the string representation
  739. func (s GetLifecyclePolicyOutput) String() string {
  740. return awsutil.Prettify(s)
  741. }
  742. // GoString returns the string representation
  743. func (s GetLifecyclePolicyOutput) GoString() string {
  744. return s.String()
  745. }
  746. // SetPolicy sets the Policy field's value.
  747. func (s *GetLifecyclePolicyOutput) SetPolicy(v *LifecyclePolicy) *GetLifecyclePolicyOutput {
  748. s.Policy = v
  749. return s
  750. }
  751. // Detailed information about a lifecycle policy.
  752. type LifecyclePolicy struct {
  753. _ struct{} `type:"structure"`
  754. // The local date and time when the lifecycle policy was created.
  755. DateCreated *time.Time `type:"timestamp"`
  756. // The local date and time when the lifecycle policy was last modified.
  757. DateModified *time.Time `type:"timestamp"`
  758. // The description of the lifecycle policy.
  759. Description *string `type:"string"`
  760. // The Amazon Resource Name (ARN) of the IAM role used to run the operations
  761. // specified by the lifecycle policy.
  762. ExecutionRoleArn *string `type:"string"`
  763. // The configuration of the lifecycle policy
  764. PolicyDetails *PolicyDetails `type:"structure"`
  765. // The identifier of the lifecycle policy.
  766. PolicyId *string `type:"string"`
  767. // The activation state of the lifecycle policy.
  768. State *string `type:"string" enum:"GettablePolicyStateValues"`
  769. }
  770. // String returns the string representation
  771. func (s LifecyclePolicy) String() string {
  772. return awsutil.Prettify(s)
  773. }
  774. // GoString returns the string representation
  775. func (s LifecyclePolicy) GoString() string {
  776. return s.String()
  777. }
  778. // SetDateCreated sets the DateCreated field's value.
  779. func (s *LifecyclePolicy) SetDateCreated(v time.Time) *LifecyclePolicy {
  780. s.DateCreated = &v
  781. return s
  782. }
  783. // SetDateModified sets the DateModified field's value.
  784. func (s *LifecyclePolicy) SetDateModified(v time.Time) *LifecyclePolicy {
  785. s.DateModified = &v
  786. return s
  787. }
  788. // SetDescription sets the Description field's value.
  789. func (s *LifecyclePolicy) SetDescription(v string) *LifecyclePolicy {
  790. s.Description = &v
  791. return s
  792. }
  793. // SetExecutionRoleArn sets the ExecutionRoleArn field's value.
  794. func (s *LifecyclePolicy) SetExecutionRoleArn(v string) *LifecyclePolicy {
  795. s.ExecutionRoleArn = &v
  796. return s
  797. }
  798. // SetPolicyDetails sets the PolicyDetails field's value.
  799. func (s *LifecyclePolicy) SetPolicyDetails(v *PolicyDetails) *LifecyclePolicy {
  800. s.PolicyDetails = v
  801. return s
  802. }
  803. // SetPolicyId sets the PolicyId field's value.
  804. func (s *LifecyclePolicy) SetPolicyId(v string) *LifecyclePolicy {
  805. s.PolicyId = &v
  806. return s
  807. }
  808. // SetState sets the State field's value.
  809. func (s *LifecyclePolicy) SetState(v string) *LifecyclePolicy {
  810. s.State = &v
  811. return s
  812. }
  813. // Summary information about a lifecycle policy.
  814. type LifecyclePolicySummary struct {
  815. _ struct{} `type:"structure"`
  816. // The description of the lifecycle policy.
  817. Description *string `type:"string"`
  818. // The identifier of the lifecycle policy.
  819. PolicyId *string `type:"string"`
  820. // The activation state of the lifecycle policy.
  821. State *string `type:"string" enum:"GettablePolicyStateValues"`
  822. }
  823. // String returns the string representation
  824. func (s LifecyclePolicySummary) String() string {
  825. return awsutil.Prettify(s)
  826. }
  827. // GoString returns the string representation
  828. func (s LifecyclePolicySummary) GoString() string {
  829. return s.String()
  830. }
  831. // SetDescription sets the Description field's value.
  832. func (s *LifecyclePolicySummary) SetDescription(v string) *LifecyclePolicySummary {
  833. s.Description = &v
  834. return s
  835. }
  836. // SetPolicyId sets the PolicyId field's value.
  837. func (s *LifecyclePolicySummary) SetPolicyId(v string) *LifecyclePolicySummary {
  838. s.PolicyId = &v
  839. return s
  840. }
  841. // SetState sets the State field's value.
  842. func (s *LifecyclePolicySummary) SetState(v string) *LifecyclePolicySummary {
  843. s.State = &v
  844. return s
  845. }
  846. // Specifies the configuration of a lifecycle policy.
  847. type PolicyDetails struct {
  848. _ struct{} `type:"structure"`
  849. // The resource type.
  850. ResourceTypes []*string `min:"1" type:"list"`
  851. // The schedule of policy-defined actions.
  852. Schedules []*Schedule `min:"1" type:"list"`
  853. // The single tag that identifies targeted resources for this policy.
  854. TargetTags []*Tag `min:"1" type:"list"`
  855. }
  856. // String returns the string representation
  857. func (s PolicyDetails) String() string {
  858. return awsutil.Prettify(s)
  859. }
  860. // GoString returns the string representation
  861. func (s PolicyDetails) GoString() string {
  862. return s.String()
  863. }
  864. // Validate inspects the fields of the type to determine if they are valid.
  865. func (s *PolicyDetails) Validate() error {
  866. invalidParams := request.ErrInvalidParams{Context: "PolicyDetails"}
  867. if s.ResourceTypes != nil && len(s.ResourceTypes) < 1 {
  868. invalidParams.Add(request.NewErrParamMinLen("ResourceTypes", 1))
  869. }
  870. if s.Schedules != nil && len(s.Schedules) < 1 {
  871. invalidParams.Add(request.NewErrParamMinLen("Schedules", 1))
  872. }
  873. if s.TargetTags != nil && len(s.TargetTags) < 1 {
  874. invalidParams.Add(request.NewErrParamMinLen("TargetTags", 1))
  875. }
  876. if s.Schedules != nil {
  877. for i, v := range s.Schedules {
  878. if v == nil {
  879. continue
  880. }
  881. if err := v.Validate(); err != nil {
  882. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Schedules", i), err.(request.ErrInvalidParams))
  883. }
  884. }
  885. }
  886. if s.TargetTags != nil {
  887. for i, v := range s.TargetTags {
  888. if v == nil {
  889. continue
  890. }
  891. if err := v.Validate(); err != nil {
  892. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetTags", i), err.(request.ErrInvalidParams))
  893. }
  894. }
  895. }
  896. if invalidParams.Len() > 0 {
  897. return invalidParams
  898. }
  899. return nil
  900. }
  901. // SetResourceTypes sets the ResourceTypes field's value.
  902. func (s *PolicyDetails) SetResourceTypes(v []*string) *PolicyDetails {
  903. s.ResourceTypes = v
  904. return s
  905. }
  906. // SetSchedules sets the Schedules field's value.
  907. func (s *PolicyDetails) SetSchedules(v []*Schedule) *PolicyDetails {
  908. s.Schedules = v
  909. return s
  910. }
  911. // SetTargetTags sets the TargetTags field's value.
  912. func (s *PolicyDetails) SetTargetTags(v []*Tag) *PolicyDetails {
  913. s.TargetTags = v
  914. return s
  915. }
  916. // Specifies the number of snapshots to keep for each EBS volume.
  917. type RetainRule struct {
  918. _ struct{} `type:"structure"`
  919. // The number of snapshots to keep for each volume, up to a maximum of 1000.
  920. //
  921. // Count is a required field
  922. Count *int64 `min:"1" type:"integer" required:"true"`
  923. }
  924. // String returns the string representation
  925. func (s RetainRule) String() string {
  926. return awsutil.Prettify(s)
  927. }
  928. // GoString returns the string representation
  929. func (s RetainRule) GoString() string {
  930. return s.String()
  931. }
  932. // Validate inspects the fields of the type to determine if they are valid.
  933. func (s *RetainRule) Validate() error {
  934. invalidParams := request.ErrInvalidParams{Context: "RetainRule"}
  935. if s.Count == nil {
  936. invalidParams.Add(request.NewErrParamRequired("Count"))
  937. }
  938. if s.Count != nil && *s.Count < 1 {
  939. invalidParams.Add(request.NewErrParamMinValue("Count", 1))
  940. }
  941. if invalidParams.Len() > 0 {
  942. return invalidParams
  943. }
  944. return nil
  945. }
  946. // SetCount sets the Count field's value.
  947. func (s *RetainRule) SetCount(v int64) *RetainRule {
  948. s.Count = &v
  949. return s
  950. }
  951. // Specifies a schedule.
  952. type Schedule struct {
  953. _ struct{} `type:"structure"`
  954. CopyTags *bool `type:"boolean"`
  955. // The create rule.
  956. CreateRule *CreateRule `type:"structure"`
  957. // The name of the schedule.
  958. Name *string `type:"string"`
  959. // The retain rule.
  960. RetainRule *RetainRule `type:"structure"`
  961. // The tags to apply to policy-created resources. These user-defined tags are
  962. // in addition to the AWS-added lifecycle tags.
  963. TagsToAdd []*Tag `type:"list"`
  964. }
  965. // String returns the string representation
  966. func (s Schedule) String() string {
  967. return awsutil.Prettify(s)
  968. }
  969. // GoString returns the string representation
  970. func (s Schedule) GoString() string {
  971. return s.String()
  972. }
  973. // Validate inspects the fields of the type to determine if they are valid.
  974. func (s *Schedule) Validate() error {
  975. invalidParams := request.ErrInvalidParams{Context: "Schedule"}
  976. if s.CreateRule != nil {
  977. if err := s.CreateRule.Validate(); err != nil {
  978. invalidParams.AddNested("CreateRule", err.(request.ErrInvalidParams))
  979. }
  980. }
  981. if s.RetainRule != nil {
  982. if err := s.RetainRule.Validate(); err != nil {
  983. invalidParams.AddNested("RetainRule", err.(request.ErrInvalidParams))
  984. }
  985. }
  986. if s.TagsToAdd != nil {
  987. for i, v := range s.TagsToAdd {
  988. if v == nil {
  989. continue
  990. }
  991. if err := v.Validate(); err != nil {
  992. invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsToAdd", i), err.(request.ErrInvalidParams))
  993. }
  994. }
  995. }
  996. if invalidParams.Len() > 0 {
  997. return invalidParams
  998. }
  999. return nil
  1000. }
  1001. // SetCopyTags sets the CopyTags field's value.
  1002. func (s *Schedule) SetCopyTags(v bool) *Schedule {
  1003. s.CopyTags = &v
  1004. return s
  1005. }
  1006. // SetCreateRule sets the CreateRule field's value.
  1007. func (s *Schedule) SetCreateRule(v *CreateRule) *Schedule {
  1008. s.CreateRule = v
  1009. return s
  1010. }
  1011. // SetName sets the Name field's value.
  1012. func (s *Schedule) SetName(v string) *Schedule {
  1013. s.Name = &v
  1014. return s
  1015. }
  1016. // SetRetainRule sets the RetainRule field's value.
  1017. func (s *Schedule) SetRetainRule(v *RetainRule) *Schedule {
  1018. s.RetainRule = v
  1019. return s
  1020. }
  1021. // SetTagsToAdd sets the TagsToAdd field's value.
  1022. func (s *Schedule) SetTagsToAdd(v []*Tag) *Schedule {
  1023. s.TagsToAdd = v
  1024. return s
  1025. }
  1026. // Specifies a tag for a resource.
  1027. type Tag struct {
  1028. _ struct{} `type:"structure"`
  1029. // The tag key.
  1030. //
  1031. // Key is a required field
  1032. Key *string `type:"string" required:"true"`
  1033. // The tag value.
  1034. //
  1035. // Value is a required field
  1036. Value *string `type:"string" required:"true"`
  1037. }
  1038. // String returns the string representation
  1039. func (s Tag) String() string {
  1040. return awsutil.Prettify(s)
  1041. }
  1042. // GoString returns the string representation
  1043. func (s Tag) GoString() string {
  1044. return s.String()
  1045. }
  1046. // Validate inspects the fields of the type to determine if they are valid.
  1047. func (s *Tag) Validate() error {
  1048. invalidParams := request.ErrInvalidParams{Context: "Tag"}
  1049. if s.Key == nil {
  1050. invalidParams.Add(request.NewErrParamRequired("Key"))
  1051. }
  1052. if s.Value == nil {
  1053. invalidParams.Add(request.NewErrParamRequired("Value"))
  1054. }
  1055. if invalidParams.Len() > 0 {
  1056. return invalidParams
  1057. }
  1058. return nil
  1059. }
  1060. // SetKey sets the Key field's value.
  1061. func (s *Tag) SetKey(v string) *Tag {
  1062. s.Key = &v
  1063. return s
  1064. }
  1065. // SetValue sets the Value field's value.
  1066. func (s *Tag) SetValue(v string) *Tag {
  1067. s.Value = &v
  1068. return s
  1069. }
  1070. type UpdateLifecyclePolicyInput struct {
  1071. _ struct{} `type:"structure"`
  1072. // A description of the lifecycle policy.
  1073. Description *string `type:"string"`
  1074. // The Amazon Resource Name (ARN) of the IAM role used to run the operations
  1075. // specified by the lifecycle policy.
  1076. ExecutionRoleArn *string `type:"string"`
  1077. // The configuration of the lifecycle policy.
  1078. //
  1079. // Target tags cannot be re-used across policies.
  1080. PolicyDetails *PolicyDetails `type:"structure"`
  1081. // The identifier of the lifecycle policy.
  1082. //
  1083. // PolicyId is a required field
  1084. PolicyId *string `location:"uri" locationName:"policyId" type:"string" required:"true"`
  1085. // The desired activation state of the lifecycle policy after creation.
  1086. State *string `type:"string" enum:"SettablePolicyStateValues"`
  1087. }
  1088. // String returns the string representation
  1089. func (s UpdateLifecyclePolicyInput) String() string {
  1090. return awsutil.Prettify(s)
  1091. }
  1092. // GoString returns the string representation
  1093. func (s UpdateLifecyclePolicyInput) GoString() string {
  1094. return s.String()
  1095. }
  1096. // Validate inspects the fields of the type to determine if they are valid.
  1097. func (s *UpdateLifecyclePolicyInput) Validate() error {
  1098. invalidParams := request.ErrInvalidParams{Context: "UpdateLifecyclePolicyInput"}
  1099. if s.PolicyId == nil {
  1100. invalidParams.Add(request.NewErrParamRequired("PolicyId"))
  1101. }
  1102. if s.PolicyId != nil && len(*s.PolicyId) < 1 {
  1103. invalidParams.Add(request.NewErrParamMinLen("PolicyId", 1))
  1104. }
  1105. if s.PolicyDetails != nil {
  1106. if err := s.PolicyDetails.Validate(); err != nil {
  1107. invalidParams.AddNested("PolicyDetails", err.(request.ErrInvalidParams))
  1108. }
  1109. }
  1110. if invalidParams.Len() > 0 {
  1111. return invalidParams
  1112. }
  1113. return nil
  1114. }
  1115. // SetDescription sets the Description field's value.
  1116. func (s *UpdateLifecyclePolicyInput) SetDescription(v string) *UpdateLifecyclePolicyInput {
  1117. s.Description = &v
  1118. return s
  1119. }
  1120. // SetExecutionRoleArn sets the ExecutionRoleArn field's value.
  1121. func (s *UpdateLifecyclePolicyInput) SetExecutionRoleArn(v string) *UpdateLifecyclePolicyInput {
  1122. s.ExecutionRoleArn = &v
  1123. return s
  1124. }
  1125. // SetPolicyDetails sets the PolicyDetails field's value.
  1126. func (s *UpdateLifecyclePolicyInput) SetPolicyDetails(v *PolicyDetails) *UpdateLifecyclePolicyInput {
  1127. s.PolicyDetails = v
  1128. return s
  1129. }
  1130. // SetPolicyId sets the PolicyId field's value.
  1131. func (s *UpdateLifecyclePolicyInput) SetPolicyId(v string) *UpdateLifecyclePolicyInput {
  1132. s.PolicyId = &v
  1133. return s
  1134. }
  1135. // SetState sets the State field's value.
  1136. func (s *UpdateLifecyclePolicyInput) SetState(v string) *UpdateLifecyclePolicyInput {
  1137. s.State = &v
  1138. return s
  1139. }
  1140. type UpdateLifecyclePolicyOutput struct {
  1141. _ struct{} `type:"structure"`
  1142. }
  1143. // String returns the string representation
  1144. func (s UpdateLifecyclePolicyOutput) String() string {
  1145. return awsutil.Prettify(s)
  1146. }
  1147. // GoString returns the string representation
  1148. func (s UpdateLifecyclePolicyOutput) GoString() string {
  1149. return s.String()
  1150. }
  1151. const (
  1152. // GettablePolicyStateValuesEnabled is a GettablePolicyStateValues enum value
  1153. GettablePolicyStateValuesEnabled = "ENABLED"
  1154. // GettablePolicyStateValuesDisabled is a GettablePolicyStateValues enum value
  1155. GettablePolicyStateValuesDisabled = "DISABLED"
  1156. // GettablePolicyStateValuesError is a GettablePolicyStateValues enum value
  1157. GettablePolicyStateValuesError = "ERROR"
  1158. )
  1159. const (
  1160. // IntervalUnitValuesHours is a IntervalUnitValues enum value
  1161. IntervalUnitValuesHours = "HOURS"
  1162. )
  1163. const (
  1164. // ResourceTypeValuesVolume is a ResourceTypeValues enum value
  1165. ResourceTypeValuesVolume = "VOLUME"
  1166. )
  1167. const (
  1168. // SettablePolicyStateValuesEnabled is a SettablePolicyStateValues enum value
  1169. SettablePolicyStateValuesEnabled = "ENABLED"
  1170. // SettablePolicyStateValuesDisabled is a SettablePolicyStateValues enum value
  1171. SettablePolicyStateValuesDisabled = "DISABLED"
  1172. )