api_op_GetHostedZone.go (6083B)
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 // Gets information about a specified hosted zone including the four name servers 15 // assigned to the hosted zone. 16 // 17 // returns the VPCs associated with the specified hosted zone and does not reflect 18 // the VPC associations by Route 53 Profiles. To get the associations to a Profile, 19 // call the [ListProfileAssociations]API. 20 // 21 // [ListProfileAssociations]: https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53profiles_ListProfileAssociations.html 22 func (c *Client) GetHostedZone(ctx context.Context, params *GetHostedZoneInput, optFns ...func(*Options)) (*GetHostedZoneOutput, error) { 23 if params == nil { 24 params = &GetHostedZoneInput{} 25 } 26 27 result, metadata, err := c.invokeOperation(ctx, "GetHostedZone", params, optFns, c.addOperationGetHostedZoneMiddlewares) 28 if err != nil { 29 return nil, err 30 } 31 32 out := result.(*GetHostedZoneOutput) 33 out.ResultMetadata = metadata 34 return out, nil 35 } 36 37 // A request to get information about a specified hosted zone. 38 type GetHostedZoneInput struct { 39 40 // The ID of the hosted zone that you want to get information about. 41 // 42 // This member is required. 43 Id *string 44 45 noSmithyDocumentSerde 46 } 47 48 // A complex type that contain the response to a GetHostedZone request. 49 type GetHostedZoneOutput struct { 50 51 // A complex type that contains general information about the specified hosted 52 // zone. 53 // 54 // This member is required. 55 HostedZone *types.HostedZone 56 57 // A complex type that lists the Amazon Route 53 name servers for the specified 58 // hosted zone. 59 DelegationSet *types.DelegationSet 60 61 // A complex type that contains information about the VPCs that are associated 62 // with the specified hosted zone. 63 VPCs []types.VPC 64 65 // Metadata pertaining to the operation's result. 66 ResultMetadata middleware.Metadata 67 68 noSmithyDocumentSerde 69 } 70 71 func (c *Client) addOperationGetHostedZoneMiddlewares(stack *middleware.Stack, options Options) (err error) { 72 if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { 73 return err 74 } 75 err = stack.Serialize.Add(&awsRestxml_serializeOpGetHostedZone{}, middleware.After) 76 if err != nil { 77 return err 78 } 79 err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHostedZone{}, middleware.After) 80 if err != nil { 81 return err 82 } 83 if err := addProtocolFinalizerMiddlewares(stack, options, "GetHostedZone"); err != nil { 84 return fmt.Errorf("add protocol finalizers: %v", err) 85 } 86 87 if err = addlegacyEndpointContextSetter(stack, options); err != nil { 88 return err 89 } 90 if err = addSetLoggerMiddleware(stack, options); err != nil { 91 return err 92 } 93 if err = addClientRequestID(stack); err != nil { 94 return err 95 } 96 if err = addComputeContentLength(stack); err != nil { 97 return err 98 } 99 if err = addResolveEndpointMiddleware(stack, options); err != nil { 100 return err 101 } 102 if err = addComputePayloadSHA256(stack); err != nil { 103 return err 104 } 105 if err = addRetry(stack, options); err != nil { 106 return err 107 } 108 if err = addRawResponseToMetadata(stack); err != nil { 109 return err 110 } 111 if err = addRecordResponseTiming(stack); err != nil { 112 return err 113 } 114 if err = addSpanRetryLoop(stack, options); err != nil { 115 return err 116 } 117 if err = addClientUserAgent(stack, options); err != nil { 118 return err 119 } 120 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 121 return err 122 } 123 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 124 return err 125 } 126 if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { 127 return err 128 } 129 if err = addTimeOffsetBuild(stack, c); err != nil { 130 return err 131 } 132 if err = addUserAgentRetryMode(stack, options); err != nil { 133 return err 134 } 135 if err = addCredentialSource(stack, options); err != nil { 136 return err 137 } 138 if err = addOpGetHostedZoneValidationMiddleware(stack); err != nil { 139 return err 140 } 141 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHostedZone(options.Region), middleware.Before); err != nil { 142 return err 143 } 144 if err = addRecursionDetection(stack); err != nil { 145 return err 146 } 147 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 148 return err 149 } 150 if err = addResponseErrorMiddleware(stack); err != nil { 151 return err 152 } 153 if err = addSanitizeURLMiddleware(stack); err != nil { 154 return err 155 } 156 if err = addRequestResponseLogging(stack, options); err != nil { 157 return err 158 } 159 if err = addDisableHTTPSMiddleware(stack, options); err != nil { 160 return err 161 } 162 if err = addInterceptBeforeRetryLoop(stack, options); err != nil { 163 return err 164 } 165 if err = addInterceptAttempt(stack, options); err != nil { 166 return err 167 } 168 if err = addInterceptExecution(stack, options); err != nil { 169 return err 170 } 171 if err = addInterceptBeforeSerialization(stack, options); err != nil { 172 return err 173 } 174 if err = addInterceptAfterSerialization(stack, options); err != nil { 175 return err 176 } 177 if err = addInterceptBeforeSigning(stack, options); err != nil { 178 return err 179 } 180 if err = addInterceptAfterSigning(stack, options); err != nil { 181 return err 182 } 183 if err = addInterceptTransmit(stack, options); err != nil { 184 return err 185 } 186 if err = addInterceptBeforeDeserialization(stack, options); err != nil { 187 return err 188 } 189 if err = addInterceptAfterDeserialization(stack, options); err != nil { 190 return err 191 } 192 if err = addSpanInitializeStart(stack); err != nil { 193 return err 194 } 195 if err = addSpanInitializeEnd(stack); err != nil { 196 return err 197 } 198 if err = addSpanBuildRequestStart(stack); err != nil { 199 return err 200 } 201 if err = addSpanBuildRequestEnd(stack); err != nil { 202 return err 203 } 204 return nil 205 } 206 207 func newServiceMetadataMiddleware_opGetHostedZone(region string) *awsmiddleware.RegisterServiceMetadata { 208 return &awsmiddleware.RegisterServiceMetadata{ 209 Region: region, 210 ServiceID: ServiceID, 211 OperationName: "GetHostedZone", 212 } 213 }