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	"time"
13)
14
15// Gets information about a Device Defender security profile.
16func (c *Client) DescribeSecurityProfile(ctx context.Context, params *DescribeSecurityProfileInput, optFns ...func(*Options)) (*DescribeSecurityProfileOutput, error) {
17	if params == nil {
18		params = &DescribeSecurityProfileInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "DescribeSecurityProfile", params, optFns, addOperationDescribeSecurityProfileMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*DescribeSecurityProfileOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type DescribeSecurityProfileInput struct {
32
33	// The name of the security profile whose information you want to get.
34	//
35	// This member is required.
36	SecurityProfileName *string
37}
38
39type DescribeSecurityProfileOutput struct {
40
41	// Please use DescribeSecurityProfileResponse$additionalMetricsToRetainV2 instead.
42	// A list of metrics whose data is retained (stored). By default, data is retained
43	// for any metric used in the profile's behaviors, but it is also retained for any
44	// metric specified here.
45	//
46	// Deprecated: Use additionalMetricsToRetainV2.
47	AdditionalMetricsToRetain []string
48
49	// A list of metrics whose data is retained (stored). By default, data is retained
50	// for any metric used in the profile's behaviors, but it is also retained for any
51	// metric specified here.
52	AdditionalMetricsToRetainV2 []types.MetricToRetain
53
54	// Where the alerts are sent. (Alerts are always sent to the console.)
55	AlertTargets map[string]types.AlertTarget
56
57	// Specifies the behaviors that, when violated by a device (thing), cause an alert.
58	Behaviors []types.Behavior
59
60	// The time the security profile was created.
61	CreationDate *time.Time
62
63	// The time the security profile was last modified.
64	LastModifiedDate *time.Time
65
66	// The ARN of the security profile.
67	SecurityProfileArn *string
68
69	// A description of the security profile (associated with the security profile when
70	// it was created or updated).
71	SecurityProfileDescription *string
72
73	// The name of the security profile.
74	SecurityProfileName *string
75
76	// The version of the security profile. A new version is generated whenever the
77	// security profile is updated.
78	Version int64
79
80	// Metadata pertaining to the operation's result.
81	ResultMetadata middleware.Metadata
82}
83
84func addOperationDescribeSecurityProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
85	err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSecurityProfile{}, middleware.After)
86	if err != nil {
87		return err
88	}
89	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSecurityProfile{}, middleware.After)
90	if err != nil {
91		return err
92	}
93	if err = addSetLoggerMiddleware(stack, options); err != nil {
94		return err
95	}
96	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
97		return err
98	}
99	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
100		return err
101	}
102	if err = addResolveEndpointMiddleware(stack, options); err != nil {
103		return err
104	}
105	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
106		return err
107	}
108	if err = addRetryMiddlewares(stack, options); err != nil {
109		return err
110	}
111	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
112		return err
113	}
114	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
115		return err
116	}
117	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
118		return err
119	}
120	if err = addClientUserAgent(stack); err != nil {
121		return err
122	}
123	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
124		return err
125	}
126	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
127		return err
128	}
129	if err = addOpDescribeSecurityProfileValidationMiddleware(stack); err != nil {
130		return err
131	}
132	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSecurityProfile(options.Region), middleware.Before); err != nil {
133		return err
134	}
135	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
136		return err
137	}
138	if err = addResponseErrorMiddleware(stack); err != nil {
139		return err
140	}
141	if err = addRequestResponseLogging(stack, options); err != nil {
142		return err
143	}
144	return nil
145}
146
147func newServiceMetadataMiddleware_opDescribeSecurityProfile(region string) *awsmiddleware.RegisterServiceMetadata {
148	return &awsmiddleware.RegisterServiceMetadata{
149		Region:        region,
150		ServiceID:     ServiceID,
151		SigningName:   "execute-api",
152		OperationName: "DescribeSecurityProfile",
153	}
154}
155