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/aws-sdk-go-v2/service/ec2/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Describes available services to which you can create a VPC endpoint. When the
15// service provider and the consumer have different accounts multiple Availability
16// Zones, and the consumer views the VPC endpoint service information, the response
17// only includes the common Availability Zones. For example, when the service
18// provider account uses us-east-1a and us-east-1c and the consumer uses us-east-1a
19// and us-east-1a and us-east-1b, the response includes the VPC endpoint services
20// in the common Availability Zone, us-east-1a.
21func (c *Client) DescribeVpcEndpointServices(ctx context.Context, params *DescribeVpcEndpointServicesInput, optFns ...func(*Options)) (*DescribeVpcEndpointServicesOutput, error) {
22	if params == nil {
23		params = &DescribeVpcEndpointServicesInput{}
24	}
25
26	result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointServices", params, optFns, addOperationDescribeVpcEndpointServicesMiddlewares)
27	if err != nil {
28		return nil, err
29	}
30
31	out := result.(*DescribeVpcEndpointServicesOutput)
32	out.ResultMetadata = metadata
33	return out, nil
34}
35
36// Contains the parameters for DescribeVpcEndpointServices.
37type DescribeVpcEndpointServicesInput struct {
38
39	// Checks whether you have the required permissions for the action, without
40	// actually making the request, and provides an error response. If you have the
41	// required permissions, the error response is DryRunOperation. Otherwise, it is
42	// UnauthorizedOperation.
43	DryRun bool
44
45	// One or more filters.
46	//
47	// * service-name - The name of the service.
48	//
49	// * tag: - The
50	// key/value combination of a tag assigned to the resource. Use the tag key in the
51	// filter name and the tag value as the filter value. For example, to find all
52	// resources that have a tag with the key Owner and the value TeamA, specify
53	// tag:Owner for the filter name and TeamA for the filter value.
54	//
55	// * tag-key - The
56	// key of a tag assigned to the resource. Use this filter to find all resources
57	// assigned a tag with a specific key, regardless of the tag value.
58	Filters []types.Filter
59
60	// The maximum number of items to return for this request. The request returns a
61	// token that you can specify in a subsequent call to get the next set of results.
62	// Constraint: If the value is greater than 1,000, we return only 1,000 items.
63	MaxResults int32
64
65	// The token for the next set of items to return. (You received this token from a
66	// prior call.)
67	NextToken *string
68
69	// One or more service names.
70	ServiceNames []string
71}
72
73// Contains the output of DescribeVpcEndpointServices.
74type DescribeVpcEndpointServicesOutput struct {
75
76	// The token to use when requesting the next set of items. If there are no
77	// additional items to return, the string is empty.
78	NextToken *string
79
80	// Information about the service.
81	ServiceDetails []types.ServiceDetail
82
83	// A list of supported services.
84	ServiceNames []string
85
86	// Metadata pertaining to the operation's result.
87	ResultMetadata middleware.Metadata
88}
89
90func addOperationDescribeVpcEndpointServicesMiddlewares(stack *middleware.Stack, options Options) (err error) {
91	err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointServices{}, middleware.After)
92	if err != nil {
93		return err
94	}
95	err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointServices{}, middleware.After)
96	if err != nil {
97		return err
98	}
99	if err = addSetLoggerMiddleware(stack, options); err != nil {
100		return err
101	}
102	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
103		return err
104	}
105	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
106		return err
107	}
108	if err = addResolveEndpointMiddleware(stack, options); err != nil {
109		return err
110	}
111	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
112		return err
113	}
114	if err = addRetryMiddlewares(stack, options); err != nil {
115		return err
116	}
117	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
118		return err
119	}
120	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
121		return err
122	}
123	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
124		return err
125	}
126	if err = addClientUserAgent(stack); err != nil {
127		return err
128	}
129	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
130		return err
131	}
132	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
133		return err
134	}
135	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointServices(options.Region), middleware.Before); err != nil {
136		return err
137	}
138	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
139		return err
140	}
141	if err = addResponseErrorMiddleware(stack); err != nil {
142		return err
143	}
144	if err = addRequestResponseLogging(stack, options); err != nil {
145		return err
146	}
147	return nil
148}
149
150func newServiceMetadataMiddleware_opDescribeVpcEndpointServices(region string) *awsmiddleware.RegisterServiceMetadata {
151	return &awsmiddleware.RegisterServiceMetadata{
152		Region:        region,
153		ServiceID:     ServiceID,
154		SigningName:   "ec2",
155		OperationName: "DescribeVpcEndpointServices",
156	}
157}
158