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