src

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

serializers.go (33656B)


      1 // Code generated by smithy-go-codegen DO NOT EDIT.
      2 
      3 package signin
      4 
      5 import (
      6 	"bytes"
      7 	"context"
      8 	"fmt"
      9 
     10 	"github.com/aws/aws-sdk-go-v2/service/signin/types"
     11 	smithy "github.com/aws/smithy-go"
     12 	"github.com/aws/smithy-go/encoding/httpbinding"
     13 	smithyjson "github.com/aws/smithy-go/encoding/json"
     14 	"github.com/aws/smithy-go/middleware"
     15 	"github.com/aws/smithy-go/tracing"
     16 	smithyhttp "github.com/aws/smithy-go/transport/http"
     17 )
     18 
     19 type awsRestjson1_serializeOpCreateOAuth2Token struct {
     20 }
     21 
     22 func (*awsRestjson1_serializeOpCreateOAuth2Token) ID() string {
     23 	return "OperationSerializer"
     24 }
     25 
     26 func (m *awsRestjson1_serializeOpCreateOAuth2Token) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
     27 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
     28 ) {
     29 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
     30 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
     31 	defer endTimer()
     32 	defer span.End()
     33 	request, ok := in.Request.(*smithyhttp.Request)
     34 	if !ok {
     35 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
     36 	}
     37 
     38 	input, ok := in.Parameters.(*CreateOAuth2TokenInput)
     39 	_ = input
     40 	if !ok {
     41 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
     42 	}
     43 
     44 	opPath, opQuery := httpbinding.SplitURI("/v1/token")
     45 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
     46 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
     47 	request.Method = "POST"
     48 	var restEncoder *httpbinding.Encoder
     49 	if request.URL.RawPath == "" {
     50 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
     51 	} else {
     52 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
     53 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
     54 	}
     55 
     56 	if err != nil {
     57 		return out, metadata, &smithy.SerializationError{Err: err}
     58 	}
     59 
     60 	if !restEncoder.HasHeader("Content-Type") {
     61 		ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
     62 		restEncoder.SetHeader("Content-Type").String("application/json")
     63 	}
     64 
     65 	if input.TokenInput != nil {
     66 		jsonEncoder := smithyjson.NewEncoder()
     67 		if err := awsRestjson1_serializeDocumentCreateOAuth2TokenRequestBody(input.TokenInput, jsonEncoder.Value); err != nil {
     68 			return out, metadata, &smithy.SerializationError{Err: err}
     69 		}
     70 		payload := bytes.NewReader(jsonEncoder.Bytes())
     71 		if request, err = request.SetStream(payload); err != nil {
     72 			return out, metadata, &smithy.SerializationError{Err: err}
     73 		}
     74 	} else {
     75 		jsonEncoder := smithyjson.NewEncoder()
     76 		jsonEncoder.Value.Object().Close()
     77 		payload := bytes.NewReader(jsonEncoder.Bytes())
     78 		if request, err = request.SetStream(payload); err != nil {
     79 			return out, metadata, &smithy.SerializationError{Err: err}
     80 		}
     81 
     82 	}
     83 
     84 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
     85 		return out, metadata, &smithy.SerializationError{Err: err}
     86 	}
     87 	in.Request = request
     88 
     89 	endTimer()
     90 	span.End()
     91 	return next.HandleSerialize(ctx, in)
     92 }
     93 func awsRestjson1_serializeOpHttpBindingsCreateOAuth2TokenInput(v *CreateOAuth2TokenInput, encoder *httpbinding.Encoder) error {
     94 	if v == nil {
     95 		return fmt.Errorf("unsupported serialization of nil %T", v)
     96 	}
     97 
     98 	return nil
     99 }
    100 
    101 type awsRestjson1_serializeOpCreateOAuth2TokenWithIAM struct {
    102 }
    103 
    104 func (*awsRestjson1_serializeOpCreateOAuth2TokenWithIAM) ID() string {
    105 	return "OperationSerializer"
    106 }
    107 
    108 func (m *awsRestjson1_serializeOpCreateOAuth2TokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    109 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    110 ) {
    111 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    112 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    113 	defer endTimer()
    114 	defer span.End()
    115 	request, ok := in.Request.(*smithyhttp.Request)
    116 	if !ok {
    117 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    118 	}
    119 
    120 	input, ok := in.Parameters.(*CreateOAuth2TokenWithIAMInput)
    121 	_ = input
    122 	if !ok {
    123 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    124 	}
    125 
    126 	opPath, opQuery := httpbinding.SplitURI("/v1/token?x-amz-client-auth-method=iam")
    127 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    128 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    129 	request.Method = "POST"
    130 	var restEncoder *httpbinding.Encoder
    131 	if request.URL.RawPath == "" {
    132 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    133 	} else {
    134 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    135 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    136 	}
    137 
    138 	if err != nil {
    139 		return out, metadata, &smithy.SerializationError{Err: err}
    140 	}
    141 
    142 	restEncoder.SetHeader("Content-Type").String("application/json")
    143 
    144 	jsonEncoder := smithyjson.NewEncoder()
    145 	if err := awsRestjson1_serializeOpDocumentCreateOAuth2TokenWithIAMInput(input, jsonEncoder.Value); err != nil {
    146 		return out, metadata, &smithy.SerializationError{Err: err}
    147 	}
    148 
    149 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    150 		return out, metadata, &smithy.SerializationError{Err: err}
    151 	}
    152 
    153 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    154 		return out, metadata, &smithy.SerializationError{Err: err}
    155 	}
    156 	in.Request = request
    157 
    158 	endTimer()
    159 	span.End()
    160 	return next.HandleSerialize(ctx, in)
    161 }
    162 func awsRestjson1_serializeOpHttpBindingsCreateOAuth2TokenWithIAMInput(v *CreateOAuth2TokenWithIAMInput, encoder *httpbinding.Encoder) error {
    163 	if v == nil {
    164 		return fmt.Errorf("unsupported serialization of nil %T", v)
    165 	}
    166 
    167 	return nil
    168 }
    169 
    170 func awsRestjson1_serializeOpDocumentCreateOAuth2TokenWithIAMInput(v *CreateOAuth2TokenWithIAMInput, value smithyjson.Value) error {
    171 	object := value.Object()
    172 	defer object.Close()
    173 
    174 	if v.GrantType != nil {
    175 		ok := object.Key("grant_type")
    176 		ok.String(*v.GrantType)
    177 	}
    178 
    179 	if v.Resource != nil {
    180 		ok := object.Key("resource")
    181 		ok.String(*v.Resource)
    182 	}
    183 
    184 	return nil
    185 }
    186 
    187 type awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration struct {
    188 }
    189 
    190 func (*awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration) ID() string {
    191 	return "OperationSerializer"
    192 }
    193 
    194 func (m *awsRestjson1_serializeOpDeleteConsoleAuthorizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    195 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    196 ) {
    197 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    198 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    199 	defer endTimer()
    200 	defer span.End()
    201 	request, ok := in.Request.(*smithyhttp.Request)
    202 	if !ok {
    203 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    204 	}
    205 
    206 	input, ok := in.Parameters.(*DeleteConsoleAuthorizationConfigurationInput)
    207 	_ = input
    208 	if !ok {
    209 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    210 	}
    211 
    212 	opPath, opQuery := httpbinding.SplitURI("/delete-console-authorization-configuration")
    213 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    214 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    215 	request.Method = "POST"
    216 	var restEncoder *httpbinding.Encoder
    217 	if request.URL.RawPath == "" {
    218 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    219 	} else {
    220 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    221 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    222 	}
    223 
    224 	if err != nil {
    225 		return out, metadata, &smithy.SerializationError{Err: err}
    226 	}
    227 
    228 	restEncoder.SetHeader("Content-Type").String("application/json")
    229 
    230 	jsonEncoder := smithyjson.NewEncoder()
    231 	if err := awsRestjson1_serializeOpDocumentDeleteConsoleAuthorizationConfigurationInput(input, jsonEncoder.Value); err != nil {
    232 		return out, metadata, &smithy.SerializationError{Err: err}
    233 	}
    234 
    235 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    236 		return out, metadata, &smithy.SerializationError{Err: err}
    237 	}
    238 
    239 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    240 		return out, metadata, &smithy.SerializationError{Err: err}
    241 	}
    242 	in.Request = request
    243 
    244 	endTimer()
    245 	span.End()
    246 	return next.HandleSerialize(ctx, in)
    247 }
    248 func awsRestjson1_serializeOpHttpBindingsDeleteConsoleAuthorizationConfigurationInput(v *DeleteConsoleAuthorizationConfigurationInput, encoder *httpbinding.Encoder) error {
    249 	if v == nil {
    250 		return fmt.Errorf("unsupported serialization of nil %T", v)
    251 	}
    252 
    253 	return nil
    254 }
    255 
    256 func awsRestjson1_serializeOpDocumentDeleteConsoleAuthorizationConfigurationInput(v *DeleteConsoleAuthorizationConfigurationInput, value smithyjson.Value) error {
    257 	object := value.Object()
    258 	defer object.Close()
    259 
    260 	if v.TargetId != nil {
    261 		ok := object.Key("targetId")
    262 		ok.String(*v.TargetId)
    263 	}
    264 
    265 	return nil
    266 }
    267 
    268 type awsRestjson1_serializeOpDeleteResourcePermissionStatement struct {
    269 }
    270 
    271 func (*awsRestjson1_serializeOpDeleteResourcePermissionStatement) ID() string {
    272 	return "OperationSerializer"
    273 }
    274 
    275 func (m *awsRestjson1_serializeOpDeleteResourcePermissionStatement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    276 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    277 ) {
    278 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    279 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    280 	defer endTimer()
    281 	defer span.End()
    282 	request, ok := in.Request.(*smithyhttp.Request)
    283 	if !ok {
    284 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    285 	}
    286 
    287 	input, ok := in.Parameters.(*DeleteResourcePermissionStatementInput)
    288 	_ = input
    289 	if !ok {
    290 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    291 	}
    292 
    293 	opPath, opQuery := httpbinding.SplitURI("/delete-resource-permission-statement")
    294 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    295 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    296 	request.Method = "POST"
    297 	var restEncoder *httpbinding.Encoder
    298 	if request.URL.RawPath == "" {
    299 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    300 	} else {
    301 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    302 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    303 	}
    304 
    305 	if err != nil {
    306 		return out, metadata, &smithy.SerializationError{Err: err}
    307 	}
    308 
    309 	restEncoder.SetHeader("Content-Type").String("application/json")
    310 
    311 	jsonEncoder := smithyjson.NewEncoder()
    312 	if err := awsRestjson1_serializeOpDocumentDeleteResourcePermissionStatementInput(input, jsonEncoder.Value); err != nil {
    313 		return out, metadata, &smithy.SerializationError{Err: err}
    314 	}
    315 
    316 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    317 		return out, metadata, &smithy.SerializationError{Err: err}
    318 	}
    319 
    320 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    321 		return out, metadata, &smithy.SerializationError{Err: err}
    322 	}
    323 	in.Request = request
    324 
    325 	endTimer()
    326 	span.End()
    327 	return next.HandleSerialize(ctx, in)
    328 }
    329 func awsRestjson1_serializeOpHttpBindingsDeleteResourcePermissionStatementInput(v *DeleteResourcePermissionStatementInput, encoder *httpbinding.Encoder) error {
    330 	if v == nil {
    331 		return fmt.Errorf("unsupported serialization of nil %T", v)
    332 	}
    333 
    334 	return nil
    335 }
    336 
    337 func awsRestjson1_serializeOpDocumentDeleteResourcePermissionStatementInput(v *DeleteResourcePermissionStatementInput, value smithyjson.Value) error {
    338 	object := value.Object()
    339 	defer object.Close()
    340 
    341 	if v.ClientToken != nil {
    342 		ok := object.Key("clientToken")
    343 		ok.String(*v.ClientToken)
    344 	}
    345 
    346 	if v.StatementId != nil {
    347 		ok := object.Key("statementId")
    348 		ok.String(*v.StatementId)
    349 	}
    350 
    351 	return nil
    352 }
    353 
    354 type awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration struct {
    355 }
    356 
    357 func (*awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration) ID() string {
    358 	return "OperationSerializer"
    359 }
    360 
    361 func (m *awsRestjson1_serializeOpGetConsoleAuthorizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    362 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    363 ) {
    364 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    365 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    366 	defer endTimer()
    367 	defer span.End()
    368 	request, ok := in.Request.(*smithyhttp.Request)
    369 	if !ok {
    370 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    371 	}
    372 
    373 	input, ok := in.Parameters.(*GetConsoleAuthorizationConfigurationInput)
    374 	_ = input
    375 	if !ok {
    376 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    377 	}
    378 
    379 	opPath, opQuery := httpbinding.SplitURI("/get-console-authorization-configuration")
    380 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    381 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    382 	request.Method = "POST"
    383 	var restEncoder *httpbinding.Encoder
    384 	if request.URL.RawPath == "" {
    385 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    386 	} else {
    387 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    388 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    389 	}
    390 
    391 	if err != nil {
    392 		return out, metadata, &smithy.SerializationError{Err: err}
    393 	}
    394 
    395 	restEncoder.SetHeader("Content-Type").String("application/json")
    396 
    397 	jsonEncoder := smithyjson.NewEncoder()
    398 	if err := awsRestjson1_serializeOpDocumentGetConsoleAuthorizationConfigurationInput(input, jsonEncoder.Value); err != nil {
    399 		return out, metadata, &smithy.SerializationError{Err: err}
    400 	}
    401 
    402 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    403 		return out, metadata, &smithy.SerializationError{Err: err}
    404 	}
    405 
    406 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    407 		return out, metadata, &smithy.SerializationError{Err: err}
    408 	}
    409 	in.Request = request
    410 
    411 	endTimer()
    412 	span.End()
    413 	return next.HandleSerialize(ctx, in)
    414 }
    415 func awsRestjson1_serializeOpHttpBindingsGetConsoleAuthorizationConfigurationInput(v *GetConsoleAuthorizationConfigurationInput, encoder *httpbinding.Encoder) error {
    416 	if v == nil {
    417 		return fmt.Errorf("unsupported serialization of nil %T", v)
    418 	}
    419 
    420 	return nil
    421 }
    422 
    423 func awsRestjson1_serializeOpDocumentGetConsoleAuthorizationConfigurationInput(v *GetConsoleAuthorizationConfigurationInput, value smithyjson.Value) error {
    424 	object := value.Object()
    425 	defer object.Close()
    426 
    427 	if v.TargetId != nil {
    428 		ok := object.Key("targetId")
    429 		ok.String(*v.TargetId)
    430 	}
    431 
    432 	return nil
    433 }
    434 
    435 type awsRestjson1_serializeOpGetResourcePolicy struct {
    436 }
    437 
    438 func (*awsRestjson1_serializeOpGetResourcePolicy) ID() string {
    439 	return "OperationSerializer"
    440 }
    441 
    442 func (m *awsRestjson1_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    443 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    444 ) {
    445 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    446 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    447 	defer endTimer()
    448 	defer span.End()
    449 	request, ok := in.Request.(*smithyhttp.Request)
    450 	if !ok {
    451 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    452 	}
    453 
    454 	input, ok := in.Parameters.(*GetResourcePolicyInput)
    455 	_ = input
    456 	if !ok {
    457 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    458 	}
    459 
    460 	opPath, opQuery := httpbinding.SplitURI("/get-resource-policy")
    461 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    462 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    463 	request.Method = "POST"
    464 	var restEncoder *httpbinding.Encoder
    465 	if request.URL.RawPath == "" {
    466 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    467 	} else {
    468 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    469 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    470 	}
    471 
    472 	if err != nil {
    473 		return out, metadata, &smithy.SerializationError{Err: err}
    474 	}
    475 
    476 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    477 		return out, metadata, &smithy.SerializationError{Err: err}
    478 	}
    479 	in.Request = request
    480 
    481 	endTimer()
    482 	span.End()
    483 	return next.HandleSerialize(ctx, in)
    484 }
    485 func awsRestjson1_serializeOpHttpBindingsGetResourcePolicyInput(v *GetResourcePolicyInput, encoder *httpbinding.Encoder) error {
    486 	if v == nil {
    487 		return fmt.Errorf("unsupported serialization of nil %T", v)
    488 	}
    489 
    490 	return nil
    491 }
    492 
    493 type awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM struct {
    494 }
    495 
    496 func (*awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM) ID() string {
    497 	return "OperationSerializer"
    498 }
    499 
    500 func (m *awsRestjson1_serializeOpIntrospectOAuth2TokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    501 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    502 ) {
    503 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    504 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    505 	defer endTimer()
    506 	defer span.End()
    507 	request, ok := in.Request.(*smithyhttp.Request)
    508 	if !ok {
    509 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    510 	}
    511 
    512 	input, ok := in.Parameters.(*IntrospectOAuth2TokenWithIAMInput)
    513 	_ = input
    514 	if !ok {
    515 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    516 	}
    517 
    518 	opPath, opQuery := httpbinding.SplitURI("/v1/introspect?x-amz-client-auth-method=iam")
    519 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    520 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    521 	request.Method = "POST"
    522 	var restEncoder *httpbinding.Encoder
    523 	if request.URL.RawPath == "" {
    524 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    525 	} else {
    526 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    527 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    528 	}
    529 
    530 	if err != nil {
    531 		return out, metadata, &smithy.SerializationError{Err: err}
    532 	}
    533 
    534 	restEncoder.SetHeader("Content-Type").String("application/json")
    535 
    536 	jsonEncoder := smithyjson.NewEncoder()
    537 	if err := awsRestjson1_serializeOpDocumentIntrospectOAuth2TokenWithIAMInput(input, jsonEncoder.Value); err != nil {
    538 		return out, metadata, &smithy.SerializationError{Err: err}
    539 	}
    540 
    541 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    542 		return out, metadata, &smithy.SerializationError{Err: err}
    543 	}
    544 
    545 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    546 		return out, metadata, &smithy.SerializationError{Err: err}
    547 	}
    548 	in.Request = request
    549 
    550 	endTimer()
    551 	span.End()
    552 	return next.HandleSerialize(ctx, in)
    553 }
    554 func awsRestjson1_serializeOpHttpBindingsIntrospectOAuth2TokenWithIAMInput(v *IntrospectOAuth2TokenWithIAMInput, encoder *httpbinding.Encoder) error {
    555 	if v == nil {
    556 		return fmt.Errorf("unsupported serialization of nil %T", v)
    557 	}
    558 
    559 	return nil
    560 }
    561 
    562 func awsRestjson1_serializeOpDocumentIntrospectOAuth2TokenWithIAMInput(v *IntrospectOAuth2TokenWithIAMInput, value smithyjson.Value) error {
    563 	object := value.Object()
    564 	defer object.Close()
    565 
    566 	if v.Token != nil {
    567 		ok := object.Key("token")
    568 		ok.String(*v.Token)
    569 	}
    570 
    571 	if v.TokenTypeHint != nil {
    572 		ok := object.Key("token_type_hint")
    573 		ok.String(*v.TokenTypeHint)
    574 	}
    575 
    576 	return nil
    577 }
    578 
    579 type awsRestjson1_serializeOpListResourcePermissionStatements struct {
    580 }
    581 
    582 func (*awsRestjson1_serializeOpListResourcePermissionStatements) ID() string {
    583 	return "OperationSerializer"
    584 }
    585 
    586 func (m *awsRestjson1_serializeOpListResourcePermissionStatements) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    587 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    588 ) {
    589 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    590 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    591 	defer endTimer()
    592 	defer span.End()
    593 	request, ok := in.Request.(*smithyhttp.Request)
    594 	if !ok {
    595 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    596 	}
    597 
    598 	input, ok := in.Parameters.(*ListResourcePermissionStatementsInput)
    599 	_ = input
    600 	if !ok {
    601 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    602 	}
    603 
    604 	opPath, opQuery := httpbinding.SplitURI("/list-resource-permission-statements")
    605 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    606 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    607 	request.Method = "POST"
    608 	var restEncoder *httpbinding.Encoder
    609 	if request.URL.RawPath == "" {
    610 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    611 	} else {
    612 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    613 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    614 	}
    615 
    616 	if err != nil {
    617 		return out, metadata, &smithy.SerializationError{Err: err}
    618 	}
    619 
    620 	restEncoder.SetHeader("Content-Type").String("application/json")
    621 
    622 	jsonEncoder := smithyjson.NewEncoder()
    623 	if err := awsRestjson1_serializeOpDocumentListResourcePermissionStatementsInput(input, jsonEncoder.Value); err != nil {
    624 		return out, metadata, &smithy.SerializationError{Err: err}
    625 	}
    626 
    627 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    628 		return out, metadata, &smithy.SerializationError{Err: err}
    629 	}
    630 
    631 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    632 		return out, metadata, &smithy.SerializationError{Err: err}
    633 	}
    634 	in.Request = request
    635 
    636 	endTimer()
    637 	span.End()
    638 	return next.HandleSerialize(ctx, in)
    639 }
    640 func awsRestjson1_serializeOpHttpBindingsListResourcePermissionStatementsInput(v *ListResourcePermissionStatementsInput, encoder *httpbinding.Encoder) error {
    641 	if v == nil {
    642 		return fmt.Errorf("unsupported serialization of nil %T", v)
    643 	}
    644 
    645 	return nil
    646 }
    647 
    648 func awsRestjson1_serializeOpDocumentListResourcePermissionStatementsInput(v *ListResourcePermissionStatementsInput, value smithyjson.Value) error {
    649 	object := value.Object()
    650 	defer object.Close()
    651 
    652 	if v.MaxResults != nil {
    653 		ok := object.Key("maxResults")
    654 		ok.Integer(*v.MaxResults)
    655 	}
    656 
    657 	if v.NextToken != nil {
    658 		ok := object.Key("nextToken")
    659 		ok.String(*v.NextToken)
    660 	}
    661 
    662 	return nil
    663 }
    664 
    665 type awsRestjson1_serializeOpPutConsoleAuthorizationConfiguration struct {
    666 }
    667 
    668 func (*awsRestjson1_serializeOpPutConsoleAuthorizationConfiguration) ID() string {
    669 	return "OperationSerializer"
    670 }
    671 
    672 func (m *awsRestjson1_serializeOpPutConsoleAuthorizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    673 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    674 ) {
    675 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    676 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    677 	defer endTimer()
    678 	defer span.End()
    679 	request, ok := in.Request.(*smithyhttp.Request)
    680 	if !ok {
    681 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    682 	}
    683 
    684 	input, ok := in.Parameters.(*PutConsoleAuthorizationConfigurationInput)
    685 	_ = input
    686 	if !ok {
    687 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    688 	}
    689 
    690 	opPath, opQuery := httpbinding.SplitURI("/put-console-authorization-configuration")
    691 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    692 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    693 	request.Method = "POST"
    694 	var restEncoder *httpbinding.Encoder
    695 	if request.URL.RawPath == "" {
    696 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    697 	} else {
    698 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    699 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    700 	}
    701 
    702 	if err != nil {
    703 		return out, metadata, &smithy.SerializationError{Err: err}
    704 	}
    705 
    706 	restEncoder.SetHeader("Content-Type").String("application/json")
    707 
    708 	jsonEncoder := smithyjson.NewEncoder()
    709 	if err := awsRestjson1_serializeOpDocumentPutConsoleAuthorizationConfigurationInput(input, jsonEncoder.Value); err != nil {
    710 		return out, metadata, &smithy.SerializationError{Err: err}
    711 	}
    712 
    713 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    714 		return out, metadata, &smithy.SerializationError{Err: err}
    715 	}
    716 
    717 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    718 		return out, metadata, &smithy.SerializationError{Err: err}
    719 	}
    720 	in.Request = request
    721 
    722 	endTimer()
    723 	span.End()
    724 	return next.HandleSerialize(ctx, in)
    725 }
    726 func awsRestjson1_serializeOpHttpBindingsPutConsoleAuthorizationConfigurationInput(v *PutConsoleAuthorizationConfigurationInput, encoder *httpbinding.Encoder) error {
    727 	if v == nil {
    728 		return fmt.Errorf("unsupported serialization of nil %T", v)
    729 	}
    730 
    731 	return nil
    732 }
    733 
    734 func awsRestjson1_serializeOpDocumentPutConsoleAuthorizationConfigurationInput(v *PutConsoleAuthorizationConfigurationInput, value smithyjson.Value) error {
    735 	object := value.Object()
    736 	defer object.Close()
    737 
    738 	if v.TargetId != nil {
    739 		ok := object.Key("targetId")
    740 		ok.String(*v.TargetId)
    741 	}
    742 
    743 	return nil
    744 }
    745 
    746 type awsRestjson1_serializeOpPutResourcePermissionStatement struct {
    747 }
    748 
    749 func (*awsRestjson1_serializeOpPutResourcePermissionStatement) ID() string {
    750 	return "OperationSerializer"
    751 }
    752 
    753 func (m *awsRestjson1_serializeOpPutResourcePermissionStatement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    754 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    755 ) {
    756 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    757 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    758 	defer endTimer()
    759 	defer span.End()
    760 	request, ok := in.Request.(*smithyhttp.Request)
    761 	if !ok {
    762 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    763 	}
    764 
    765 	input, ok := in.Parameters.(*PutResourcePermissionStatementInput)
    766 	_ = input
    767 	if !ok {
    768 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    769 	}
    770 
    771 	opPath, opQuery := httpbinding.SplitURI("/put-resource-permission-statement")
    772 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    773 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    774 	request.Method = "POST"
    775 	var restEncoder *httpbinding.Encoder
    776 	if request.URL.RawPath == "" {
    777 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    778 	} else {
    779 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    780 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    781 	}
    782 
    783 	if err != nil {
    784 		return out, metadata, &smithy.SerializationError{Err: err}
    785 	}
    786 
    787 	restEncoder.SetHeader("Content-Type").String("application/json")
    788 
    789 	jsonEncoder := smithyjson.NewEncoder()
    790 	if err := awsRestjson1_serializeOpDocumentPutResourcePermissionStatementInput(input, jsonEncoder.Value); err != nil {
    791 		return out, metadata, &smithy.SerializationError{Err: err}
    792 	}
    793 
    794 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    795 		return out, metadata, &smithy.SerializationError{Err: err}
    796 	}
    797 
    798 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    799 		return out, metadata, &smithy.SerializationError{Err: err}
    800 	}
    801 	in.Request = request
    802 
    803 	endTimer()
    804 	span.End()
    805 	return next.HandleSerialize(ctx, in)
    806 }
    807 func awsRestjson1_serializeOpHttpBindingsPutResourcePermissionStatementInput(v *PutResourcePermissionStatementInput, encoder *httpbinding.Encoder) error {
    808 	if v == nil {
    809 		return fmt.Errorf("unsupported serialization of nil %T", v)
    810 	}
    811 
    812 	return nil
    813 }
    814 
    815 func awsRestjson1_serializeOpDocumentPutResourcePermissionStatementInput(v *PutResourcePermissionStatementInput, value smithyjson.Value) error {
    816 	object := value.Object()
    817 	defer object.Close()
    818 
    819 	if v.ClientToken != nil {
    820 		ok := object.Key("clientToken")
    821 		ok.String(*v.ClientToken)
    822 	}
    823 
    824 	if v.ConsoleSourceVpce != nil {
    825 		ok := object.Key("consoleSourceVpce")
    826 		ok.String(*v.ConsoleSourceVpce)
    827 	}
    828 
    829 	if v.ExcludedPrincipal != nil {
    830 		ok := object.Key("excludedPrincipal")
    831 		ok.String(*v.ExcludedPrincipal)
    832 	}
    833 
    834 	if v.RequestedRegion != nil {
    835 		ok := object.Key("requestedRegion")
    836 		ok.String(*v.RequestedRegion)
    837 	}
    838 
    839 	if v.SigninSourceVpce != nil {
    840 		ok := object.Key("signinSourceVpce")
    841 		ok.String(*v.SigninSourceVpce)
    842 	}
    843 
    844 	if v.SourceIp != nil {
    845 		ok := object.Key("sourceIp")
    846 		ok.String(*v.SourceIp)
    847 	}
    848 
    849 	if v.SourceVpc != nil {
    850 		ok := object.Key("sourceVpc")
    851 		ok.String(*v.SourceVpc)
    852 	}
    853 
    854 	if v.VpcSourceIp != nil {
    855 		ok := object.Key("vpcSourceIp")
    856 		ok.String(*v.VpcSourceIp)
    857 	}
    858 
    859 	return nil
    860 }
    861 
    862 type awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM struct {
    863 }
    864 
    865 func (*awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM) ID() string {
    866 	return "OperationSerializer"
    867 }
    868 
    869 func (m *awsRestjson1_serializeOpRevokeOAuth2TokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
    870 	out middleware.SerializeOutput, metadata middleware.Metadata, err error,
    871 ) {
    872 	_, span := tracing.StartSpan(ctx, "OperationSerializer")
    873 	endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
    874 	defer endTimer()
    875 	defer span.End()
    876 	request, ok := in.Request.(*smithyhttp.Request)
    877 	if !ok {
    878 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
    879 	}
    880 
    881 	input, ok := in.Parameters.(*RevokeOAuth2TokenWithIAMInput)
    882 	_ = input
    883 	if !ok {
    884 		return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
    885 	}
    886 
    887 	opPath, opQuery := httpbinding.SplitURI("/v1/revoke?x-amz-client-auth-method=iam")
    888 	request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
    889 	request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
    890 	request.Method = "POST"
    891 	var restEncoder *httpbinding.Encoder
    892 	if request.URL.RawPath == "" {
    893 		restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
    894 	} else {
    895 		request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
    896 		restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
    897 	}
    898 
    899 	if err != nil {
    900 		return out, metadata, &smithy.SerializationError{Err: err}
    901 	}
    902 
    903 	restEncoder.SetHeader("Content-Type").String("application/json")
    904 
    905 	jsonEncoder := smithyjson.NewEncoder()
    906 	if err := awsRestjson1_serializeOpDocumentRevokeOAuth2TokenWithIAMInput(input, jsonEncoder.Value); err != nil {
    907 		return out, metadata, &smithy.SerializationError{Err: err}
    908 	}
    909 
    910 	if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
    911 		return out, metadata, &smithy.SerializationError{Err: err}
    912 	}
    913 
    914 	if request.Request, err = restEncoder.Encode(request.Request); err != nil {
    915 		return out, metadata, &smithy.SerializationError{Err: err}
    916 	}
    917 	in.Request = request
    918 
    919 	endTimer()
    920 	span.End()
    921 	return next.HandleSerialize(ctx, in)
    922 }
    923 func awsRestjson1_serializeOpHttpBindingsRevokeOAuth2TokenWithIAMInput(v *RevokeOAuth2TokenWithIAMInput, encoder *httpbinding.Encoder) error {
    924 	if v == nil {
    925 		return fmt.Errorf("unsupported serialization of nil %T", v)
    926 	}
    927 
    928 	return nil
    929 }
    930 
    931 func awsRestjson1_serializeOpDocumentRevokeOAuth2TokenWithIAMInput(v *RevokeOAuth2TokenWithIAMInput, value smithyjson.Value) error {
    932 	object := value.Object()
    933 	defer object.Close()
    934 
    935 	if v.Token != nil {
    936 		ok := object.Key("token")
    937 		ok.String(*v.Token)
    938 	}
    939 
    940 	return nil
    941 }
    942 
    943 func awsRestjson1_serializeDocumentCreateOAuth2TokenRequestBody(v *types.CreateOAuth2TokenRequestBody, value smithyjson.Value) error {
    944 	object := value.Object()
    945 	defer object.Close()
    946 
    947 	if v.ClientId != nil {
    948 		ok := object.Key("clientId")
    949 		ok.String(*v.ClientId)
    950 	}
    951 
    952 	if v.Code != nil {
    953 		ok := object.Key("code")
    954 		ok.String(*v.Code)
    955 	}
    956 
    957 	if v.CodeVerifier != nil {
    958 		ok := object.Key("codeVerifier")
    959 		ok.String(*v.CodeVerifier)
    960 	}
    961 
    962 	if v.GrantType != nil {
    963 		ok := object.Key("grantType")
    964 		ok.String(*v.GrantType)
    965 	}
    966 
    967 	if v.RedirectUri != nil {
    968 		ok := object.Key("redirectUri")
    969 		ok.String(*v.RedirectUri)
    970 	}
    971 
    972 	if v.RefreshToken != nil {
    973 		ok := object.Key("refreshToken")
    974 		ok.String(*v.RefreshToken)
    975 	}
    976 
    977 	return nil
    978 }