api_op_GetAccountLimit.go (5685B)
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 // Gets the specified limit for the current account, for example, the maximum 15 // number of health checks that you can create using the account. For the default 16 // limit, see Limits 17 // (https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html) 18 // in the Amazon Route 53 Developer Guide. To request a higher limit, open a case 19 // (https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53). 20 // You can also view account limits in Amazon Web Services Trusted Advisor. Sign in 21 // to the Amazon Web Services Management Console and open the Trusted Advisor 22 // console at https://console.aws.amazon.com/trustedadvisor/ 23 // (https://console.aws.amazon.com/trustedadvisor). Then choose Service limits in 24 // the navigation pane. 25 func (c *Client) GetAccountLimit(ctx context.Context, params *GetAccountLimitInput, optFns ...func(*Options)) (*GetAccountLimitOutput, error) { 26 if params == nil { 27 params = &GetAccountLimitInput{} 28 } 29 30 result, metadata, err := c.invokeOperation(ctx, "GetAccountLimit", params, optFns, c.addOperationGetAccountLimitMiddlewares) 31 if err != nil { 32 return nil, err 33 } 34 35 out := result.(*GetAccountLimitOutput) 36 out.ResultMetadata = metadata 37 return out, nil 38 } 39 40 // A complex type that contains information about the request to create a hosted 41 // zone. 42 type GetAccountLimitInput struct { 43 44 // The limit that you want to get. Valid values include the following: 45 // 46 // * 47 // MAX_HEALTH_CHECKS_BY_OWNER: The maximum number of health checks that you can 48 // create using the current account. 49 // 50 // * MAX_HOSTED_ZONES_BY_OWNER: The maximum 51 // number of hosted zones that you can create using the current account. 52 // 53 // * 54 // MAX_REUSABLE_DELEGATION_SETS_BY_OWNER: The maximum number of reusable delegation 55 // sets that you can create using the current account. 56 // 57 // * 58 // MAX_TRAFFIC_POLICIES_BY_OWNER: The maximum number of traffic policies that you 59 // can create using the current account. 60 // 61 // * MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER: 62 // The maximum number of traffic policy instances that you can create using the 63 // current account. (Traffic policy instances are referred to as traffic flow 64 // policy records in the Amazon Route 53 console.) 65 // 66 // This member is required. 67 Type types.AccountLimitType 68 69 noSmithyDocumentSerde 70 } 71 72 // A complex type that contains the requested limit. 73 type GetAccountLimitOutput struct { 74 75 // The current number of entities that you have created of the specified type. For 76 // example, if you specified MAX_HEALTH_CHECKS_BY_OWNER for the value of Type in 77 // the request, the value of Count is the current number of health checks that you 78 // have created using the current account. 79 // 80 // This member is required. 81 Count int64 82 83 // The current setting for the specified limit. For example, if you specified 84 // MAX_HEALTH_CHECKS_BY_OWNER for the value of Type in the request, the value of 85 // Limit is the maximum number of health checks that you can create using the 86 // current account. 87 // 88 // This member is required. 89 Limit *types.AccountLimit 90 91 // Metadata pertaining to the operation's result. 92 ResultMetadata middleware.Metadata 93 94 noSmithyDocumentSerde 95 } 96 97 func (c *Client) addOperationGetAccountLimitMiddlewares(stack *middleware.Stack, options Options) (err error) { 98 err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccountLimit{}, middleware.After) 99 if err != nil { 100 return err 101 } 102 err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccountLimit{}, middleware.After) 103 if err != nil { 104 return err 105 } 106 if err = addSetLoggerMiddleware(stack, options); err != nil { 107 return err 108 } 109 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 110 return err 111 } 112 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 113 return err 114 } 115 if err = addResolveEndpointMiddleware(stack, options); err != nil { 116 return err 117 } 118 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 119 return err 120 } 121 if err = addRetryMiddlewares(stack, options); err != nil { 122 return err 123 } 124 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 125 return err 126 } 127 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 128 return err 129 } 130 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 131 return err 132 } 133 if err = addClientUserAgent(stack); err != nil { 134 return err 135 } 136 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 137 return err 138 } 139 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 140 return err 141 } 142 if err = addOpGetAccountLimitValidationMiddleware(stack); err != nil { 143 return err 144 } 145 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccountLimit(options.Region), middleware.Before); err != nil { 146 return err 147 } 148 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 149 return err 150 } 151 if err = addResponseErrorMiddleware(stack); err != nil { 152 return err 153 } 154 if err = addRequestResponseLogging(stack, options); err != nil { 155 return err 156 } 157 return nil 158 } 159 160 func newServiceMetadataMiddleware_opGetAccountLimit(region string) *awsmiddleware.RegisterServiceMetadata { 161 return &awsmiddleware.RegisterServiceMetadata{ 162 Region: region, 163 ServiceID: ServiceID, 164 SigningName: "route53", 165 OperationName: "GetAccountLimit", 166 } 167 }