code.dwrz.net

Go monorepo.
Log | Files | Refs

api_client.go (19477B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package route53
      4 
      5 import (
      6 	"context"
      7 	"github.com/aws/aws-sdk-go-v2/aws"
      8 	"github.com/aws/aws-sdk-go-v2/aws/defaults"
      9 	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
     10 	"github.com/aws/aws-sdk-go-v2/aws/retry"
     11 	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
     12 	awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
     13 	internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
     14 	route53cust "github.com/aws/aws-sdk-go-v2/service/route53/internal/customizations"
     15 	smithy "github.com/aws/smithy-go"
     16 	smithydocument "github.com/aws/smithy-go/document"
     17 	"github.com/aws/smithy-go/logging"
     18 	"github.com/aws/smithy-go/middleware"
     19 	smithyhttp "github.com/aws/smithy-go/transport/http"
     20 	"net"
     21 	"net/http"
     22 	"strings"
     23 	"time"
     24 )
     25 
     26 const ServiceID = "Route 53"
     27 const ServiceAPIVersion = "2013-04-01"
     28 
     29 // Client provides the API client to make operations call for Amazon Route 53.
     30 type Client struct {
     31 	options Options
     32 }
     33 
     34 // New returns an initialized Client based on the functional options. Provide
     35 // additional functional options to further configure the behavior of the client,
     36 // such as changing the client's endpoint or adding custom middleware behavior.
     37 func New(options Options, optFns ...func(*Options)) *Client {
     38 	options = options.Copy()
     39 
     40 	resolveDefaultLogger(&options)
     41 
     42 	setResolvedDefaultsMode(&options)
     43 
     44 	resolveRetryer(&options)
     45 
     46 	resolveHTTPClient(&options)
     47 
     48 	resolveHTTPSignerV4(&options)
     49 
     50 	resolveDefaultEndpointConfiguration(&options)
     51 
     52 	for _, fn := range optFns {
     53 		fn(&options)
     54 	}
     55 
     56 	client := &Client{
     57 		options: options,
     58 	}
     59 
     60 	return client
     61 }
     62 
     63 type Options struct {
     64 	// Set of options to modify how an operation is invoked. These apply to all
     65 	// operations invoked for this client. Use functional options on operation call to
     66 	// modify this list for per operation behavior.
     67 	APIOptions []func(*middleware.Stack) error
     68 
     69 	// Configures the events that will be sent to the configured logger.
     70 	ClientLogMode aws.ClientLogMode
     71 
     72 	// The credentials object to use when signing requests.
     73 	Credentials aws.CredentialsProvider
     74 
     75 	// The configuration DefaultsMode that the SDK should use when constructing the
     76 	// clients initial default settings.
     77 	DefaultsMode aws.DefaultsMode
     78 
     79 	// The endpoint options to be used when attempting to resolve an endpoint.
     80 	EndpointOptions EndpointResolverOptions
     81 
     82 	// The service endpoint resolver.
     83 	EndpointResolver EndpointResolver
     84 
     85 	// Signature Version 4 (SigV4) Signer
     86 	HTTPSignerV4 HTTPSignerV4
     87 
     88 	// The logger writer interface to write logging messages to.
     89 	Logger logging.Logger
     90 
     91 	// The region to send requests to. (Required)
     92 	Region string
     93 
     94 	// RetryMaxAttempts specifies the maximum number attempts an API client will call
     95 	// an operation that fails with a retryable error. A value of 0 is ignored, and
     96 	// will not be used to configure the API client created default retryer, or modify
     97 	// per operation call's retry max attempts. When creating a new API Clients this
     98 	// member will only be used if the Retryer Options member is nil. This value will
     99 	// be ignored if Retryer is not nil. If specified in an operation call's functional
    100 	// options with a value that is different than the constructed client's Options,
    101 	// the Client's Retryer will be wrapped to use the operation's specific
    102 	// RetryMaxAttempts value.
    103 	RetryMaxAttempts int
    104 
    105 	// RetryMode specifies the retry mode the API client will be created with, if
    106 	// Retryer option is not also specified. When creating a new API Clients this
    107 	// member will only be used if the Retryer Options member is nil. This value will
    108 	// be ignored if Retryer is not nil. Currently does not support per operation call
    109 	// overrides, may in the future.
    110 	RetryMode aws.RetryMode
    111 
    112 	// Retryer guides how HTTP requests should be retried in case of recoverable
    113 	// failures. When nil the API client will use a default retryer. The kind of
    114 	// default retry created by the API client can be changed with the RetryMode
    115 	// option.
    116 	Retryer aws.Retryer
    117 
    118 	// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
    119 	// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You
    120 	// should not populate this structure programmatically, or rely on the values here
    121 	// within your applications.
    122 	RuntimeEnvironment aws.RuntimeEnvironment
    123 
    124 	// The initial DefaultsMode used when the client options were constructed. If the
    125 	// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
    126 	// value was at that point in time. Currently does not support per operation call
    127 	// overrides, may in the future.
    128 	resolvedDefaultsMode aws.DefaultsMode
    129 
    130 	// The HTTP client to invoke API calls with. Defaults to client's default HTTP
    131 	// implementation if nil.
    132 	HTTPClient HTTPClient
    133 }
    134 
    135 // WithAPIOptions returns a functional option for setting the Client's APIOptions
    136 // option.
    137 func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
    138 	return func(o *Options) {
    139 		o.APIOptions = append(o.APIOptions, optFns...)
    140 	}
    141 }
    142 
    143 // WithEndpointResolver returns a functional option for setting the Client's
    144 // EndpointResolver option.
    145 func WithEndpointResolver(v EndpointResolver) func(*Options) {
    146 	return func(o *Options) {
    147 		o.EndpointResolver = v
    148 	}
    149 }
    150 
    151 type HTTPClient interface {
    152 	Do(*http.Request) (*http.Response, error)
    153 }
    154 
    155 // Copy creates a clone where the APIOptions list is deep copied.
    156 func (o Options) Copy() Options {
    157 	to := o
    158 	to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
    159 	copy(to.APIOptions, o.APIOptions)
    160 
    161 	return to
    162 }
    163 func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
    164 	ctx = middleware.ClearStackValues(ctx)
    165 	stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
    166 	options := c.options.Copy()
    167 	for _, fn := range optFns {
    168 		fn(&options)
    169 	}
    170 
    171 	finalizeRetryMaxAttemptOptions(&options, *c)
    172 
    173 	finalizeClientEndpointResolverOptions(&options)
    174 
    175 	for _, fn := range stackFns {
    176 		if err := fn(stack, options); err != nil {
    177 			return nil, metadata, err
    178 		}
    179 	}
    180 
    181 	for _, fn := range options.APIOptions {
    182 		if err := fn(stack); err != nil {
    183 			return nil, metadata, err
    184 		}
    185 	}
    186 
    187 	handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
    188 	result, metadata, err = handler.Handle(ctx, params)
    189 	if err != nil {
    190 		err = &smithy.OperationError{
    191 			ServiceID:     ServiceID,
    192 			OperationName: opID,
    193 			Err:           err,
    194 		}
    195 	}
    196 	return result, metadata, err
    197 }
    198 
    199 type noSmithyDocumentSerde = smithydocument.NoSerde
    200 
    201 func resolveDefaultLogger(o *Options) {
    202 	if o.Logger != nil {
    203 		return
    204 	}
    205 	o.Logger = logging.Nop{}
    206 }
    207 
    208 func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
    209 	return middleware.AddSetLoggerMiddleware(stack, o.Logger)
    210 }
    211 
    212 func setResolvedDefaultsMode(o *Options) {
    213 	if len(o.resolvedDefaultsMode) > 0 {
    214 		return
    215 	}
    216 
    217 	var mode aws.DefaultsMode
    218 	mode.SetFromString(string(o.DefaultsMode))
    219 
    220 	if mode == aws.DefaultsModeAuto {
    221 		mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
    222 	}
    223 
    224 	o.resolvedDefaultsMode = mode
    225 }
    226 
    227 // NewFromConfig returns a new client from the provided config.
    228 func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
    229 	opts := Options{
    230 		Region:             cfg.Region,
    231 		DefaultsMode:       cfg.DefaultsMode,
    232 		RuntimeEnvironment: cfg.RuntimeEnvironment,
    233 		HTTPClient:         cfg.HTTPClient,
    234 		Credentials:        cfg.Credentials,
    235 		APIOptions:         cfg.APIOptions,
    236 		Logger:             cfg.Logger,
    237 		ClientLogMode:      cfg.ClientLogMode,
    238 	}
    239 	resolveAWSRetryerProvider(cfg, &opts)
    240 	resolveAWSRetryMaxAttempts(cfg, &opts)
    241 	resolveAWSRetryMode(cfg, &opts)
    242 	resolveAWSEndpointResolver(cfg, &opts)
    243 	resolveUseDualStackEndpoint(cfg, &opts)
    244 	resolveUseFIPSEndpoint(cfg, &opts)
    245 	return New(opts, optFns...)
    246 }
    247 
    248 func resolveHTTPClient(o *Options) {
    249 	var buildable *awshttp.BuildableClient
    250 
    251 	if o.HTTPClient != nil {
    252 		var ok bool
    253 		buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
    254 		if !ok {
    255 			return
    256 		}
    257 	} else {
    258 		buildable = awshttp.NewBuildableClient()
    259 	}
    260 
    261 	modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
    262 	if err == nil {
    263 		buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
    264 			if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
    265 				dialer.Timeout = dialerTimeout
    266 			}
    267 		})
    268 
    269 		buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
    270 			if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
    271 				transport.TLSHandshakeTimeout = tlsHandshakeTimeout
    272 			}
    273 		})
    274 	}
    275 
    276 	o.HTTPClient = buildable
    277 }
    278 
    279 func resolveRetryer(o *Options) {
    280 	if o.Retryer != nil {
    281 		return
    282 	}
    283 
    284 	if len(o.RetryMode) == 0 {
    285 		modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
    286 		if err == nil {
    287 			o.RetryMode = modeConfig.RetryMode
    288 		}
    289 	}
    290 	if len(o.RetryMode) == 0 {
    291 		o.RetryMode = aws.RetryModeStandard
    292 	}
    293 
    294 	var standardOptions []func(*retry.StandardOptions)
    295 	if v := o.RetryMaxAttempts; v != 0 {
    296 		standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
    297 			so.MaxAttempts = v
    298 		})
    299 	}
    300 
    301 	switch o.RetryMode {
    302 	case aws.RetryModeAdaptive:
    303 		var adaptiveOptions []func(*retry.AdaptiveModeOptions)
    304 		if len(standardOptions) != 0 {
    305 			adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
    306 				ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
    307 			})
    308 		}
    309 		o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
    310 
    311 	default:
    312 		o.Retryer = retry.NewStandard(standardOptions...)
    313 	}
    314 }
    315 
    316 func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
    317 	if cfg.Retryer == nil {
    318 		return
    319 	}
    320 	o.Retryer = cfg.Retryer()
    321 }
    322 
    323 func resolveAWSRetryMode(cfg aws.Config, o *Options) {
    324 	if len(cfg.RetryMode) == 0 {
    325 		return
    326 	}
    327 	o.RetryMode = cfg.RetryMode
    328 }
    329 func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
    330 	if cfg.RetryMaxAttempts == 0 {
    331 		return
    332 	}
    333 	o.RetryMaxAttempts = cfg.RetryMaxAttempts
    334 }
    335 
    336 func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
    337 	if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
    338 		return
    339 	}
    340 
    341 	o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
    342 }
    343 
    344 func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
    345 	if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
    346 		return
    347 	}
    348 	o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
    349 }
    350 
    351 func addClientUserAgent(stack *middleware.Stack) error {
    352 	return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "route53", goModuleVersion)(stack)
    353 }
    354 
    355 func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
    356 	mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
    357 		CredentialsProvider: o.Credentials,
    358 		Signer:              o.HTTPSignerV4,
    359 		LogSigning:          o.ClientLogMode.IsSigning(),
    360 	})
    361 	return stack.Finalize.Add(mw, middleware.After)
    362 }
    363 
    364 type HTTPSignerV4 interface {
    365 	SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
    366 }
    367 
    368 func resolveHTTPSignerV4(o *Options) {
    369 	if o.HTTPSignerV4 != nil {
    370 		return
    371 	}
    372 	o.HTTPSignerV4 = newDefaultV4Signer(*o)
    373 }
    374 
    375 func newDefaultV4Signer(o Options) *v4.Signer {
    376 	return v4.NewSigner(func(so *v4.SignerOptions) {
    377 		so.Logger = o.Logger
    378 		so.LogSigning = o.ClientLogMode.IsSigning()
    379 	})
    380 }
    381 
    382 func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
    383 	mo := retry.AddRetryMiddlewaresOptions{
    384 		Retryer:          o.Retryer,
    385 		LogRetryAttempts: o.ClientLogMode.IsRetries(),
    386 	}
    387 	return retry.AddRetryMiddlewares(stack, mo)
    388 }
    389 
    390 // resolves dual-stack endpoint configuration
    391 func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
    392 	if len(cfg.ConfigSources) == 0 {
    393 		return nil
    394 	}
    395 	value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
    396 	if err != nil {
    397 		return err
    398 	}
    399 	if found {
    400 		o.EndpointOptions.UseDualStackEndpoint = value
    401 	}
    402 	return nil
    403 }
    404 
    405 // resolves FIPS endpoint configuration
    406 func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
    407 	if len(cfg.ConfigSources) == 0 {
    408 		return nil
    409 	}
    410 	value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
    411 	if err != nil {
    412 		return err
    413 	}
    414 	if found {
    415 		o.EndpointOptions.UseFIPSEndpoint = value
    416 	}
    417 	return nil
    418 }
    419 
    420 func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
    421 	return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
    422 }
    423 
    424 func addResponseErrorMiddleware(stack *middleware.Stack) error {
    425 	return awshttp.AddResponseErrorMiddleware(stack)
    426 }
    427 
    428 func addSanitizeURLMiddleware(stack *middleware.Stack) error {
    429 	return route53cust.AddSanitizeURLMiddleware(stack, route53cust.AddSanitizeURLMiddlewareOptions{SanitizeURLInput: sanitizeURLInput})
    430 }
    431 
    432 // Check for and split apart Route53 resource IDs, setting only the last piece.
    433 // This allows the output of one operation e.g. foo/1234 to be used as input in
    434 // another operation (e.g. it expects just '1234')
    435 func sanitizeURLInput(input interface{}) error {
    436 	switch i := input.(type) {
    437 	case *ActivateKeySigningKeyInput:
    438 		if i.HostedZoneId != nil {
    439 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    440 			v := (*i.HostedZoneId)[idx+1:]
    441 			i.HostedZoneId = &v
    442 		}
    443 
    444 	case *AssociateVPCWithHostedZoneInput:
    445 		if i.HostedZoneId != nil {
    446 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    447 			v := (*i.HostedZoneId)[idx+1:]
    448 			i.HostedZoneId = &v
    449 		}
    450 
    451 	case *ChangeResourceRecordSetsInput:
    452 		if i.HostedZoneId != nil {
    453 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    454 			v := (*i.HostedZoneId)[idx+1:]
    455 			i.HostedZoneId = &v
    456 		}
    457 
    458 	case *CreateHostedZoneInput:
    459 		if i.DelegationSetId != nil {
    460 			idx := strings.LastIndex(*i.DelegationSetId, `/`)
    461 			v := (*i.DelegationSetId)[idx+1:]
    462 			i.DelegationSetId = &v
    463 		}
    464 
    465 	case *CreateKeySigningKeyInput:
    466 		if i.HostedZoneId != nil {
    467 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    468 			v := (*i.HostedZoneId)[idx+1:]
    469 			i.HostedZoneId = &v
    470 		}
    471 
    472 	case *CreateQueryLoggingConfigInput:
    473 		if i.HostedZoneId != nil {
    474 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    475 			v := (*i.HostedZoneId)[idx+1:]
    476 			i.HostedZoneId = &v
    477 		}
    478 
    479 	case *CreateReusableDelegationSetInput:
    480 		if i.HostedZoneId != nil {
    481 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    482 			v := (*i.HostedZoneId)[idx+1:]
    483 			i.HostedZoneId = &v
    484 		}
    485 
    486 	case *CreateTrafficPolicyInstanceInput:
    487 		if i.HostedZoneId != nil {
    488 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    489 			v := (*i.HostedZoneId)[idx+1:]
    490 			i.HostedZoneId = &v
    491 		}
    492 
    493 	case *CreateVPCAssociationAuthorizationInput:
    494 		if i.HostedZoneId != nil {
    495 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    496 			v := (*i.HostedZoneId)[idx+1:]
    497 			i.HostedZoneId = &v
    498 		}
    499 
    500 	case *DeactivateKeySigningKeyInput:
    501 		if i.HostedZoneId != nil {
    502 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    503 			v := (*i.HostedZoneId)[idx+1:]
    504 			i.HostedZoneId = &v
    505 		}
    506 
    507 	case *DeleteHostedZoneInput:
    508 		if i.Id != nil {
    509 			idx := strings.LastIndex(*i.Id, `/`)
    510 			v := (*i.Id)[idx+1:]
    511 			i.Id = &v
    512 		}
    513 
    514 	case *DeleteKeySigningKeyInput:
    515 		if i.HostedZoneId != nil {
    516 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    517 			v := (*i.HostedZoneId)[idx+1:]
    518 			i.HostedZoneId = &v
    519 		}
    520 
    521 	case *DeleteReusableDelegationSetInput:
    522 		if i.Id != nil {
    523 			idx := strings.LastIndex(*i.Id, `/`)
    524 			v := (*i.Id)[idx+1:]
    525 			i.Id = &v
    526 		}
    527 
    528 	case *DeleteVPCAssociationAuthorizationInput:
    529 		if i.HostedZoneId != nil {
    530 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    531 			v := (*i.HostedZoneId)[idx+1:]
    532 			i.HostedZoneId = &v
    533 		}
    534 
    535 	case *DisableHostedZoneDNSSECInput:
    536 		if i.HostedZoneId != nil {
    537 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    538 			v := (*i.HostedZoneId)[idx+1:]
    539 			i.HostedZoneId = &v
    540 		}
    541 
    542 	case *DisassociateVPCFromHostedZoneInput:
    543 		if i.HostedZoneId != nil {
    544 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    545 			v := (*i.HostedZoneId)[idx+1:]
    546 			i.HostedZoneId = &v
    547 		}
    548 
    549 	case *EnableHostedZoneDNSSECInput:
    550 		if i.HostedZoneId != nil {
    551 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    552 			v := (*i.HostedZoneId)[idx+1:]
    553 			i.HostedZoneId = &v
    554 		}
    555 
    556 	case *GetChangeInput:
    557 		if i.Id != nil {
    558 			idx := strings.LastIndex(*i.Id, `/`)
    559 			v := (*i.Id)[idx+1:]
    560 			i.Id = &v
    561 		}
    562 
    563 	case *GetDNSSECInput:
    564 		if i.HostedZoneId != nil {
    565 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    566 			v := (*i.HostedZoneId)[idx+1:]
    567 			i.HostedZoneId = &v
    568 		}
    569 
    570 	case *GetHostedZoneInput:
    571 		if i.Id != nil {
    572 			idx := strings.LastIndex(*i.Id, `/`)
    573 			v := (*i.Id)[idx+1:]
    574 			i.Id = &v
    575 		}
    576 
    577 	case *GetHostedZoneLimitInput:
    578 		if i.HostedZoneId != nil {
    579 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    580 			v := (*i.HostedZoneId)[idx+1:]
    581 			i.HostedZoneId = &v
    582 		}
    583 
    584 	case *GetReusableDelegationSetInput:
    585 		if i.Id != nil {
    586 			idx := strings.LastIndex(*i.Id, `/`)
    587 			v := (*i.Id)[idx+1:]
    588 			i.Id = &v
    589 		}
    590 
    591 	case *GetReusableDelegationSetLimitInput:
    592 		if i.DelegationSetId != nil {
    593 			idx := strings.LastIndex(*i.DelegationSetId, `/`)
    594 			v := (*i.DelegationSetId)[idx+1:]
    595 			i.DelegationSetId = &v
    596 		}
    597 
    598 	case *ListHostedZonesInput:
    599 		if i.DelegationSetId != nil {
    600 			idx := strings.LastIndex(*i.DelegationSetId, `/`)
    601 			v := (*i.DelegationSetId)[idx+1:]
    602 			i.DelegationSetId = &v
    603 		}
    604 
    605 	case *ListHostedZonesByNameInput:
    606 		if i.HostedZoneId != nil {
    607 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    608 			v := (*i.HostedZoneId)[idx+1:]
    609 			i.HostedZoneId = &v
    610 		}
    611 
    612 	case *ListQueryLoggingConfigsInput:
    613 		if i.HostedZoneId != nil {
    614 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    615 			v := (*i.HostedZoneId)[idx+1:]
    616 			i.HostedZoneId = &v
    617 		}
    618 
    619 	case *ListResourceRecordSetsInput:
    620 		if i.HostedZoneId != nil {
    621 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    622 			v := (*i.HostedZoneId)[idx+1:]
    623 			i.HostedZoneId = &v
    624 		}
    625 
    626 	case *ListTrafficPolicyInstancesInput:
    627 		if i.HostedZoneIdMarker != nil {
    628 			idx := strings.LastIndex(*i.HostedZoneIdMarker, `/`)
    629 			v := (*i.HostedZoneIdMarker)[idx+1:]
    630 			i.HostedZoneIdMarker = &v
    631 		}
    632 
    633 	case *ListTrafficPolicyInstancesByHostedZoneInput:
    634 		if i.HostedZoneId != nil {
    635 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    636 			v := (*i.HostedZoneId)[idx+1:]
    637 			i.HostedZoneId = &v
    638 		}
    639 
    640 	case *ListTrafficPolicyInstancesByPolicyInput:
    641 		if i.HostedZoneIdMarker != nil {
    642 			idx := strings.LastIndex(*i.HostedZoneIdMarker, `/`)
    643 			v := (*i.HostedZoneIdMarker)[idx+1:]
    644 			i.HostedZoneIdMarker = &v
    645 		}
    646 
    647 	case *ListVPCAssociationAuthorizationsInput:
    648 		if i.HostedZoneId != nil {
    649 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    650 			v := (*i.HostedZoneId)[idx+1:]
    651 			i.HostedZoneId = &v
    652 		}
    653 
    654 	case *TestDNSAnswerInput:
    655 		if i.HostedZoneId != nil {
    656 			idx := strings.LastIndex(*i.HostedZoneId, `/`)
    657 			v := (*i.HostedZoneId)[idx+1:]
    658 			i.HostedZoneId = &v
    659 		}
    660 
    661 	case *UpdateHostedZoneCommentInput:
    662 		if i.Id != nil {
    663 			idx := strings.LastIndex(*i.Id, `/`)
    664 			v := (*i.Id)[idx+1:]
    665 			i.Id = &v
    666 		}
    667 
    668 	default:
    669 		break
    670 	}
    671 	return nil
    672 }
    673 
    674 func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
    675 	return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
    676 		LogRequest:          o.ClientLogMode.IsRequest(),
    677 		LogRequestWithBody:  o.ClientLogMode.IsRequestWithBody(),
    678 		LogResponse:         o.ClientLogMode.IsResponse(),
    679 		LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
    680 	}, middleware.After)
    681 }