api_op_ListHostedZonesByVPC.go (8716B)
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 // 19 // - An OwningAccount element, which contains the account number of either the 20 // current Amazon Web Services account or another Amazon Web Services account. Some 21 // services, such as Cloud Map, create hosted zones using the current account. 22 // 23 // - An OwningService element, which identifies the Amazon Web Services service 24 // that created and owns the hosted zone. For example, if a hosted zone was created 25 // by Amazon Elastic File System (Amazon EFS), the value of Owner is 26 // efs.amazonaws.com . 27 // 28 // ListHostedZonesByVPC returns the hosted zones associated with the specified VPC 29 // and does not reflect the hosted zone associations to VPCs via Route 53 Profiles. 30 // To get the associations to a Profile, call the [ListProfileResourceAssociations]API. 31 // 32 // When listing private hosted zones, the hosted zone and the Amazon VPC must 33 // belong to the same partition where the hosted zones were created. A partition is 34 // a group of Amazon Web Services Regions. Each Amazon Web Services account is 35 // scoped to one partition. 36 // 37 // The following are the supported partitions: 38 // 39 // - aws - Amazon Web Services Regions 40 // 41 // - aws-cn - China Regions 42 // 43 // - aws-us-gov - Amazon Web Services GovCloud (US) Region 44 // 45 // For more information, see [Access Management] in the Amazon Web Services General Reference. 46 // 47 // [Access Management]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html 48 // [ListProfileResourceAssociations]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_ListProfileResourceAssociations.html 49 func (c *Client) ListHostedZonesByVPC(ctx context.Context, params *ListHostedZonesByVPCInput, optFns ...func(*Options)) (*ListHostedZonesByVPCOutput, error) { 50 if params == nil { 51 params = &ListHostedZonesByVPCInput{} 52 } 53 54 result, metadata, err := c.invokeOperation(ctx, "ListHostedZonesByVPC", params, optFns, c.addOperationListHostedZonesByVPCMiddlewares) 55 if err != nil { 56 return nil, err 57 } 58 59 out := result.(*ListHostedZonesByVPCOutput) 60 out.ResultMetadata = metadata 61 return out, nil 62 } 63 64 // Lists all the private hosted zones that a specified VPC is associated with, 65 // regardless of which Amazon Web Services account created the hosted zones. 66 type ListHostedZonesByVPCInput struct { 67 68 // The ID of the Amazon VPC that you want to list hosted zones for. 69 // 70 // This member is required. 71 VPCId *string 72 73 // For the Amazon VPC that you specified for VPCId , the Amazon Web Services Region 74 // that you created the VPC in. 75 // 76 // This member is required. 77 VPCRegion types.VPCRegion 78 79 // (Optional) The maximum number of hosted zones that you want Amazon Route 53 to 80 // return. If the specified VPC is associated with more than MaxItems hosted 81 // zones, the response includes a NextToken element. NextToken contains an 82 // encrypted token that identifies the first hosted zone that Route 53 will return 83 // if you submit another request. 84 MaxItems *int32 85 86 // If the previous response included a NextToken element, the specified VPC is 87 // associated with more hosted zones. To get more hosted zones, submit another 88 // ListHostedZonesByVPC request. 89 // 90 // For the value of NextToken , specify the value of NextToken from the previous 91 // response. 92 // 93 // If the previous response didn't include a NextToken element, there are no more 94 // hosted zones to get. 95 NextToken *string 96 97 noSmithyDocumentSerde 98 } 99 100 type ListHostedZonesByVPCOutput struct { 101 102 // A list that contains one HostedZoneSummary element for each hosted zone that 103 // the specified Amazon VPC is associated with. Each HostedZoneSummary element 104 // contains the hosted zone name and ID, and information about who owns the hosted 105 // zone. 106 // 107 // This member is required. 108 HostedZoneSummaries []types.HostedZoneSummary 109 110 // The value that you specified for MaxItems in the most recent 111 // ListHostedZonesByVPC request. 112 // 113 // This member is required. 114 MaxItems *int32 115 116 // The value that you will use for NextToken in the next ListHostedZonesByVPC 117 // request. 118 NextToken *string 119 120 // Metadata pertaining to the operation's result. 121 ResultMetadata middleware.Metadata 122 123 noSmithyDocumentSerde 124 } 125 126 func (c *Client) addOperationListHostedZonesByVPCMiddlewares(stack *middleware.Stack, options Options) (err error) { 127 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 128 return err 129 } 130 err = stack.Serialize.Add(&awsRestxml_serializeOpListHostedZonesByVPC{}, middleware.After) 131 if err != nil { 132 return err 133 } 134 err = stack.Deserialize.Add(&awsRestxml_deserializeOpListHostedZonesByVPC{}, middleware.After) 135 if err != nil { 136 return err 137 } 138 if err := addProtocolFinalizerMiddlewares(stack, options, "ListHostedZonesByVPC"); err != nil { 139 return fmt.Errorf("add protocol finalizers: %v", err) 140 } 141 142 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 143 return err 144 } 145 if err = addSetLoggerMiddleware(stack, options); err != nil { 146 return err 147 } 148 if err = addClientRequestID(stack); err != nil { 149 return err 150 } 151 if err = addComputeContentLength(stack); err != nil { 152 return err 153 } 154 if err = addResolveEndpointMiddleware(stack, options); err != nil { 155 return err 156 } 157 if err = addComputePayloadSHA256(stack); err != nil { 158 return err 159 } 160 if err = addRetry(stack, options); err != nil { 161 return err 162 } 163 if err = addRawResponseToMetadata(stack); err != nil { 164 return err 165 } 166 if err = addRecordResponseTiming(stack); err != nil { 167 return err 168 } 169 if err = addSpanRetryLoop(stack, options); err != nil { 170 return err 171 } 172 if err = addClientUserAgent(stack, options); err != nil { 173 return err 174 } 175 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 176 return err 177 } 178 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 179 return err 180 } 181 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 182 return err 183 } 184 if err = addTimeOffsetBuild(stack, c); err != nil { 185 return err 186 } 187 if err = addUserAgentRetryMode(stack, options); err != nil { 188 return err 189 } 190 if err = addCredentialSource(stack, options); err != nil { 191 return err 192 } 193 if err = addOpListHostedZonesByVPCValidationMiddleware(stack); err != nil { 194 return err 195 } 196 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHostedZonesByVPC(options.Region), middleware.Before); err != nil { 197 return err 198 } 199 if err = addRecursionDetection(stack); err != nil { 200 return err 201 } 202 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 203 return err 204 } 205 if err = addResponseErrorMiddleware(stack); err != nil { 206 return err 207 } 208 if err = addRequestResponseLogging(stack, options); err != nil { 209 return err 210 } 211 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 212 return err 213 } 214 if err = addInterceptBeforeRetryLoop(stack, options); err != nil { 215 return err 216 } 217 if err = addInterceptAttempt(stack, options); err != nil { 218 return err 219 } 220 if err = addInterceptExecution(stack, options); err != nil { 221 return err 222 } 223 if err = addInterceptBeforeSerialization(stack, options); err != nil { 224 return err 225 } 226 if err = addInterceptAfterSerialization(stack, options); err != nil { 227 return err 228 } 229 if err = addInterceptBeforeSigning(stack, options); err != nil { 230 return err 231 } 232 if err = addInterceptAfterSigning(stack, options); err != nil { 233 return err 234 } 235 if err = addInterceptTransmit(stack, options); err != nil { 236 return err 237 } 238 if err = addInterceptBeforeDeserialization(stack, options); err != nil { 239 return err 240 } 241 if err = addInterceptAfterDeserialization(stack, options); err != nil { 242 return err 243 } 244 if err = addSpanInitializeStart(stack); err != nil { 245 return err 246 } 247 if err = addSpanInitializeEnd(stack); err != nil { 248 return err 249 } 250 if err = addSpanBuildRequestStart(stack); err != nil { 251 return err 252 } 253 if err = addSpanBuildRequestEnd(stack); err != nil { 254 return err 255 } 256 return nil 257 } 258 259 func newServiceMetadataMiddleware_opListHostedZonesByVPC(region string) *awsmiddleware.RegisterServiceMetadata { 260 return &awsmiddleware.RegisterServiceMetadata{ 261 Region: region, 262 ServiceID: ServiceID, 263 OperationName: "ListHostedZonesByVPC", 264 } 265 }