src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

api_op_ListVPCAssociationAuthorizations.go (5739B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 	"fmt"
      8 	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
      9 	"github.com/aws/aws-sdk-go-v2/service/route53/types"
     10 	"github.com/aws/smithy-go/middleware"
     11 	smithyhttp "github.com/aws/smithy-go/transport/http"
     12 )
     13 
     14 // Gets a list of the VPCs that were created by other accounts and that can be
     15 // associated with a specified hosted zone because you've submitted one or more
     16 // CreateVPCAssociationAuthorization requests. The response includes a VPCs
     17 // element with a VPC child element for each VPC that can be associated with the
     18 // hosted zone.
     19 func (c *Client) ListVPCAssociationAuthorizations(ctx context.Context, params *ListVPCAssociationAuthorizationsInput, optFns ...func(*Options)) (*ListVPCAssociationAuthorizationsOutput, error) {
     20 	if params == nil {
     21 		params = &ListVPCAssociationAuthorizationsInput{}
     22 	}
     23 
     24 	result, metadata, err := c.invokeOperation(ctx, "ListVPCAssociationAuthorizations", params, optFns, c.addOperationListVPCAssociationAuthorizationsMiddlewares)
     25 	if err != nil {
     26 		return nil, err
     27 	}
     28 
     29 	out := result.(*ListVPCAssociationAuthorizationsOutput)
     30 	out.ResultMetadata = metadata
     31 	return out, nil
     32 }
     33 
     34 // A complex type that contains information about that can be associated with your
     35 // hosted zone.
     36 type ListVPCAssociationAuthorizationsInput struct {
     37 
     38 	// The ID of the hosted zone for which you want a list of VPCs that can be
     39 	// associated with the hosted zone.
     40 	//
     41 	// This member is required.
     42 	HostedZoneId *string
     43 
     44 	// Optional: An integer that specifies the maximum number of VPCs that you want
     45 	// Amazon Route 53 to return. If you don't specify a value for MaxResults , Route
     46 	// 53 returns up to 50 VPCs per page.
     47 	MaxResults *int32
     48 
     49 	// Optional: If a response includes a NextToken element, there are more VPCs that
     50 	// can be associated with the specified hosted zone. To get the next page of
     51 	// results, submit another request, and include the value of NextToken from the
     52 	// response in the nexttoken parameter in another ListVPCAssociationAuthorizations
     53 	// request.
     54 	NextToken *string
     55 
     56 	noSmithyDocumentSerde
     57 }
     58 
     59 // A complex type that contains the response information for the request.
     60 type ListVPCAssociationAuthorizationsOutput struct {
     61 
     62 	// The ID of the hosted zone that you can associate the listed VPCs with.
     63 	//
     64 	// This member is required.
     65 	HostedZoneId *string
     66 
     67 	// The list of VPCs that are authorized to be associated with the specified hosted
     68 	// zone.
     69 	//
     70 	// This member is required.
     71 	VPCs []types.VPC
     72 
     73 	// When the response includes a NextToken element, there are more VPCs that can be
     74 	// associated with the specified hosted zone. To get the next page of VPCs, submit
     75 	// another ListVPCAssociationAuthorizations request, and include the value of the
     76 	// NextToken element from the response in the nexttoken request parameter.
     77 	NextToken *string
     78 
     79 	// Metadata pertaining to the operation's result.
     80 	ResultMetadata middleware.Metadata
     81 
     82 	noSmithyDocumentSerde
     83 }
     84 
     85 func (c *Client) addOperationListVPCAssociationAuthorizationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
     86 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     87 		return err
     88 	}
     89 	err = stack.Serialize.Add(&awsRestxml_serializeOpListVPCAssociationAuthorizations{}, middleware.After)
     90 	if err != nil {
     91 		return err
     92 	}
     93 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListVPCAssociationAuthorizations{}, middleware.After)
     94 	if err != nil {
     95 		return err
     96 	}
     97 	if err := addProtocolFinalizerMiddlewares(stack, options, "ListVPCAssociationAuthorizations"); err != nil {
     98 		return fmt.Errorf("add protocol finalizers: %v", err)
     99 	}
    100 
    101 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    102 		return err
    103 	}
    104 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    105 		return err
    106 	}
    107 	if err = addClientRequestID(stack); err != nil {
    108 		return err
    109 	}
    110 	if err = addComputeContentLength(stack); err != nil {
    111 		return err
    112 	}
    113 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    114 		return err
    115 	}
    116 	if err = addComputePayloadSHA256(stack); err != nil {
    117 		return err
    118 	}
    119 	if err = addRetry(stack, options); err != nil {
    120 		return err
    121 	}
    122 	if err = addRawResponseToMetadata(stack); err != nil {
    123 		return err
    124 	}
    125 	if err = addRecordResponseTiming(stack); err != nil {
    126 		return err
    127 	}
    128 	if err = addClientUserAgent(stack, options); 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 = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    138 		return err
    139 	}
    140 	if err = addOpListVPCAssociationAuthorizationsValidationMiddleware(stack); err != nil {
    141 		return err
    142 	}
    143 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVPCAssociationAuthorizations(options.Region), middleware.Before); err != nil {
    144 		return err
    145 	}
    146 	if err = addRecursionDetection(stack); err != nil {
    147 		return err
    148 	}
    149 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    150 		return err
    151 	}
    152 	if err = addResponseErrorMiddleware(stack); err != nil {
    153 		return err
    154 	}
    155 	if err = addSanitizeURLMiddleware(stack); err != nil {
    156 		return err
    157 	}
    158 	if err = addRequestResponseLogging(stack, options); err != nil {
    159 		return err
    160 	}
    161 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    162 		return err
    163 	}
    164 	return nil
    165 }
    166 
    167 func newServiceMetadataMiddleware_opListVPCAssociationAuthorizations(region string) *awsmiddleware.RegisterServiceMetadata {
    168 	return &awsmiddleware.RegisterServiceMetadata{
    169 		Region:        region,
    170 		ServiceID:     ServiceID,
    171 		OperationName: "ListVPCAssociationAuthorizations",
    172 	}
    173 }