code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_ListVPCAssociationAuthorizations.go (5366B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      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/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 element
     17 // with a VPC child element for each VPC that can be associated with the hosted
     18 // 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 53
     46 	// 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 	err = stack.Serialize.Add(&awsRestxml_serializeOpListVPCAssociationAuthorizations{}, middleware.After)
     87 	if err != nil {
     88 		return err
     89 	}
     90 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListVPCAssociationAuthorizations{}, middleware.After)
     91 	if err != nil {
     92 		return err
     93 	}
     94 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     95 		return err
     96 	}
     97 	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
     98 		return err
     99 	}
    100 	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
    101 		return err
    102 	}
    103 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    104 		return err
    105 	}
    106 	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
    107 		return err
    108 	}
    109 	if err = addRetryMiddlewares(stack, options); err != nil {
    110 		return err
    111 	}
    112 	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
    113 		return err
    114 	}
    115 	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
    116 		return err
    117 	}
    118 	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
    119 		return err
    120 	}
    121 	if err = addClientUserAgent(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    125 		return err
    126 	}
    127 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = addOpListVPCAssociationAuthorizationsValidationMiddleware(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVPCAssociationAuthorizations(options.Region), middleware.Before); err != nil {
    134 		return err
    135 	}
    136 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    137 		return err
    138 	}
    139 	if err = addResponseErrorMiddleware(stack); err != nil {
    140 		return err
    141 	}
    142 	if err = addSanitizeURLMiddleware(stack); err != nil {
    143 		return err
    144 	}
    145 	if err = addRequestResponseLogging(stack, options); err != nil {
    146 		return err
    147 	}
    148 	return nil
    149 }
    150 
    151 func newServiceMetadataMiddleware_opListVPCAssociationAuthorizations(region string) *awsmiddleware.RegisterServiceMetadata {
    152 	return &awsmiddleware.RegisterServiceMetadata{
    153 		Region:        region,
    154 		ServiceID:     ServiceID,
    155 		SigningName:   "route53",
    156 		OperationName: "ListVPCAssociationAuthorizations",
    157 	}
    158 }