src

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

api_op_GetHostedZoneLimit.go (5386B)


      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 the specified limit for a specified hosted zone, for example, the maximum
     15 // number of records that you can create in the hosted zone. For the default limit,
     16 // see Limits (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html)
     17 // in the Amazon Route 53 Developer Guide. To request a higher limit, open a case (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53)
     18 // .
     19 func (c *Client) GetHostedZoneLimit(ctx context.Context, params *GetHostedZoneLimitInput, optFns ...func(*Options)) (*GetHostedZoneLimitOutput, error) {
     20 	if params == nil {
     21 		params = &GetHostedZoneLimitInput{}
     22 	}
     23 
     24 	result, metadata, err := c.invokeOperation(ctx, "GetHostedZoneLimit", params, optFns, c.addOperationGetHostedZoneLimitMiddlewares)
     25 	if err != nil {
     26 		return nil, err
     27 	}
     28 
     29 	out := result.(*GetHostedZoneLimitOutput)
     30 	out.ResultMetadata = metadata
     31 	return out, nil
     32 }
     33 
     34 // A complex type that contains information about the request to create a hosted
     35 // zone.
     36 type GetHostedZoneLimitInput struct {
     37 
     38 	// The ID of the hosted zone that you want to get a limit for.
     39 	//
     40 	// This member is required.
     41 	HostedZoneId *string
     42 
     43 	// The limit that you want to get. Valid values include the following:
     44 	//   - MAX_RRSETS_BY_ZONE: The maximum number of records that you can create in
     45 	//   the specified hosted zone.
     46 	//   - MAX_VPCS_ASSOCIATED_BY_ZONE: The maximum number of Amazon VPCs that you can
     47 	//   associate with the specified private hosted zone.
     48 	//
     49 	// This member is required.
     50 	Type types.HostedZoneLimitType
     51 
     52 	noSmithyDocumentSerde
     53 }
     54 
     55 // A complex type that contains the requested limit.
     56 type GetHostedZoneLimitOutput struct {
     57 
     58 	// The current number of entities that you have created of the specified type. For
     59 	// example, if you specified MAX_RRSETS_BY_ZONE for the value of Type in the
     60 	// request, the value of Count is the current number of records that you have
     61 	// created in the specified hosted zone.
     62 	//
     63 	// This member is required.
     64 	Count int64
     65 
     66 	// The current setting for the specified limit. For example, if you specified
     67 	// MAX_RRSETS_BY_ZONE for the value of Type in the request, the value of Limit is
     68 	// the maximum number of records that you can create in the specified hosted zone.
     69 	//
     70 	// This member is required.
     71 	Limit *types.HostedZoneLimit
     72 
     73 	// Metadata pertaining to the operation's result.
     74 	ResultMetadata middleware.Metadata
     75 
     76 	noSmithyDocumentSerde
     77 }
     78 
     79 func (c *Client) addOperationGetHostedZoneLimitMiddlewares(stack *middleware.Stack, options Options) (err error) {
     80 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     81 		return err
     82 	}
     83 	err = stack.Serialize.Add(&awsRestxml_serializeOpGetHostedZoneLimit{}, middleware.After)
     84 	if err != nil {
     85 		return err
     86 	}
     87 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHostedZoneLimit{}, middleware.After)
     88 	if err != nil {
     89 		return err
     90 	}
     91 	if err := addProtocolFinalizerMiddlewares(stack, options, "GetHostedZoneLimit"); err != nil {
     92 		return fmt.Errorf("add protocol finalizers: %v", err)
     93 	}
     94 
     95 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
     96 		return err
     97 	}
     98 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     99 		return err
    100 	}
    101 	if err = addClientRequestID(stack); err != nil {
    102 		return err
    103 	}
    104 	if err = addComputeContentLength(stack); err != nil {
    105 		return err
    106 	}
    107 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    108 		return err
    109 	}
    110 	if err = addComputePayloadSHA256(stack); err != nil {
    111 		return err
    112 	}
    113 	if err = addRetry(stack, options); err != nil {
    114 		return err
    115 	}
    116 	if err = addRawResponseToMetadata(stack); err != nil {
    117 		return err
    118 	}
    119 	if err = addRecordResponseTiming(stack); err != nil {
    120 		return err
    121 	}
    122 	if err = addClientUserAgent(stack, options); err != nil {
    123 		return err
    124 	}
    125 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    126 		return err
    127 	}
    128 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    129 		return err
    130 	}
    131 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    132 		return err
    133 	}
    134 	if err = addOpGetHostedZoneLimitValidationMiddleware(stack); err != nil {
    135 		return err
    136 	}
    137 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHostedZoneLimit(options.Region), middleware.Before); err != nil {
    138 		return err
    139 	}
    140 	if err = addRecursionDetection(stack); err != nil {
    141 		return err
    142 	}
    143 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    144 		return err
    145 	}
    146 	if err = addResponseErrorMiddleware(stack); err != nil {
    147 		return err
    148 	}
    149 	if err = addSanitizeURLMiddleware(stack); err != nil {
    150 		return err
    151 	}
    152 	if err = addRequestResponseLogging(stack, options); err != nil {
    153 		return err
    154 	}
    155 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    156 		return err
    157 	}
    158 	return nil
    159 }
    160 
    161 func newServiceMetadataMiddleware_opGetHostedZoneLimit(region string) *awsmiddleware.RegisterServiceMetadata {
    162 	return &awsmiddleware.RegisterServiceMetadata{
    163 		Region:        region,
    164 		ServiceID:     ServiceID,
    165 		OperationName: "GetHostedZoneLimit",
    166 	}
    167 }