src

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

api_op_ListHostedZonesByVPC.go (5880B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 
      8 	"github.com/aws/aws-sdk-go-v2/service/route53/types"
      9 	"github.com/aws/smithy-go/middleware"
     10 )
     11 
     12 // Lists all the private hosted zones that a specified VPC is associated with,
     13 // regardless of which Amazon Web Services account or Amazon Web Services service
     14 // owns the hosted zones. The HostedZoneOwner structure in the response contains
     15 // one of the following values:
     16 //
     17 //   - An OwningAccount element, which contains the account number of either the
     18 //     current Amazon Web Services account or another Amazon Web Services account. Some
     19 //     services, such as Cloud Map, create hosted zones using the current account.
     20 //
     21 //   - An OwningService element, which identifies the Amazon Web Services service
     22 //     that created and owns the hosted zone. For example, if a hosted zone was created
     23 //     by Amazon Elastic File System (Amazon EFS), the value of Owner is
     24 //     efs.amazonaws.com .
     25 //
     26 // ListHostedZonesByVPC returns the hosted zones associated with the specified VPC
     27 // and does not reflect the hosted zone associations to VPCs via Route 53 Profiles.
     28 // To get the associations to a Profile, call the [ListProfileResourceAssociations]API.
     29 //
     30 // When listing private hosted zones, the hosted zone and the Amazon VPC must
     31 // belong to the same partition where the hosted zones were created. A partition is
     32 // a group of Amazon Web Services Regions. Each Amazon Web Services account is
     33 // scoped to one partition.
     34 //
     35 // The following are the supported partitions:
     36 //
     37 //   - aws - Amazon Web Services Regions
     38 //
     39 //   - aws-cn - China Regions
     40 //
     41 //   - aws-us-gov - Amazon Web Services GovCloud (US) Region
     42 //
     43 // For more information, see [Access Management] in the Amazon Web Services General Reference.
     44 //
     45 // [Access Management]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
     46 // [ListProfileResourceAssociations]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_ListProfileResourceAssociations.html
     47 func (c *Client) ListHostedZonesByVPC(ctx context.Context, params *ListHostedZonesByVPCInput, optFns ...func(*Options)) (*ListHostedZonesByVPCOutput, error) {
     48 	if params == nil {
     49 		params = &ListHostedZonesByVPCInput{}
     50 	}
     51 
     52 	result, metadata, err := c.invokeOperation(ctx, "ListHostedZonesByVPC", params, optFns, c.addOperationListHostedZonesByVPCMiddlewares)
     53 	if err != nil {
     54 		return nil, err
     55 	}
     56 
     57 	out := result.(*ListHostedZonesByVPCOutput)
     58 	out.ResultMetadata = metadata
     59 	return out, nil
     60 }
     61 
     62 // Lists all the private hosted zones that a specified VPC is associated with,
     63 // regardless of which Amazon Web Services account created the hosted zones.
     64 type ListHostedZonesByVPCInput struct {
     65 
     66 	// The ID of the Amazon VPC that you want to list hosted zones for.
     67 	//
     68 	// This member is required.
     69 	VPCId *string
     70 
     71 	// For the Amazon VPC that you specified for VPCId , the Amazon Web Services Region
     72 	// that you created the VPC in.
     73 	//
     74 	// This member is required.
     75 	VPCRegion types.VPCRegion
     76 
     77 	// (Optional) The maximum number of hosted zones that you want Amazon Route 53 to
     78 	// return. If the specified VPC is associated with more than MaxItems hosted
     79 	// zones, the response includes a NextToken element. NextToken contains an
     80 	// encrypted token that identifies the first hosted zone that Route 53 will return
     81 	// if you submit another request.
     82 	MaxItems *int32
     83 
     84 	// If the previous response included a NextToken element, the specified VPC is
     85 	// associated with more hosted zones. To get more hosted zones, submit another
     86 	// ListHostedZonesByVPC request.
     87 	//
     88 	// For the value of NextToken , specify the value of NextToken from the previous
     89 	// response.
     90 	//
     91 	// If the previous response didn't include a NextToken element, there are no more
     92 	// hosted zones to get.
     93 	NextToken *string
     94 
     95 	noSmithyDocumentSerde
     96 }
     97 
     98 type ListHostedZonesByVPCOutput struct {
     99 
    100 	// A list that contains one HostedZoneSummary element for each hosted zone that
    101 	// the specified Amazon VPC is associated with. Each HostedZoneSummary element
    102 	// contains the hosted zone name and ID, and information about who owns the hosted
    103 	// zone.
    104 	//
    105 	// This member is required.
    106 	HostedZoneSummaries []types.HostedZoneSummary
    107 
    108 	// The value that you specified for MaxItems in the most recent
    109 	// ListHostedZonesByVPC request.
    110 	//
    111 	// This member is required.
    112 	MaxItems *int32
    113 
    114 	// The value that you will use for NextToken in the next ListHostedZonesByVPC
    115 	// request.
    116 	NextToken *string
    117 
    118 	// Metadata pertaining to the operation's result.
    119 	ResultMetadata middleware.Metadata
    120 
    121 	noSmithyDocumentSerde
    122 }
    123 
    124 func (c *Client) addOperationListHostedZonesByVPCMiddlewares(stack *middleware.Stack, options Options) (err error) {
    125 	err = stack.Serialize.Add(&awsRestxml_serializeOpListHostedZonesByVPC{}, middleware.After)
    126 	if err != nil {
    127 		return err
    128 	}
    129 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListHostedZonesByVPC{}, middleware.After)
    130 	if err != nil {
    131 		return err
    132 	}
    133 
    134 	if err = addComputeContentLength(stack); err != nil {
    135 		return err
    136 	}
    137 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    138 		return err
    139 	}
    140 	if err = addComputePayloadSHA256(stack); err != nil {
    141 		return err
    142 	}
    143 	if err = addRecordResponseTiming(stack, options); err != nil {
    144 		return err
    145 	}
    146 	if err = addCredentialSource(stack, options); err != nil {
    147 		return err
    148 	}
    149 	if err = addOpListHostedZonesByVPCValidationMiddleware(stack); err != nil {
    150 		return err
    151 	}
    152 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    153 		return err
    154 	}
    155 	if err = addResponseErrorMiddleware(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 	if err = addInterceptors(stack, options); err != nil {
    165 		return err
    166 	}
    167 	return nil
    168 }