1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package iot
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/iot/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Configures or reconfigures the Device Defender audit settings for this account.
15// Settings include how audit notifications are sent and which audit checks are
16// enabled or disabled.
17func (c *Client) UpdateAccountAuditConfiguration(ctx context.Context, params *UpdateAccountAuditConfigurationInput, optFns ...func(*Options)) (*UpdateAccountAuditConfigurationOutput, error) {
18	if params == nil {
19		params = &UpdateAccountAuditConfigurationInput{}
20	}
21
22	result, metadata, err := c.invokeOperation(ctx, "UpdateAccountAuditConfiguration", params, optFns, addOperationUpdateAccountAuditConfigurationMiddlewares)
23	if err != nil {
24		return nil, err
25	}
26
27	out := result.(*UpdateAccountAuditConfigurationOutput)
28	out.ResultMetadata = metadata
29	return out, nil
30}
31
32type UpdateAccountAuditConfigurationInput struct {
33
34	// Specifies which audit checks are enabled and disabled for this account. Use
35	// DescribeAccountAuditConfiguration to see the list of all checks, including those
36	// that are currently enabled. Some data collection might start immediately when
37	// certain checks are enabled. When a check is disabled, any data collected so far
38	// in relation to the check is deleted. You cannot disable a check if it is used by
39	// any scheduled audit. You must first delete the check from the scheduled audit or
40	// delete the scheduled audit itself. On the first call to
41	// UpdateAccountAuditConfiguration, this parameter is required and must specify at
42	// least one enabled check.
43	AuditCheckConfigurations map[string]types.AuditCheckConfiguration
44
45	// Information about the targets to which audit notifications are sent.
46	AuditNotificationTargetConfigurations map[string]types.AuditNotificationTarget
47
48	// The ARN of the role that grants permission to AWS IoT to access information
49	// about your devices, policies, certificates and other items as required when
50	// performing an audit.
51	RoleArn *string
52}
53
54type UpdateAccountAuditConfigurationOutput struct {
55	// Metadata pertaining to the operation's result.
56	ResultMetadata middleware.Metadata
57}
58
59func addOperationUpdateAccountAuditConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
60	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAccountAuditConfiguration{}, middleware.After)
61	if err != nil {
62		return err
63	}
64	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAccountAuditConfiguration{}, middleware.After)
65	if err != nil {
66		return err
67	}
68	if err = addSetLoggerMiddleware(stack, options); err != nil {
69		return err
70	}
71	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
72		return err
73	}
74	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
75		return err
76	}
77	if err = addResolveEndpointMiddleware(stack, options); err != nil {
78		return err
79	}
80	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
81		return err
82	}
83	if err = addRetryMiddlewares(stack, options); err != nil {
84		return err
85	}
86	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
87		return err
88	}
89	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
90		return err
91	}
92	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
93		return err
94	}
95	if err = addClientUserAgent(stack); err != nil {
96		return err
97	}
98	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
99		return err
100	}
101	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
102		return err
103	}
104	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAccountAuditConfiguration(options.Region), middleware.Before); err != nil {
105		return err
106	}
107	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
108		return err
109	}
110	if err = addResponseErrorMiddleware(stack); err != nil {
111		return err
112	}
113	if err = addRequestResponseLogging(stack, options); err != nil {
114		return err
115	}
116	return nil
117}
118
119func newServiceMetadataMiddleware_opUpdateAccountAuditConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
120	return &awsmiddleware.RegisterServiceMetadata{
121		Region:        region,
122		ServiceID:     ServiceID,
123		SigningName:   "execute-api",
124		OperationName: "UpdateAccountAuditConfiguration",
125	}
126}
127