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