1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package backup
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/backup/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Returns metadata associated with a recovery point, including ID, status,
16// encryption, and lifecycle.
17func (c *Client) DescribeRecoveryPoint(ctx context.Context, params *DescribeRecoveryPointInput, optFns ...func(*Options)) (*DescribeRecoveryPointOutput, error) {
18	if params == nil {
19		params = &DescribeRecoveryPointInput{}
20	}
21
22	result, metadata, err := c.invokeOperation(ctx, "DescribeRecoveryPoint", params, optFns, addOperationDescribeRecoveryPointMiddlewares)
23	if err != nil {
24		return nil, err
25	}
26
27	out := result.(*DescribeRecoveryPointOutput)
28	out.ResultMetadata = metadata
29	return out, nil
30}
31
32type DescribeRecoveryPointInput struct {
33
34	// The name of a logical container where backups are stored. Backup vaults are
35	// identified by names that are unique to the account used to create them and the
36	// AWS Region where they are created. They consist of lowercase letters, numbers,
37	// and hyphens.
38	//
39	// This member is required.
40	BackupVaultName *string
41
42	// An Amazon Resource Name (ARN) that uniquely identifies a recovery point; for
43	// example,
44	// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.
45	//
46	// This member is required.
47	RecoveryPointArn *string
48}
49
50type DescribeRecoveryPointOutput struct {
51
52	// The size, in bytes, of a backup.
53	BackupSizeInBytes *int64
54
55	// An ARN that uniquely identifies a backup vault; for example,
56	// arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.
57	BackupVaultArn *string
58
59	// The name of a logical container where backups are stored. Backup vaults are
60	// identified by names that are unique to the account used to create them and the
61	// Region where they are created. They consist of lowercase letters, numbers, and
62	// hyphens.
63	BackupVaultName *string
64
65	// A CalculatedLifecycle object containing DeleteAt and MoveToColdStorageAt
66	// timestamps.
67	CalculatedLifecycle *types.CalculatedLifecycle
68
69	// The date and time that a job to create a recovery point is completed, in Unix
70	// format and Coordinated Universal Time (UTC). The value of CompletionDate is
71	// accurate to milliseconds. For example, the value 1516925490.087 represents
72	// Friday, January 26, 2018 12:11:30.087 AM.
73	CompletionDate *time.Time
74
75	// Contains identifying information about the creation of a recovery point,
76	// including the BackupPlanArn, BackupPlanId, BackupPlanVersion, and BackupRuleId
77	// of the backup plan used to create it.
78	CreatedBy *types.RecoveryPointCreator
79
80	// The date and time that a recovery point is created, in Unix format and
81	// Coordinated Universal Time (UTC). The value of CreationDate is accurate to
82	// milliseconds. For example, the value 1516925490.087 represents Friday, January
83	// 26, 2018 12:11:30.087 AM.
84	CreationDate *time.Time
85
86	// The server-side encryption key used to protect your backups; for example,
87	// arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab.
88	EncryptionKeyArn *string
89
90	// Specifies the IAM role ARN used to create the target recovery point; for
91	// example, arn:aws:iam::123456789012:role/S3Access.
92	IamRoleArn *string
93
94	// A Boolean value that is returned as TRUE if the specified recovery point is
95	// encrypted, or FALSE if the recovery point is not encrypted.
96	IsEncrypted bool
97
98	// The date and time that a recovery point was last restored, in Unix format and
99	// Coordinated Universal Time (UTC). The value of LastRestoreTime is accurate to
100	// milliseconds. For example, the value 1516925490.087 represents Friday, January
101	// 26, 2018 12:11:30.087 AM.
102	LastRestoreTime *time.Time
103
104	// The lifecycle defines when a protected resource is transitioned to cold storage
105	// and when it expires. AWS Backup transitions and expires backups automatically
106	// according to the lifecycle that you define. Backups that are transitioned to
107	// cold storage must be stored in cold storage for a minimum of 90 days. Therefore,
108	// the “expire after days” setting must be 90 days greater than the “transition to
109	// cold after days” setting. The “transition to cold after days” setting cannot be
110	// changed after a backup has been transitioned to cold.
111	Lifecycle *types.Lifecycle
112
113	// An ARN that uniquely identifies a recovery point; for example,
114	// arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.
115	RecoveryPointArn *string
116
117	// An ARN that uniquely identifies a saved resource. The format of the ARN depends
118	// on the resource type.
119	ResourceArn *string
120
121	// The type of AWS resource to save as a recovery point; for example, an Amazon
122	// Elastic Block Store (Amazon EBS) volume or an Amazon Relational Database Service
123	// (Amazon RDS) database.
124	ResourceType *string
125
126	// An Amazon Resource Name (ARN) that uniquely identifies the source vault where
127	// the resource was originally backed up in; for example,
128	// arn:aws:backup:us-east-1:123456789012:vault:BackupVault. If the recovery is
129	// restored to the same AWS account or Region, this value will be null.
130	SourceBackupVaultArn *string
131
132	// A status code specifying the state of the recovery point. A partial status
133	// indicates that the recovery point was not successfully re-created and must be
134	// retried.
135	Status types.RecoveryPointStatus
136
137	// Specifies the storage class of the recovery point. Valid values are WARM or
138	// COLD.
139	StorageClass types.StorageClass
140
141	// Metadata pertaining to the operation's result.
142	ResultMetadata middleware.Metadata
143}
144
145func addOperationDescribeRecoveryPointMiddlewares(stack *middleware.Stack, options Options) (err error) {
146	err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeRecoveryPoint{}, middleware.After)
147	if err != nil {
148		return err
149	}
150	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeRecoveryPoint{}, middleware.After)
151	if err != nil {
152		return err
153	}
154	if err = addSetLoggerMiddleware(stack, options); err != nil {
155		return err
156	}
157	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
158		return err
159	}
160	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
161		return err
162	}
163	if err = addResolveEndpointMiddleware(stack, options); err != nil {
164		return err
165	}
166	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
167		return err
168	}
169	if err = addRetryMiddlewares(stack, options); err != nil {
170		return err
171	}
172	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
173		return err
174	}
175	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
176		return err
177	}
178	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
179		return err
180	}
181	if err = addClientUserAgent(stack); err != nil {
182		return err
183	}
184	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
185		return err
186	}
187	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
188		return err
189	}
190	if err = addOpDescribeRecoveryPointValidationMiddleware(stack); err != nil {
191		return err
192	}
193	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeRecoveryPoint(options.Region), middleware.Before); err != nil {
194		return err
195	}
196	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
197		return err
198	}
199	if err = addResponseErrorMiddleware(stack); err != nil {
200		return err
201	}
202	if err = addRequestResponseLogging(stack, options); err != nil {
203		return err
204	}
205	return nil
206}
207
208func newServiceMetadataMiddleware_opDescribeRecoveryPoint(region string) *awsmiddleware.RegisterServiceMetadata {
209	return &awsmiddleware.RegisterServiceMetadata{
210		Region:        region,
211		ServiceID:     ServiceID,
212		SigningName:   "backup",
213		OperationName: "DescribeRecoveryPoint",
214	}
215}
216