src

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

api_op_GetHostedZoneCount.go (3900B)


      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/smithy-go/middleware"
     10 	smithyhttp "github.com/aws/smithy-go/transport/http"
     11 )
     12 
     13 // Retrieves the number of hosted zones that are associated with the current
     14 // Amazon Web Services account.
     15 func (c *Client) GetHostedZoneCount(ctx context.Context, params *GetHostedZoneCountInput, optFns ...func(*Options)) (*GetHostedZoneCountOutput, error) {
     16 	if params == nil {
     17 		params = &GetHostedZoneCountInput{}
     18 	}
     19 
     20 	result, metadata, err := c.invokeOperation(ctx, "GetHostedZoneCount", params, optFns, c.addOperationGetHostedZoneCountMiddlewares)
     21 	if err != nil {
     22 		return nil, err
     23 	}
     24 
     25 	out := result.(*GetHostedZoneCountOutput)
     26 	out.ResultMetadata = metadata
     27 	return out, nil
     28 }
     29 
     30 // A request to retrieve a count of all the hosted zones that are associated with
     31 // the current Amazon Web Services account.
     32 type GetHostedZoneCountInput struct {
     33 	noSmithyDocumentSerde
     34 }
     35 
     36 // A complex type that contains the response to a GetHostedZoneCount request.
     37 type GetHostedZoneCountOutput struct {
     38 
     39 	// The total number of public and private hosted zones that are associated with
     40 	// the current Amazon Web Services account.
     41 	//
     42 	// This member is required.
     43 	HostedZoneCount *int64
     44 
     45 	// Metadata pertaining to the operation's result.
     46 	ResultMetadata middleware.Metadata
     47 
     48 	noSmithyDocumentSerde
     49 }
     50 
     51 func (c *Client) addOperationGetHostedZoneCountMiddlewares(stack *middleware.Stack, options Options) (err error) {
     52 	if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
     53 		return err
     54 	}
     55 	err = stack.Serialize.Add(&awsRestxml_serializeOpGetHostedZoneCount{}, middleware.After)
     56 	if err != nil {
     57 		return err
     58 	}
     59 	err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetHostedZoneCount{}, middleware.After)
     60 	if err != nil {
     61 		return err
     62 	}
     63 	if err := addProtocolFinalizerMiddlewares(stack, options, "GetHostedZoneCount"); err != nil {
     64 		return fmt.Errorf("add protocol finalizers: %v", err)
     65 	}
     66 
     67 	if err = addlegacyEndpointContextSetter(stack, options); err != nil {
     68 		return err
     69 	}
     70 	if err = addSetLoggerMiddleware(stack, options); err != nil {
     71 		return err
     72 	}
     73 	if err = addClientRequestID(stack); err != nil {
     74 		return err
     75 	}
     76 	if err = addComputeContentLength(stack); err != nil {
     77 		return err
     78 	}
     79 	if err = addResolveEndpointMiddleware(stack, options); err != nil {
     80 		return err
     81 	}
     82 	if err = addComputePayloadSHA256(stack); err != nil {
     83 		return err
     84 	}
     85 	if err = addRetry(stack, options); err != nil {
     86 		return err
     87 	}
     88 	if err = addRawResponseToMetadata(stack); err != nil {
     89 		return err
     90 	}
     91 	if err = addRecordResponseTiming(stack); err != nil {
     92 		return err
     93 	}
     94 	if err = addClientUserAgent(stack, options); err != nil {
     95 		return err
     96 	}
     97 	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
     98 		return err
     99 	}
    100 	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
    101 		return err
    102 	}
    103 	if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
    104 		return err
    105 	}
    106 	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetHostedZoneCount(options.Region), middleware.Before); err != nil {
    107 		return err
    108 	}
    109 	if err = addRecursionDetection(stack); err != nil {
    110 		return err
    111 	}
    112 	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
    113 		return err
    114 	}
    115 	if err = addResponseErrorMiddleware(stack); err != nil {
    116 		return err
    117 	}
    118 	if err = addRequestResponseLogging(stack, options); err != nil {
    119 		return err
    120 	}
    121 	if err = addDisableHTTPSMiddleware(stack, options); err != nil {
    122 		return err
    123 	}
    124 	return nil
    125 }
    126 
    127 func newServiceMetadataMiddleware_opGetHostedZoneCount(region string) *awsmiddleware.RegisterServiceMetadata {
    128 	return &awsmiddleware.RegisterServiceMetadata{
    129 		Region:        region,
    130 		ServiceID:     ServiceID,
    131 		OperationName: "GetHostedZoneCount",
    132 	}
    133 }