1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package kendra 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/kendra/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12 "time" 13) 14 15// Describes an existing Amazon Kendra index 16func (c *Client) DescribeIndex(ctx context.Context, params *DescribeIndexInput, optFns ...func(*Options)) (*DescribeIndexOutput, error) { 17 if params == nil { 18 params = &DescribeIndexInput{} 19 } 20 21 result, metadata, err := c.invokeOperation(ctx, "DescribeIndex", params, optFns, addOperationDescribeIndexMiddlewares) 22 if err != nil { 23 return nil, err 24 } 25 26 out := result.(*DescribeIndexOutput) 27 out.ResultMetadata = metadata 28 return out, nil 29} 30 31type DescribeIndexInput struct { 32 33 // The name of the index to describe. 34 // 35 // This member is required. 36 Id *string 37} 38 39type DescribeIndexOutput struct { 40 41 // For Enterprise edition indexes, you can choose to use additional capacity to 42 // meet the needs of your application. This contains the capacity units used for 43 // the index. A 0 for the query capacity or the storage capacity indicates that the 44 // index is using the default capacity for the index. 45 CapacityUnits *types.CapacityUnitsConfiguration 46 47 // The Unix datetime that the index was created. 48 CreatedAt *time.Time 49 50 // The description of the index. 51 Description *string 52 53 // Configuration settings for any metadata applied to the documents in the index. 54 DocumentMetadataConfigurations []types.DocumentMetadataConfiguration 55 56 // The Amazon Kendra edition used for the index. You decide the edition when you 57 // create the index. 58 Edition types.IndexEdition 59 60 // When th eStatus field value is FAILED, the ErrorMessage field contains a message 61 // that explains why. 62 ErrorMessage *string 63 64 // The name of the index. 65 Id *string 66 67 // Provides information about the number of FAQ questions and answers and the 68 // number of text documents indexed. 69 IndexStatistics *types.IndexStatistics 70 71 // The name of the index. 72 Name *string 73 74 // The Amazon Resource Name (ARN) of the IAM role that gives Amazon Kendra 75 // permission to write to your Amazon Cloudwatch logs. 76 RoleArn *string 77 78 // The identifier of the AWS KMS customer master key (CMK) used to encrypt your 79 // data. Amazon Kendra doesn't support asymmetric CMKs. 80 ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration 81 82 // The current status of the index. When the value is ACTIVE, the index is ready 83 // for use. If the Status field value is FAILED, the ErrorMessage field contains a 84 // message that explains why. 85 Status types.IndexStatus 86 87 // The Unix datetime that the index was last updated. 88 UpdatedAt *time.Time 89 90 // The user context policy for the Amazon Kendra index. 91 UserContextPolicy types.UserContextPolicy 92 93 // The user token configuration for the Amazon Kendra index. 94 UserTokenConfigurations []types.UserTokenConfiguration 95 96 // Metadata pertaining to the operation's result. 97 ResultMetadata middleware.Metadata 98} 99 100func addOperationDescribeIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { 101 err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeIndex{}, middleware.After) 102 if err != nil { 103 return err 104 } 105 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeIndex{}, middleware.After) 106 if err != nil { 107 return err 108 } 109 if err = addSetLoggerMiddleware(stack, options); err != nil { 110 return err 111 } 112 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 113 return err 114 } 115 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 116 return err 117 } 118 if err = addResolveEndpointMiddleware(stack, options); err != nil { 119 return err 120 } 121 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 122 return err 123 } 124 if err = addRetryMiddlewares(stack, options); err != nil { 125 return err 126 } 127 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 128 return err 129 } 130 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 131 return err 132 } 133 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 134 return err 135 } 136 if err = addClientUserAgent(stack); err != nil { 137 return err 138 } 139 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 140 return err 141 } 142 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 143 return err 144 } 145 if err = addOpDescribeIndexValidationMiddleware(stack); err != nil { 146 return err 147 } 148 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIndex(options.Region), middleware.Before); err != nil { 149 return err 150 } 151 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 152 return err 153 } 154 if err = addResponseErrorMiddleware(stack); err != nil { 155 return err 156 } 157 if err = addRequestResponseLogging(stack, options); err != nil { 158 return err 159 } 160 return nil 161} 162 163func newServiceMetadataMiddleware_opDescribeIndex(region string) *awsmiddleware.RegisterServiceMetadata { 164 return &awsmiddleware.RegisterServiceMetadata{ 165 Region: region, 166 ServiceID: ServiceID, 167 SigningName: "kendra", 168 OperationName: "DescribeIndex", 169 } 170} 171