1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package xray
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/xray/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12	"time"
13)
14
15// Retrieves a service graph structure filtered by the specified insight. The
16// service graph is limited to only structural information. For a complete service
17// graph, use this API with the GetServiceGraph API.
18func (c *Client) GetInsightImpactGraph(ctx context.Context, params *GetInsightImpactGraphInput, optFns ...func(*Options)) (*GetInsightImpactGraphOutput, error) {
19	if params == nil {
20		params = &GetInsightImpactGraphInput{}
21	}
22
23	result, metadata, err := c.invokeOperation(ctx, "GetInsightImpactGraph", params, optFns, addOperationGetInsightImpactGraphMiddlewares)
24	if err != nil {
25		return nil, err
26	}
27
28	out := result.(*GetInsightImpactGraphOutput)
29	out.ResultMetadata = metadata
30	return out, nil
31}
32
33type GetInsightImpactGraphInput struct {
34
35	// The estimated end time of the insight, in Unix time seconds. The EndTime is
36	// exclusive of the value provided. The time range between the start time and end
37	// time can't be more than six hours.
38	//
39	// This member is required.
40	EndTime *time.Time
41
42	// The insight's unique identifier. Use the GetInsightSummaries action to retrieve
43	// an InsightId.
44	//
45	// This member is required.
46	InsightId *string
47
48	// The estimated start time of the insight, in Unix time seconds. The StartTime is
49	// inclusive of the value provided and can't be more than 30 days old.
50	//
51	// This member is required.
52	StartTime *time.Time
53
54	// Specify the pagination token returned by a previous request to retrieve the next
55	// page of results.
56	NextToken *string
57}
58
59type GetInsightImpactGraphOutput struct {
60
61	// The provided end time.
62	EndTime *time.Time
63
64	// The insight's unique identifier.
65	InsightId *string
66
67	// Pagination token.
68	NextToken *string
69
70	// The time, in Unix seconds, at which the service graph ended.
71	ServiceGraphEndTime *time.Time
72
73	// The time, in Unix seconds, at which the service graph started.
74	ServiceGraphStartTime *time.Time
75
76	// The AWS instrumented services related to the insight.
77	Services []types.InsightImpactGraphService
78
79	// The provided start time.
80	StartTime *time.Time
81
82	// Metadata pertaining to the operation's result.
83	ResultMetadata middleware.Metadata
84}
85
86func addOperationGetInsightImpactGraphMiddlewares(stack *middleware.Stack, options Options) (err error) {
87	err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInsightImpactGraph{}, middleware.After)
88	if err != nil {
89		return err
90	}
91	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInsightImpactGraph{}, middleware.After)
92	if err != nil {
93		return err
94	}
95	if err = addSetLoggerMiddleware(stack, options); err != nil {
96		return err
97	}
98	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
99		return err
100	}
101	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
102		return err
103	}
104	if err = addResolveEndpointMiddleware(stack, options); err != nil {
105		return err
106	}
107	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
108		return err
109	}
110	if err = addRetryMiddlewares(stack, options); err != nil {
111		return err
112	}
113	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
114		return err
115	}
116	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
117		return err
118	}
119	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
120		return err
121	}
122	if err = addClientUserAgent(stack); err != nil {
123		return err
124	}
125	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
126		return err
127	}
128	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
129		return err
130	}
131	if err = addOpGetInsightImpactGraphValidationMiddleware(stack); err != nil {
132		return err
133	}
134	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInsightImpactGraph(options.Region), middleware.Before); err != nil {
135		return err
136	}
137	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
138		return err
139	}
140	if err = addResponseErrorMiddleware(stack); err != nil {
141		return err
142	}
143	if err = addRequestResponseLogging(stack, options); err != nil {
144		return err
145	}
146	return nil
147}
148
149func newServiceMetadataMiddleware_opGetInsightImpactGraph(region string) *awsmiddleware.RegisterServiceMetadata {
150	return &awsmiddleware.RegisterServiceMetadata{
151		Region:        region,
152		ServiceID:     ServiceID,
153		SigningName:   "xray",
154		OperationName: "GetInsightImpactGraph",
155	}
156}
157