1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package ec2
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/smithy-go/middleware"
10	smithyhttp "github.com/aws/smithy-go/transport/http"
11)
12
13// Modifies attributes of a specified VPC endpoint. The attributes that you can
14// modify depend on the type of VPC endpoint (interface, gateway, or Gateway Load
15// Balancer). For more information, see VPC Endpoints
16// (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) in the
17// Amazon Virtual Private Cloud User Guide.
18func (c *Client) ModifyVpcEndpoint(ctx context.Context, params *ModifyVpcEndpointInput, optFns ...func(*Options)) (*ModifyVpcEndpointOutput, error) {
19	if params == nil {
20		params = &ModifyVpcEndpointInput{}
21	}
22
23	result, metadata, err := c.invokeOperation(ctx, "ModifyVpcEndpoint", params, optFns, addOperationModifyVpcEndpointMiddlewares)
24	if err != nil {
25		return nil, err
26	}
27
28	out := result.(*ModifyVpcEndpointOutput)
29	out.ResultMetadata = metadata
30	return out, nil
31}
32
33// Contains the parameters for ModifyVpcEndpoint.
34type ModifyVpcEndpointInput struct {
35
36	// The ID of the endpoint.
37	//
38	// This member is required.
39	VpcEndpointId *string
40
41	// (Gateway endpoint) One or more route tables IDs to associate with the endpoint.
42	AddRouteTableIds []string
43
44	// (Interface endpoint) One or more security group IDs to associate with the
45	// network interface.
46	AddSecurityGroupIds []string
47
48	// (Interface and Gateway Load Balancer endpoints) One or more subnet IDs in which
49	// to serve the endpoint. For a Gateway Load Balancer endpoint, you can specify
50	// only one subnet.
51	AddSubnetIds []string
52
53	// Checks whether you have the required permissions for the action, without
54	// actually making the request, and provides an error response. If you have the
55	// required permissions, the error response is DryRunOperation. Otherwise, it is
56	// UnauthorizedOperation.
57	DryRun bool
58
59	// (Interface and gateway endpoints) A policy to attach to the endpoint that
60	// controls access to the service. The policy must be in valid JSON format.
61	PolicyDocument *string
62
63	// (Interface endpoint) Indicates whether a private hosted zone is associated with
64	// the VPC.
65	PrivateDnsEnabled bool
66
67	// (Gateway endpoint) One or more route table IDs to disassociate from the
68	// endpoint.
69	RemoveRouteTableIds []string
70
71	// (Interface endpoint) One or more security group IDs to disassociate from the
72	// network interface.
73	RemoveSecurityGroupIds []string
74
75	// (Interface endpoint) One or more subnets IDs in which to remove the endpoint.
76	RemoveSubnetIds []string
77
78	// (Gateway endpoint) Specify true to reset the policy document to the default
79	// policy. The default policy allows full access to the service.
80	ResetPolicy bool
81}
82
83type ModifyVpcEndpointOutput struct {
84
85	// Returns true if the request succeeds; otherwise, it returns an error.
86	Return bool
87
88	// Metadata pertaining to the operation's result.
89	ResultMetadata middleware.Metadata
90}
91
92func addOperationModifyVpcEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) {
93	err = stack.Serialize.Add(&awsEc2query_serializeOpModifyVpcEndpoint{}, middleware.After)
94	if err != nil {
95		return err
96	}
97	err = stack.Deserialize.Add(&awsEc2query_deserializeOpModifyVpcEndpoint{}, middleware.After)
98	if err != nil {
99		return err
100	}
101	if err = addSetLoggerMiddleware(stack, options); err != nil {
102		return err
103	}
104	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
105		return err
106	}
107	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
108		return err
109	}
110	if err = addResolveEndpointMiddleware(stack, options); err != nil {
111		return err
112	}
113	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
114		return err
115	}
116	if err = addRetryMiddlewares(stack, options); err != nil {
117		return err
118	}
119	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
120		return err
121	}
122	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
123		return err
124	}
125	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
126		return err
127	}
128	if err = addClientUserAgent(stack); err != nil {
129		return err
130	}
131	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
132		return err
133	}
134	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
135		return err
136	}
137	if err = addOpModifyVpcEndpointValidationMiddleware(stack); err != nil {
138		return err
139	}
140	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyVpcEndpoint(options.Region), middleware.Before); err != nil {
141		return err
142	}
143	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
144		return err
145	}
146	if err = addResponseErrorMiddleware(stack); err != nil {
147		return err
148	}
149	if err = addRequestResponseLogging(stack, options); err != nil {
150		return err
151	}
152	return nil
153}
154
155func newServiceMetadataMiddleware_opModifyVpcEndpoint(region string) *awsmiddleware.RegisterServiceMetadata {
156	return &awsmiddleware.RegisterServiceMetadata{
157		Region:        region,
158		ServiceID:     ServiceID,
159		SigningName:   "ec2",
160		OperationName: "ModifyVpcEndpoint",
161	}
162}
163