code.dwrz.net

Go monorepo.
Log | Files | Refs

api_op_ListHostedZonesByVPC.go (6471B)


      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 // Lists all the private hosted zones that a specified VPC is associated with,
     15 // regardless of which Amazon Web Services account or Amazon Web Services service
     16 // owns the hosted zones. The HostedZoneOwner structure in the response contains
     17 // one of the following values:
     18 //
     19 // * An OwningAccount element, which contains the
     20 // account number of either the current Amazon Web Services account or another
     21 // Amazon Web Services account. Some services, such as Cloud Map, create hosted
     22 // zones using the current account.
     23 //
     24 // * An OwningService element, which identifies
     25 // the Amazon Web Services service that created and owns the hosted zone. For
     26 // example, if a hosted zone was created by Amazon Elastic File System (Amazon
     27 // EFS), the value of Owner is efs.amazonaws.com.
     28 //
     29 // When listing private hosted
     30 // zones, the hosted zone and the Amazon VPC must belong to the same partition
     31 // where the hosted zones were created. A partition is a group of Amazon Web
     32 // Services Regions. Each Amazon Web Services account is scoped to one partition.
     33 // The following are the supported partitions:
     34 //
     35 // * aws - Amazon Web Services
     36 // Regions
     37 //
     38 // * aws-cn - China Regions
     39 //
     40 // * aws-us-gov - Amazon Web Services GovCloud
     41 // (US) Region
     42 //
     43 // For more information, see Access Management
     44 // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
     45 // the Amazon Web Services General Reference.
     46 func (c *Client) ListHostedZonesByVPC(ctx context.Context, params *ListHostedZonesByVPCInput, optFns ...func(*Options)) (*ListHostedZonesByVPCOutput, error) {
     47 	if params == nil {
     48 		params = &ListHostedZonesByVPCInput{}
     49 	}
     50 
     51 	result, metadata, err := c.invokeOperation(ctx, "ListHostedZonesByVPC", params, optFns, c.addOperationListHostedZonesByVPCMiddlewares)
     52 	if err != nil {
     53 		return nil, err
     54 	}
     55 
     56 	out := result.(*ListHostedZonesByVPCOutput)
     57 	out.ResultMetadata = metadata
     58 	return out, nil
     59 }
     60 
     61 // Lists all the private hosted zones that a specified VPC is associated with,
     62 // regardless of which Amazon Web Services account created the hosted zones.
     63 type ListHostedZonesByVPCInput struct {
     64 
     65 	// The ID of the Amazon VPC that you want to list hosted zones for.
     66 	//
     67 	// This member is required.
     68 	VPCId *string
     69 
     70 	// For the Amazon VPC that you specified for VPCId, the Amazon Web Services Region
     71 	// that you created the VPC in.
     72 	//
     73 	// This member is required.
     74 	VPCRegion types.VPCRegion
     75 
     76 	// (Optional) The maximum number of hosted zones that you want Amazon Route 53 to
     77 	// return. If the specified VPC is associated with more than MaxItems hosted zones,
     78 	// the response includes a NextToken element. NextToken contains an encrypted token
     79 	// that identifies the first hosted zone that Route 53 will return if you submit
     80 	// another request.
     81 	MaxItems *int32
     82 
     83 	// If the previous response included a NextToken element, the specified VPC is
     84 	// associated with more hosted zones. To get more hosted zones, submit another
     85 	// ListHostedZonesByVPC request. For the value of NextToken, specify the value of
     86 	// NextToken from the previous response. If the previous response didn't include a
     87 	// NextToken element, there are no more hosted zones to get.
     88 	NextToken *string
     89 
     90 	noSmithyDocumentSerde
     91 }
     92 
     93 type ListHostedZonesByVPCOutput struct {
     94 
     95 	// A list that contains one HostedZoneSummary element for each hosted zone that the
     96 	// specified Amazon VPC is associated with. Each HostedZoneSummary element contains
     97 	// the hosted zone name and ID, and information about who owns the hosted zone.
     98 	//
     99 	// This member is required.
    100 	HostedZoneSummaries []types.HostedZoneSummary
    101 
    102 	// The value that you specified for MaxItems in the most recent
    103 	// ListHostedZonesByVPC request.
    104 	//
    105 	// This member is required.
    106 	MaxItems *int32
    107 
    108 	// The value that you will use for NextToken in the next ListHostedZonesByVPC
    109 	// request.
    110 	NextToken *string
    111 
    112 	// Metadata pertaining to the operation's result.
    113 	ResultMetadata middleware.Metadata
    114 
    115 	noSmithyDocumentSerde
    116 }
    117 
    118 func (c *Client) addOperationListHostedZonesByVPCMiddlewares(stack *middleware.Stack, options Options) (err error) {
    119 	err = stack.Serialize.Add(&awsRestxml_serializeOpListHostedZonesByVPC{}, middleware.After)
    120 	if err != nil {
    121 		return err
    122 	}
    123 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpListHostedZonesByVPC{}, middleware.After)
    124 	if err != nil {
    125 		return err
    126 	}
    127 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    128 		return err
    129 	}
    130 	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
    131 		return err
    132 	}
    133 	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
    134 		return err
    135 	}
    136 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    137 		return err
    138 	}
    139 	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
    140 		return err
    141 	}
    142 	if err = addRetryMiddlewares(stack, options); err != nil {
    143 		return err
    144 	}
    145 	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
    146 		return err
    147 	}
    148 	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
    149 		return err
    150 	}
    151 	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
    152 		return err
    153 	}
    154 	if err = addClientUserAgent(stack); err != nil {
    155 		return err
    156 	}
    157 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    158 		return err
    159 	}
    160 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    161 		return err
    162 	}
    163 	if err = addOpListHostedZonesByVPCValidationMiddleware(stack); err != nil {
    164 		return err
    165 	}
    166 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHostedZonesByVPC(options.Region), middleware.Before); err != nil {
    167 		return err
    168 	}
    169 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    170 		return err
    171 	}
    172 	if err = addResponseErrorMiddleware(stack); err != nil {
    173 		return err
    174 	}
    175 	if err = addRequestResponseLogging(stack, options); err != nil {
    176 		return err
    177 	}
    178 	return nil
    179 }
    180 
    181 func newServiceMetadataMiddleware_opListHostedZonesByVPC(region string) *awsmiddleware.RegisterServiceMetadata {
    182 	return &awsmiddleware.RegisterServiceMetadata{
    183 		Region:        region,
    184 		ServiceID:     ServiceID,
    185 		SigningName:   "route53",
    186 		OperationName: "ListHostedZonesByVPC",
    187 	}
    188 }