1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package directconnect
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/directconnect/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Confirms the creation of the specified hosted connection on an interconnect.
15// Upon creation, the hosted connection is initially in the Ordering state, and
16// remains in this state until the owner confirms creation of the hosted
17// connection.
18func (c *Client) ConfirmConnection(ctx context.Context, params *ConfirmConnectionInput, optFns ...func(*Options)) (*ConfirmConnectionOutput, error) {
19	if params == nil {
20		params = &ConfirmConnectionInput{}
21	}
22
23	result, metadata, err := c.invokeOperation(ctx, "ConfirmConnection", params, optFns, addOperationConfirmConnectionMiddlewares)
24	if err != nil {
25		return nil, err
26	}
27
28	out := result.(*ConfirmConnectionOutput)
29	out.ResultMetadata = metadata
30	return out, nil
31}
32
33type ConfirmConnectionInput struct {
34
35	// The ID of the hosted connection.
36	//
37	// This member is required.
38	ConnectionId *string
39}
40
41type ConfirmConnectionOutput struct {
42
43	// The state of the connection. The following are the possible values:
44	//
45	// * ordering:
46	// The initial state of a hosted connection provisioned on an interconnect. The
47	// connection stays in the ordering state until the owner of the hosted connection
48	// confirms or declines the connection order.
49	//
50	// * requested: The initial state of a
51	// standard connection. The connection stays in the requested state until the
52	// Letter of Authorization (LOA) is sent to the customer.
53	//
54	// * pending: The
55	// connection has been approved and is being initialized.
56	//
57	// * available: The network
58	// link is up and the connection is ready for use.
59	//
60	// * down: The network link is
61	// down.
62	//
63	// * deleting: The connection is being deleted.
64	//
65	// * deleted: The connection
66	// has been deleted.
67	//
68	// * rejected: A hosted connection in the ordering state enters
69	// the rejected state if it is deleted by the customer.
70	//
71	// * unknown: The state of
72	// the connection is not available.
73	ConnectionState types.ConnectionState
74
75	// Metadata pertaining to the operation's result.
76	ResultMetadata middleware.Metadata
77}
78
79func addOperationConfirmConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) {
80	err = stack.Serialize.Add(&awsAwsjson11_serializeOpConfirmConnection{}, middleware.After)
81	if err != nil {
82		return err
83	}
84	err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpConfirmConnection{}, middleware.After)
85	if err != nil {
86		return err
87	}
88	if err = addSetLoggerMiddleware(stack, options); err != nil {
89		return err
90	}
91	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
92		return err
93	}
94	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
95		return err
96	}
97	if err = addResolveEndpointMiddleware(stack, options); err != nil {
98		return err
99	}
100	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
101		return err
102	}
103	if err = addRetryMiddlewares(stack, options); err != nil {
104		return err
105	}
106	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
107		return err
108	}
109	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
110		return err
111	}
112	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
113		return err
114	}
115	if err = addClientUserAgent(stack); err != nil {
116		return err
117	}
118	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
119		return err
120	}
121	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
122		return err
123	}
124	if err = addOpConfirmConnectionValidationMiddleware(stack); err != nil {
125		return err
126	}
127	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opConfirmConnection(options.Region), middleware.Before); err != nil {
128		return err
129	}
130	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
131		return err
132	}
133	if err = addResponseErrorMiddleware(stack); err != nil {
134		return err
135	}
136	if err = addRequestResponseLogging(stack, options); err != nil {
137		return err
138	}
139	return nil
140}
141
142func newServiceMetadataMiddleware_opConfirmConnection(region string) *awsmiddleware.RegisterServiceMetadata {
143	return &awsmiddleware.RegisterServiceMetadata{
144		Region:        region,
145		ServiceID:     ServiceID,
146		SigningName:   "directconnect",
147		OperationName: "ConfirmConnection",
148	}
149}
150