src

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

api_op_GetTrafficPolicyInstanceCount.go (4147B)


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