1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package configservice 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/configservice/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Accepts a structured query language (SQL) SELECT command, performs the 15// corresponding search, and returns resource configurations matching the 16// properties. For more information about query components, see the Query 17// Components 18// (https://docs.aws.amazon.com/config/latest/developerguide/query-components.html) 19// section in the AWS Config Developer Guide. 20func (c *Client) SelectResourceConfig(ctx context.Context, params *SelectResourceConfigInput, optFns ...func(*Options)) (*SelectResourceConfigOutput, error) { 21 if params == nil { 22 params = &SelectResourceConfigInput{} 23 } 24 25 result, metadata, err := c.invokeOperation(ctx, "SelectResourceConfig", params, optFns, addOperationSelectResourceConfigMiddlewares) 26 if err != nil { 27 return nil, err 28 } 29 30 out := result.(*SelectResourceConfigOutput) 31 out.ResultMetadata = metadata 32 return out, nil 33} 34 35type SelectResourceConfigInput struct { 36 37 // The SQL query SELECT command. 38 // 39 // This member is required. 40 Expression *string 41 42 // The maximum number of query results returned on each page. 43 Limit int32 44 45 // The nextToken string returned in a previous request that you use to request the 46 // next page of results in a paginated response. 47 NextToken *string 48} 49 50type SelectResourceConfigOutput struct { 51 52 // The nextToken string returned in a previous request that you use to request the 53 // next page of results in a paginated response. 54 NextToken *string 55 56 // Returns the QueryInfo object. 57 QueryInfo *types.QueryInfo 58 59 // Returns the results for the SQL query. 60 Results []string 61 62 // Metadata pertaining to the operation's result. 63 ResultMetadata middleware.Metadata 64} 65 66func addOperationSelectResourceConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { 67 err = stack.Serialize.Add(&awsAwsjson11_serializeOpSelectResourceConfig{}, middleware.After) 68 if err != nil { 69 return err 70 } 71 err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSelectResourceConfig{}, middleware.After) 72 if err != nil { 73 return err 74 } 75 if err = addSetLoggerMiddleware(stack, options); err != nil { 76 return err 77 } 78 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 79 return err 80 } 81 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 82 return err 83 } 84 if err = addResolveEndpointMiddleware(stack, options); err != nil { 85 return err 86 } 87 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 88 return err 89 } 90 if err = addRetryMiddlewares(stack, options); err != nil { 91 return err 92 } 93 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 94 return err 95 } 96 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 97 return err 98 } 99 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 100 return err 101 } 102 if err = addClientUserAgent(stack); err != nil { 103 return err 104 } 105 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 106 return err 107 } 108 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 109 return err 110 } 111 if err = addOpSelectResourceConfigValidationMiddleware(stack); err != nil { 112 return err 113 } 114 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSelectResourceConfig(options.Region), middleware.Before); err != nil { 115 return err 116 } 117 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 118 return err 119 } 120 if err = addResponseErrorMiddleware(stack); err != nil { 121 return err 122 } 123 if err = addRequestResponseLogging(stack, options); err != nil { 124 return err 125 } 126 return nil 127} 128 129func newServiceMetadataMiddleware_opSelectResourceConfig(region string) *awsmiddleware.RegisterServiceMetadata { 130 return &awsmiddleware.RegisterServiceMetadata{ 131 Region: region, 132 ServiceID: ServiceID, 133 SigningName: "config", 134 OperationName: "SelectResourceConfig", 135 } 136} 137