1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package macie2 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/macie2/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Updates the criteria and other settings for a findings filter. 15func (c *Client) UpdateFindingsFilter(ctx context.Context, params *UpdateFindingsFilterInput, optFns ...func(*Options)) (*UpdateFindingsFilterOutput, error) { 16 if params == nil { 17 params = &UpdateFindingsFilterInput{} 18 } 19 20 result, metadata, err := c.invokeOperation(ctx, "UpdateFindingsFilter", params, optFns, addOperationUpdateFindingsFilterMiddlewares) 21 if err != nil { 22 return nil, err 23 } 24 25 out := result.(*UpdateFindingsFilterOutput) 26 out.ResultMetadata = metadata 27 return out, nil 28} 29 30type UpdateFindingsFilterInput struct { 31 32 // The unique identifier for the Amazon Macie resource or account that the request 33 // applies to. 34 // 35 // This member is required. 36 Id *string 37 38 // The action to perform on findings that meet the filter criteria 39 // (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) 40 // the findings; and, NOOP, don't perform any action on the findings. 41 Action types.FindingsFilterAction 42 43 // A custom description of the filter. The description can contain as many as 512 44 // characters. We strongly recommend that you avoid including any sensitive data in 45 // the description of a filter. Other users might be able to see the filter's 46 // description, depending on the actions that they're allowed to perform in Amazon 47 // Macie. 48 Description *string 49 50 // The criteria to use to filter findings. 51 FindingCriteria *types.FindingCriteria 52 53 // A custom name for the filter. The name must contain at least 3 characters and 54 // can contain as many as 64 characters. We strongly recommend that you avoid 55 // including any sensitive data in the name of a filter. Other users might be able 56 // to see the filter's name, depending on the actions that they're allowed to 57 // perform in Amazon Macie. 58 Name *string 59 60 // The position of the filter in the list of saved filters on the Amazon Macie 61 // console. This value also determines the order in which the filter is applied to 62 // findings, relative to other filters that are also applied to the findings. 63 Position int32 64} 65 66type UpdateFindingsFilterOutput struct { 67 68 // The Amazon Resource Name (ARN) of the filter that was updated. 69 Arn *string 70 71 // The unique identifier for the filter that was updated. 72 Id *string 73 74 // Metadata pertaining to the operation's result. 75 ResultMetadata middleware.Metadata 76} 77 78func addOperationUpdateFindingsFilterMiddlewares(stack *middleware.Stack, options Options) (err error) { 79 err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFindingsFilter{}, middleware.After) 80 if err != nil { 81 return err 82 } 83 err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFindingsFilter{}, middleware.After) 84 if err != nil { 85 return err 86 } 87 if err = addSetLoggerMiddleware(stack, options); err != nil { 88 return err 89 } 90 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 91 return err 92 } 93 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 94 return err 95 } 96 if err = addResolveEndpointMiddleware(stack, options); err != nil { 97 return err 98 } 99 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 100 return err 101 } 102 if err = addRetryMiddlewares(stack, options); err != nil { 103 return err 104 } 105 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 106 return err 107 } 108 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 109 return err 110 } 111 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 112 return err 113 } 114 if err = addClientUserAgent(stack); err != nil { 115 return err 116 } 117 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 118 return err 119 } 120 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 121 return err 122 } 123 if err = addOpUpdateFindingsFilterValidationMiddleware(stack); err != nil { 124 return err 125 } 126 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFindingsFilter(options.Region), middleware.Before); err != nil { 127 return err 128 } 129 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 130 return err 131 } 132 if err = addResponseErrorMiddleware(stack); err != nil { 133 return err 134 } 135 if err = addRequestResponseLogging(stack, options); err != nil { 136 return err 137 } 138 return nil 139} 140 141func newServiceMetadataMiddleware_opUpdateFindingsFilter(region string) *awsmiddleware.RegisterServiceMetadata { 142 return &awsmiddleware.RegisterServiceMetadata{ 143 Region: region, 144 ServiceID: ServiceID, 145 SigningName: "macie2", 146 OperationName: "UpdateFindingsFilter", 147 } 148} 149