1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package ec2 4 5import ( 6 "context" 7 "fmt" 8 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 9 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 10 "github.com/aws/aws-sdk-go-v2/service/ec2/types" 11 "github.com/aws/smithy-go/middleware" 12 smithyhttp "github.com/aws/smithy-go/transport/http" 13) 14 15// Describes the VPC endpoint service configurations in your account (your 16// services). 17func (c *Client) DescribeVpcEndpointServiceConfigurations(ctx context.Context, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { 18 if params == nil { 19 params = &DescribeVpcEndpointServiceConfigurationsInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "DescribeVpcEndpointServiceConfigurations", params, optFns, addOperationDescribeVpcEndpointServiceConfigurationsMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*DescribeVpcEndpointServiceConfigurationsOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30} 31 32type DescribeVpcEndpointServiceConfigurationsInput struct { 33 34 // Checks whether you have the required permissions for the action, without 35 // actually making the request, and provides an error response. If you have the 36 // required permissions, the error response is DryRunOperation. Otherwise, it is 37 // UnauthorizedOperation. 38 DryRun bool 39 40 // One or more filters. 41 // 42 // * service-name - The name of the service. 43 // 44 // * service-id - 45 // The ID of the service. 46 // 47 // * service-state - The state of the service (Pending | 48 // Available | Deleting | Deleted | Failed). 49 // 50 // * tag: - The key/value combination of 51 // a tag assigned to the resource. Use the tag key in the filter name and the tag 52 // value as the filter value. For example, to find all resources that have a tag 53 // with the key Owner and the value TeamA, specify tag:Owner for the filter name 54 // and TeamA for the filter value. 55 // 56 // * tag-key - The key of a tag assigned to the 57 // resource. Use this filter to find all resources assigned a tag with a specific 58 // key, regardless of the tag value. 59 Filters []types.Filter 60 61 // The maximum number of results to return for the request in a single page. The 62 // remaining results of the initial request can be seen by sending another request 63 // with the returned NextToken value. This value can be between 5 and 1,000; if 64 // MaxResults is given a value larger than 1,000, only 1,000 results are returned. 65 MaxResults int32 66 67 // The token to retrieve the next page of results. 68 NextToken *string 69 70 // The IDs of one or more services. 71 ServiceIds []string 72} 73 74type DescribeVpcEndpointServiceConfigurationsOutput struct { 75 76 // The token to use to retrieve the next page of results. This value is null when 77 // there are no more results to return. 78 NextToken *string 79 80 // Information about one or more services. 81 ServiceConfigurations []types.ServiceConfiguration 82 83 // Metadata pertaining to the operation's result. 84 ResultMetadata middleware.Metadata 85} 86 87func addOperationDescribeVpcEndpointServiceConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { 88 err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeVpcEndpointServiceConfigurations{}, middleware.After) 89 if err != nil { 90 return err 91 } 92 err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeVpcEndpointServiceConfigurations{}, middleware.After) 93 if err != nil { 94 return err 95 } 96 if err = addSetLoggerMiddleware(stack, options); err != nil { 97 return err 98 } 99 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 100 return err 101 } 102 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 103 return err 104 } 105 if err = addResolveEndpointMiddleware(stack, options); err != nil { 106 return err 107 } 108 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 109 return err 110 } 111 if err = addRetryMiddlewares(stack, options); err != nil { 112 return err 113 } 114 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 115 return err 116 } 117 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 118 return err 119 } 120 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 121 return err 122 } 123 if err = addClientUserAgent(stack); err != nil { 124 return err 125 } 126 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 127 return err 128 } 129 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 130 return err 131 } 132 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeVpcEndpointServiceConfigurations(options.Region), middleware.Before); err != nil { 133 return err 134 } 135 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 136 return err 137 } 138 if err = addResponseErrorMiddleware(stack); err != nil { 139 return err 140 } 141 if err = addRequestResponseLogging(stack, options); err != nil { 142 return err 143 } 144 return nil 145} 146 147// DescribeVpcEndpointServiceConfigurationsAPIClient is a client that implements 148// the DescribeVpcEndpointServiceConfigurations operation. 149type DescribeVpcEndpointServiceConfigurationsAPIClient interface { 150 DescribeVpcEndpointServiceConfigurations(context.Context, *DescribeVpcEndpointServiceConfigurationsInput, ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) 151} 152 153var _ DescribeVpcEndpointServiceConfigurationsAPIClient = (*Client)(nil) 154 155// DescribeVpcEndpointServiceConfigurationsPaginatorOptions is the paginator 156// options for DescribeVpcEndpointServiceConfigurations 157type DescribeVpcEndpointServiceConfigurationsPaginatorOptions struct { 158 // The maximum number of results to return for the request in a single page. The 159 // remaining results of the initial request can be seen by sending another request 160 // with the returned NextToken value. This value can be between 5 and 1,000; if 161 // MaxResults is given a value larger than 1,000, only 1,000 results are returned. 162 Limit int32 163 164 // Set to true if pagination should stop if the service returns a pagination token 165 // that matches the most recent token provided to the service. 166 StopOnDuplicateToken bool 167} 168 169// DescribeVpcEndpointServiceConfigurationsPaginator is a paginator for 170// DescribeVpcEndpointServiceConfigurations 171type DescribeVpcEndpointServiceConfigurationsPaginator struct { 172 options DescribeVpcEndpointServiceConfigurationsPaginatorOptions 173 client DescribeVpcEndpointServiceConfigurationsAPIClient 174 params *DescribeVpcEndpointServiceConfigurationsInput 175 nextToken *string 176 firstPage bool 177} 178 179// NewDescribeVpcEndpointServiceConfigurationsPaginator returns a new 180// DescribeVpcEndpointServiceConfigurationsPaginator 181func NewDescribeVpcEndpointServiceConfigurationsPaginator(client DescribeVpcEndpointServiceConfigurationsAPIClient, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*DescribeVpcEndpointServiceConfigurationsPaginatorOptions)) *DescribeVpcEndpointServiceConfigurationsPaginator { 182 options := DescribeVpcEndpointServiceConfigurationsPaginatorOptions{} 183 if params.MaxResults != 0 { 184 options.Limit = params.MaxResults 185 } 186 187 for _, fn := range optFns { 188 fn(&options) 189 } 190 191 if params == nil { 192 params = &DescribeVpcEndpointServiceConfigurationsInput{} 193 } 194 195 return &DescribeVpcEndpointServiceConfigurationsPaginator{ 196 options: options, 197 client: client, 198 params: params, 199 firstPage: true, 200 } 201} 202 203// HasMorePages returns a boolean indicating whether more pages are available 204func (p *DescribeVpcEndpointServiceConfigurationsPaginator) HasMorePages() bool { 205 return p.firstPage || p.nextToken != nil 206} 207 208// NextPage retrieves the next DescribeVpcEndpointServiceConfigurations page. 209func (p *DescribeVpcEndpointServiceConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { 210 if !p.HasMorePages() { 211 return nil, fmt.Errorf("no more pages available") 212 } 213 214 params := *p.params 215 params.NextToken = p.nextToken 216 217 params.MaxResults = p.options.Limit 218 219 result, err := p.client.DescribeVpcEndpointServiceConfigurations(ctx, ¶ms, optFns...) 220 if err != nil { 221 return nil, err 222 } 223 p.firstPage = false 224 225 prevToken := p.nextToken 226 p.nextToken = result.NextToken 227 228 if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { 229 p.nextToken = nil 230 } 231 232 return result, nil 233} 234 235func newServiceMetadataMiddleware_opDescribeVpcEndpointServiceConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { 236 return &awsmiddleware.RegisterServiceMetadata{ 237 Region: region, 238 ServiceID: ServiceID, 239 SigningName: "ec2", 240 OperationName: "DescribeVpcEndpointServiceConfigurations", 241 } 242} 243