src

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

api_op_GetAccountLimit.go (7541B)


      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.
     16 //
     17 // For the default limit, see [Limits] in the Amazon Route 53 Developer Guide. To request
     18 // a higher limit, [open a case].
     19 //
     20 // You can also view account limits in Amazon Web Services Trusted Advisor. Sign
     21 // in to the Amazon Web Services Management Console and open the Trusted Advisor
     22 // console at [https://console.aws.amazon.com/trustedadvisor/]. Then choose Service limits in the navigation pane.
     23 //
     24 // [Limits]: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DNSLimitations.html
     25 // [https://console.aws.amazon.com/trustedadvisor/]: https://console.aws.amazon.com/trustedadvisor
     26 // [open a case]: https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-route53
     27 func (c *Client) GetAccountLimit(ctx context.Context, params *GetAccountLimitInput, optFns ...func(*Options)) (*GetAccountLimitOutput, error) {
     28 	if params == nil {
     29 		params = &GetAccountLimitInput{}
     30 	}
     31 
     32 	result, metadata, err := c.invokeOperation(ctx, "GetAccountLimit", params, optFns, c.addOperationGetAccountLimitMiddlewares)
     33 	if err != nil {
     34 		return nil, err
     35 	}
     36 
     37 	out := result.(*GetAccountLimitOutput)
     38 	out.ResultMetadata = metadata
     39 	return out, nil
     40 }
     41 
     42 // A complex type that contains information about the request to create a hosted
     43 // zone.
     44 type GetAccountLimitInput struct {
     45 
     46 	// The limit that you want to get. Valid values include the following:
     47 	//
     48 	//   - MAX_HEALTH_CHECKS_BY_OWNER: The maximum number of health checks that you
     49 	//   can create using the current account.
     50 	//
     51 	//   - MAX_HOSTED_ZONES_BY_OWNER: The maximum number of hosted zones that you can
     52 	//   create using the current account.
     53 	//
     54 	//   - MAX_REUSABLE_DELEGATION_SETS_BY_OWNER: The maximum number of reusable
     55 	//   delegation sets that you can create using the current account.
     56 	//
     57 	//   - MAX_TRAFFIC_POLICIES_BY_OWNER: The maximum number of traffic policies that
     58 	//   you can create using the current account.
     59 	//
     60 	//   - MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER: The maximum number of traffic policy
     61 	//   instances that you can create using the current account. (Traffic policy
     62 	//   instances are referred to as traffic flow policy records in the Amazon Route 53
     63 	//   console.)
     64 	//
     65 	// This member is required.
     66 	Type types.AccountLimitType
     67 
     68 	noSmithyDocumentSerde
     69 }
     70 
     71 // A complex type that contains the requested limit.
     72 type GetAccountLimitOutput struct {
     73 
     74 	// The current number of entities that you have created of the specified type. For
     75 	// example, if you specified MAX_HEALTH_CHECKS_BY_OWNER for the value of Type in
     76 	// the request, the value of Count is the current number of health checks that you
     77 	// have created using the current account.
     78 	//
     79 	// This member is required.
     80 	Count int64
     81 
     82 	// The current setting for the specified limit. For example, if you specified
     83 	// MAX_HEALTH_CHECKS_BY_OWNER for the value of Type in the request, the value of
     84 	// Limit is the maximum number of health checks that you can create using the
     85 	// current account.
     86 	//
     87 	// This member is required.
     88 	Limit *types.AccountLimit
     89 
     90 	// Metadata pertaining to the operation's result.
     91 	ResultMetadata middleware.Metadata
     92 
     93 	noSmithyDocumentSerde
     94 }
     95 
     96 func (c *Client) addOperationGetAccountLimitMiddlewares(stack *middleware.Stack, options Options) (err error) {
     97 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     98 		return err
     99 	}
    100 	err = stack.Serialize.Add(&awsRestxml_serializeOpGetAccountLimit{}, middleware.After)
    101 	if err != nil {
    102 		return err
    103 	}
    104 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetAccountLimit{}, middleware.After)
    105 	if err != nil {
    106 		return err
    107 	}
    108 	if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccountLimit"); err != nil {
    109 		return fmt.Errorf("add protocol finalizers: %v", err)
    110 	}
    111 
    112 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
    113 		return err
    114 	}
    115 	if err = addSetLoggerMiddleware(stack, options); err != nil {
    116 		return err
    117 	}
    118 	if err = addClientRequestID(stack); err != nil {
    119 		return err
    120 	}
    121 	if err = addComputeContentLength(stack); err != nil {
    122 		return err
    123 	}
    124 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
    125 		return err
    126 	}
    127 	if err = addComputePayloadSHA256(stack); err != nil {
    128 		return err
    129 	}
    130 	if err = addRetry(stack, options); err != nil {
    131 		return err
    132 	}
    133 	if err = addRawResponseToMetadata(stack); err != nil {
    134 		return err
    135 	}
    136 	if err = addRecordResponseTiming(stack); err != nil {
    137 		return err
    138 	}
    139 	if err = addSpanRetryLoop(stack, options); err != nil {
    140 		return err
    141 	}
    142 	if err = addClientUserAgent(stack, options); err != nil {
    143 		return err
    144 	}
    145 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
    146 		return err
    147 	}
    148 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    149 		return err
    150 	}
    151 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    152 		return err
    153 	}
    154 	if err = addTimeOffsetBuild(stack, c); err != nil {
    155 		return err
    156 	}
    157 	if err = addUserAgentRetryMode(stack, options); err != nil {
    158 		return err
    159 	}
    160 	if err = addCredentialSource(stack, options); err != nil {
    161 		return err
    162 	}
    163 	if err = addOpGetAccountLimitValidationMiddleware(stack); err != nil {
    164 		return err
    165 	}
    166 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccountLimit(options.Region), middleware.Before); err != nil {
    167 		return err
    168 	}
    169 	if err = addRecursionDetection(stack); err != nil {
    170 		return err
    171 	}
    172 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    173 		return err
    174 	}
    175 	if err = addResponseErrorMiddleware(stack); err != nil {
    176 		return err
    177 	}
    178 	if err = addRequestResponseLogging(stack, options); err != nil {
    179 		return err
    180 	}
    181 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    182 		return err
    183 	}
    184 	if err = addInterceptBeforeRetryLoop(stack, options); err != nil {
    185 		return err
    186 	}
    187 	if err = addInterceptAttempt(stack, options); err != nil {
    188 		return err
    189 	}
    190 	if err = addInterceptExecution(stack, options); err != nil {
    191 		return err
    192 	}
    193 	if err = addInterceptBeforeSerialization(stack, options); err != nil {
    194 		return err
    195 	}
    196 	if err = addInterceptAfterSerialization(stack, options); err != nil {
    197 		return err
    198 	}
    199 	if err = addInterceptBeforeSigning(stack, options); err != nil {
    200 		return err
    201 	}
    202 	if err = addInterceptAfterSigning(stack, options); err != nil {
    203 		return err
    204 	}
    205 	if err = addInterceptTransmit(stack, options); err != nil {
    206 		return err
    207 	}
    208 	if err = addInterceptBeforeDeserialization(stack, options); err != nil {
    209 		return err
    210 	}
    211 	if err = addInterceptAfterDeserialization(stack, options); err != nil {
    212 		return err
    213 	}
    214 	if err = addSpanInitializeStart(stack); err != nil {
    215 		return err
    216 	}
    217 	if err = addSpanInitializeEnd(stack); err != nil {
    218 		return err
    219 	}
    220 	if err = addSpanBuildRequestStart(stack); err != nil {
    221 		return err
    222 	}
    223 	if err = addSpanBuildRequestEnd(stack); err != nil {
    224 		return err
    225 	}
    226 	return nil
    227 }
    228 
    229 func newServiceMetadataMiddleware_opGetAccountLimit(region string) *awsmiddleware.RegisterServiceMetadata {
    230 	return &awsmiddleware.RegisterServiceMetadata{
    231 		Region:        region,
    232 		ServiceID:     ServiceID,
    233 		OperationName: "GetAccountLimit",
    234 	}
    235 }