// Code generated by smithy-go-codegen DO NOT EDIT. package codeguruprofiler import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/codeguruprofiler/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Add up to 2 anomaly notifications channels for a profiling group. func (c *Client) AddNotificationChannels(ctx context.Context, params *AddNotificationChannelsInput, optFns ...func(*Options)) (*AddNotificationChannelsOutput, error) { if params == nil { params = &AddNotificationChannelsInput{} } result, metadata, err := c.invokeOperation(ctx, "AddNotificationChannels", params, optFns, c.addOperationAddNotificationChannelsMiddlewares) if err != nil { return nil, err } out := result.(*AddNotificationChannelsOutput) out.ResultMetadata = metadata return out, nil } // The structure representing the AddNotificationChannelsRequest. type AddNotificationChannelsInput struct { // One or 2 channels to report to when anomalies are detected. // // This member is required. Channels []types.Channel // The name of the profiling group that we are setting up notifications for. // // This member is required. ProfilingGroupName *string noSmithyDocumentSerde } // The structure representing the AddNotificationChannelsResponse. type AddNotificationChannelsOutput struct { // The new notification configuration for this profiling group. NotificationConfiguration *types.NotificationConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddNotificationChannelsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpAddNotificationChannels{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAddNotificationChannels{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack, options); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpAddNotificationChannelsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddNotificationChannels(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opAddNotificationChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "codeguru-profiler", OperationName: "AddNotificationChannels", } }