1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package ssmcontacts
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/ssmcontacts/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Retrieves information about the specified contact or escalation plan.
15func (c *Client) GetContact(ctx context.Context, params *GetContactInput, optFns ...func(*Options)) (*GetContactOutput, error) {
16	if params == nil {
17		params = &GetContactInput{}
18	}
19
20	result, metadata, err := c.invokeOperation(ctx, "GetContact", params, optFns, c.addOperationGetContactMiddlewares)
21	if err != nil {
22		return nil, err
23	}
24
25	out := result.(*GetContactOutput)
26	out.ResultMetadata = metadata
27	return out, nil
28}
29
30type GetContactInput struct {
31
32	// The Amazon Resource Name (ARN) of the contact or escalation plan.
33	//
34	// This member is required.
35	ContactId *string
36
37	noSmithyDocumentSerde
38}
39
40type GetContactOutput struct {
41
42	// The alias of the contact or escalation plan. The alias is unique and
43	// identifiable.
44	//
45	// This member is required.
46	Alias *string
47
48	// The ARN of the contact or escalation plan.
49	//
50	// This member is required.
51	ContactArn *string
52
53	// Details about the specific timing or stages and targets of the escalation plan
54	// or engagement plan.
55	//
56	// This member is required.
57	Plan *types.Plan
58
59	// The type of contact, either PERSONAL or ESCALATION.
60	//
61	// This member is required.
62	Type types.ContactType
63
64	// The full name of the contact or escalation plan.
65	DisplayName *string
66
67	// Metadata pertaining to the operation's result.
68	ResultMetadata middleware.Metadata
69
70	noSmithyDocumentSerde
71}
72
73func (c *Client) addOperationGetContactMiddlewares(stack *middleware.Stack, options Options) (err error) {
74	err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetContact{}, middleware.After)
75	if err != nil {
76		return err
77	}
78	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetContact{}, middleware.After)
79	if err != nil {
80		return err
81	}
82	if err = addSetLoggerMiddleware(stack, options); err != nil {
83		return err
84	}
85	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
86		return err
87	}
88	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
89		return err
90	}
91	if err = addResolveEndpointMiddleware(stack, options); err != nil {
92		return err
93	}
94	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
95		return err
96	}
97	if err = addRetryMiddlewares(stack, options); err != nil {
98		return err
99	}
100	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
101		return err
102	}
103	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
104		return err
105	}
106	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
107		return err
108	}
109	if err = addClientUserAgent(stack); err != nil {
110		return err
111	}
112	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
113		return err
114	}
115	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
116		return err
117	}
118	if err = addOpGetContactValidationMiddleware(stack); err != nil {
119		return err
120	}
121	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContact(options.Region), middleware.Before); err != nil {
122		return err
123	}
124	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
125		return err
126	}
127	if err = addResponseErrorMiddleware(stack); err != nil {
128		return err
129	}
130	if err = addRequestResponseLogging(stack, options); err != nil {
131		return err
132	}
133	return nil
134}
135
136func newServiceMetadataMiddleware_opGetContact(region string) *awsmiddleware.RegisterServiceMetadata {
137	return &awsmiddleware.RegisterServiceMetadata{
138		Region:        region,
139		ServiceID:     ServiceID,
140		SigningName:   "ssm-contacts",
141		OperationName: "GetContact",
142	}
143}
144