1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package lexmodelbuildingservice 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types" 10 smithy "github.com/aws/smithy-go" 11 "github.com/aws/smithy-go/encoding/httpbinding" 12 smithyjson "github.com/aws/smithy-go/encoding/json" 13 "github.com/aws/smithy-go/middleware" 14 smithyhttp "github.com/aws/smithy-go/transport/http" 15) 16 17type awsRestjson1_serializeOpCreateBotVersion struct { 18} 19 20func (*awsRestjson1_serializeOpCreateBotVersion) ID() string { 21 return "OperationSerializer" 22} 23 24func (m *awsRestjson1_serializeOpCreateBotVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 25 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 26) { 27 request, ok := in.Request.(*smithyhttp.Request) 28 if !ok { 29 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 30 } 31 32 input, ok := in.Parameters.(*CreateBotVersionInput) 33 _ = input 34 if !ok { 35 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 36 } 37 38 opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions") 39 request.URL.Path = opPath 40 if len(request.URL.RawQuery) > 0 { 41 request.URL.RawQuery = "&" + opQuery 42 } else { 43 request.URL.RawQuery = opQuery 44 } 45 46 request.Method = "POST" 47 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 48 if err != nil { 49 return out, metadata, &smithy.SerializationError{Err: err} 50 } 51 52 if err := awsRestjson1_serializeOpHttpBindingsCreateBotVersionInput(input, restEncoder); err != nil { 53 return out, metadata, &smithy.SerializationError{Err: err} 54 } 55 56 restEncoder.SetHeader("Content-Type").String("application/json") 57 58 jsonEncoder := smithyjson.NewEncoder() 59 if err := awsRestjson1_serializeOpDocumentCreateBotVersionInput(input, jsonEncoder.Value); err != nil { 60 return out, metadata, &smithy.SerializationError{Err: err} 61 } 62 63 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 64 return out, metadata, &smithy.SerializationError{Err: err} 65 } 66 67 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 68 return out, metadata, &smithy.SerializationError{Err: err} 69 } 70 in.Request = request 71 72 return next.HandleSerialize(ctx, in) 73} 74func awsRestjson1_serializeOpHttpBindingsCreateBotVersionInput(v *CreateBotVersionInput, encoder *httpbinding.Encoder) error { 75 if v == nil { 76 return fmt.Errorf("unsupported serialization of nil %T", v) 77 } 78 79 if v.Name == nil || len(*v.Name) == 0 { 80 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 81 } 82 if v.Name != nil { 83 if err := encoder.SetURI("name").String(*v.Name); err != nil { 84 return err 85 } 86 } 87 88 return nil 89} 90 91func awsRestjson1_serializeOpDocumentCreateBotVersionInput(v *CreateBotVersionInput, value smithyjson.Value) error { 92 object := value.Object() 93 defer object.Close() 94 95 if v.Checksum != nil { 96 ok := object.Key("checksum") 97 ok.String(*v.Checksum) 98 } 99 100 return nil 101} 102 103type awsRestjson1_serializeOpCreateIntentVersion struct { 104} 105 106func (*awsRestjson1_serializeOpCreateIntentVersion) ID() string { 107 return "OperationSerializer" 108} 109 110func (m *awsRestjson1_serializeOpCreateIntentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 111 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 112) { 113 request, ok := in.Request.(*smithyhttp.Request) 114 if !ok { 115 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 116 } 117 118 input, ok := in.Parameters.(*CreateIntentVersionInput) 119 _ = input 120 if !ok { 121 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 122 } 123 124 opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions") 125 request.URL.Path = opPath 126 if len(request.URL.RawQuery) > 0 { 127 request.URL.RawQuery = "&" + opQuery 128 } else { 129 request.URL.RawQuery = opQuery 130 } 131 132 request.Method = "POST" 133 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 134 if err != nil { 135 return out, metadata, &smithy.SerializationError{Err: err} 136 } 137 138 if err := awsRestjson1_serializeOpHttpBindingsCreateIntentVersionInput(input, restEncoder); 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_serializeOpDocumentCreateIntentVersionInput(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 return next.HandleSerialize(ctx, in) 159} 160func awsRestjson1_serializeOpHttpBindingsCreateIntentVersionInput(v *CreateIntentVersionInput, encoder *httpbinding.Encoder) error { 161 if v == nil { 162 return fmt.Errorf("unsupported serialization of nil %T", v) 163 } 164 165 if v.Name == nil || len(*v.Name) == 0 { 166 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 167 } 168 if v.Name != nil { 169 if err := encoder.SetURI("name").String(*v.Name); err != nil { 170 return err 171 } 172 } 173 174 return nil 175} 176 177func awsRestjson1_serializeOpDocumentCreateIntentVersionInput(v *CreateIntentVersionInput, value smithyjson.Value) error { 178 object := value.Object() 179 defer object.Close() 180 181 if v.Checksum != nil { 182 ok := object.Key("checksum") 183 ok.String(*v.Checksum) 184 } 185 186 return nil 187} 188 189type awsRestjson1_serializeOpCreateSlotTypeVersion struct { 190} 191 192func (*awsRestjson1_serializeOpCreateSlotTypeVersion) ID() string { 193 return "OperationSerializer" 194} 195 196func (m *awsRestjson1_serializeOpCreateSlotTypeVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 197 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 198) { 199 request, ok := in.Request.(*smithyhttp.Request) 200 if !ok { 201 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 202 } 203 204 input, ok := in.Parameters.(*CreateSlotTypeVersionInput) 205 _ = input 206 if !ok { 207 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 208 } 209 210 opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions") 211 request.URL.Path = opPath 212 if len(request.URL.RawQuery) > 0 { 213 request.URL.RawQuery = "&" + opQuery 214 } else { 215 request.URL.RawQuery = opQuery 216 } 217 218 request.Method = "POST" 219 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 220 if err != nil { 221 return out, metadata, &smithy.SerializationError{Err: err} 222 } 223 224 if err := awsRestjson1_serializeOpHttpBindingsCreateSlotTypeVersionInput(input, restEncoder); 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_serializeOpDocumentCreateSlotTypeVersionInput(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 return next.HandleSerialize(ctx, in) 245} 246func awsRestjson1_serializeOpHttpBindingsCreateSlotTypeVersionInput(v *CreateSlotTypeVersionInput, encoder *httpbinding.Encoder) error { 247 if v == nil { 248 return fmt.Errorf("unsupported serialization of nil %T", v) 249 } 250 251 if v.Name == nil || len(*v.Name) == 0 { 252 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 253 } 254 if v.Name != nil { 255 if err := encoder.SetURI("name").String(*v.Name); err != nil { 256 return err 257 } 258 } 259 260 return nil 261} 262 263func awsRestjson1_serializeOpDocumentCreateSlotTypeVersionInput(v *CreateSlotTypeVersionInput, value smithyjson.Value) error { 264 object := value.Object() 265 defer object.Close() 266 267 if v.Checksum != nil { 268 ok := object.Key("checksum") 269 ok.String(*v.Checksum) 270 } 271 272 return nil 273} 274 275type awsRestjson1_serializeOpDeleteBot struct { 276} 277 278func (*awsRestjson1_serializeOpDeleteBot) ID() string { 279 return "OperationSerializer" 280} 281 282func (m *awsRestjson1_serializeOpDeleteBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 283 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 284) { 285 request, ok := in.Request.(*smithyhttp.Request) 286 if !ok { 287 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 288 } 289 290 input, ok := in.Parameters.(*DeleteBotInput) 291 _ = input 292 if !ok { 293 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 294 } 295 296 opPath, opQuery := httpbinding.SplitURI("/bots/{name}") 297 request.URL.Path = opPath 298 if len(request.URL.RawQuery) > 0 { 299 request.URL.RawQuery = "&" + opQuery 300 } else { 301 request.URL.RawQuery = opQuery 302 } 303 304 request.Method = "DELETE" 305 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 306 if err != nil { 307 return out, metadata, &smithy.SerializationError{Err: err} 308 } 309 310 if err := awsRestjson1_serializeOpHttpBindingsDeleteBotInput(input, restEncoder); err != nil { 311 return out, metadata, &smithy.SerializationError{Err: err} 312 } 313 314 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 315 return out, metadata, &smithy.SerializationError{Err: err} 316 } 317 in.Request = request 318 319 return next.HandleSerialize(ctx, in) 320} 321func awsRestjson1_serializeOpHttpBindingsDeleteBotInput(v *DeleteBotInput, encoder *httpbinding.Encoder) error { 322 if v == nil { 323 return fmt.Errorf("unsupported serialization of nil %T", v) 324 } 325 326 if v.Name == nil || len(*v.Name) == 0 { 327 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 328 } 329 if v.Name != nil { 330 if err := encoder.SetURI("name").String(*v.Name); err != nil { 331 return err 332 } 333 } 334 335 return nil 336} 337 338type awsRestjson1_serializeOpDeleteBotAlias struct { 339} 340 341func (*awsRestjson1_serializeOpDeleteBotAlias) ID() string { 342 return "OperationSerializer" 343} 344 345func (m *awsRestjson1_serializeOpDeleteBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 346 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 347) { 348 request, ok := in.Request.(*smithyhttp.Request) 349 if !ok { 350 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 351 } 352 353 input, ok := in.Parameters.(*DeleteBotAliasInput) 354 _ = input 355 if !ok { 356 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 357 } 358 359 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{name}") 360 request.URL.Path = opPath 361 if len(request.URL.RawQuery) > 0 { 362 request.URL.RawQuery = "&" + opQuery 363 } else { 364 request.URL.RawQuery = opQuery 365 } 366 367 request.Method = "DELETE" 368 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 369 if err != nil { 370 return out, metadata, &smithy.SerializationError{Err: err} 371 } 372 373 if err := awsRestjson1_serializeOpHttpBindingsDeleteBotAliasInput(input, restEncoder); err != nil { 374 return out, metadata, &smithy.SerializationError{Err: err} 375 } 376 377 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 378 return out, metadata, &smithy.SerializationError{Err: err} 379 } 380 in.Request = request 381 382 return next.HandleSerialize(ctx, in) 383} 384func awsRestjson1_serializeOpHttpBindingsDeleteBotAliasInput(v *DeleteBotAliasInput, encoder *httpbinding.Encoder) error { 385 if v == nil { 386 return fmt.Errorf("unsupported serialization of nil %T", v) 387 } 388 389 if v.BotName == nil || len(*v.BotName) == 0 { 390 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 391 } 392 if v.BotName != nil { 393 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 394 return err 395 } 396 } 397 398 if v.Name == nil || len(*v.Name) == 0 { 399 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 400 } 401 if v.Name != nil { 402 if err := encoder.SetURI("name").String(*v.Name); err != nil { 403 return err 404 } 405 } 406 407 return nil 408} 409 410type awsRestjson1_serializeOpDeleteBotChannelAssociation struct { 411} 412 413func (*awsRestjson1_serializeOpDeleteBotChannelAssociation) ID() string { 414 return "OperationSerializer" 415} 416 417func (m *awsRestjson1_serializeOpDeleteBotChannelAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 418 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 419) { 420 request, ok := in.Request.(*smithyhttp.Request) 421 if !ok { 422 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 423 } 424 425 input, ok := in.Parameters.(*DeleteBotChannelAssociationInput) 426 _ = input 427 if !ok { 428 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 429 } 430 431 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{botAlias}/channels/{name}") 432 request.URL.Path = opPath 433 if len(request.URL.RawQuery) > 0 { 434 request.URL.RawQuery = "&" + opQuery 435 } else { 436 request.URL.RawQuery = opQuery 437 } 438 439 request.Method = "DELETE" 440 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 441 if err != nil { 442 return out, metadata, &smithy.SerializationError{Err: err} 443 } 444 445 if err := awsRestjson1_serializeOpHttpBindingsDeleteBotChannelAssociationInput(input, restEncoder); err != nil { 446 return out, metadata, &smithy.SerializationError{Err: err} 447 } 448 449 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 450 return out, metadata, &smithy.SerializationError{Err: err} 451 } 452 in.Request = request 453 454 return next.HandleSerialize(ctx, in) 455} 456func awsRestjson1_serializeOpHttpBindingsDeleteBotChannelAssociationInput(v *DeleteBotChannelAssociationInput, encoder *httpbinding.Encoder) error { 457 if v == nil { 458 return fmt.Errorf("unsupported serialization of nil %T", v) 459 } 460 461 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 462 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 463 } 464 if v.BotAlias != nil { 465 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 466 return err 467 } 468 } 469 470 if v.BotName == nil || len(*v.BotName) == 0 { 471 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 472 } 473 if v.BotName != nil { 474 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 475 return err 476 } 477 } 478 479 if v.Name == nil || len(*v.Name) == 0 { 480 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 481 } 482 if v.Name != nil { 483 if err := encoder.SetURI("name").String(*v.Name); err != nil { 484 return err 485 } 486 } 487 488 return nil 489} 490 491type awsRestjson1_serializeOpDeleteBotVersion struct { 492} 493 494func (*awsRestjson1_serializeOpDeleteBotVersion) ID() string { 495 return "OperationSerializer" 496} 497 498func (m *awsRestjson1_serializeOpDeleteBotVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 499 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 500) { 501 request, ok := in.Request.(*smithyhttp.Request) 502 if !ok { 503 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 504 } 505 506 input, ok := in.Parameters.(*DeleteBotVersionInput) 507 _ = input 508 if !ok { 509 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 510 } 511 512 opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions/{version}") 513 request.URL.Path = opPath 514 if len(request.URL.RawQuery) > 0 { 515 request.URL.RawQuery = "&" + opQuery 516 } else { 517 request.URL.RawQuery = opQuery 518 } 519 520 request.Method = "DELETE" 521 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 522 if err != nil { 523 return out, metadata, &smithy.SerializationError{Err: err} 524 } 525 526 if err := awsRestjson1_serializeOpHttpBindingsDeleteBotVersionInput(input, restEncoder); err != nil { 527 return out, metadata, &smithy.SerializationError{Err: err} 528 } 529 530 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 531 return out, metadata, &smithy.SerializationError{Err: err} 532 } 533 in.Request = request 534 535 return next.HandleSerialize(ctx, in) 536} 537func awsRestjson1_serializeOpHttpBindingsDeleteBotVersionInput(v *DeleteBotVersionInput, encoder *httpbinding.Encoder) error { 538 if v == nil { 539 return fmt.Errorf("unsupported serialization of nil %T", v) 540 } 541 542 if v.Name == nil || len(*v.Name) == 0 { 543 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 544 } 545 if v.Name != nil { 546 if err := encoder.SetURI("name").String(*v.Name); err != nil { 547 return err 548 } 549 } 550 551 if v.Version == nil || len(*v.Version) == 0 { 552 return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")} 553 } 554 if v.Version != nil { 555 if err := encoder.SetURI("version").String(*v.Version); err != nil { 556 return err 557 } 558 } 559 560 return nil 561} 562 563type awsRestjson1_serializeOpDeleteIntent struct { 564} 565 566func (*awsRestjson1_serializeOpDeleteIntent) ID() string { 567 return "OperationSerializer" 568} 569 570func (m *awsRestjson1_serializeOpDeleteIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 571 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 572) { 573 request, ok := in.Request.(*smithyhttp.Request) 574 if !ok { 575 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 576 } 577 578 input, ok := in.Parameters.(*DeleteIntentInput) 579 _ = input 580 if !ok { 581 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 582 } 583 584 opPath, opQuery := httpbinding.SplitURI("/intents/{name}") 585 request.URL.Path = opPath 586 if len(request.URL.RawQuery) > 0 { 587 request.URL.RawQuery = "&" + opQuery 588 } else { 589 request.URL.RawQuery = opQuery 590 } 591 592 request.Method = "DELETE" 593 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 594 if err != nil { 595 return out, metadata, &smithy.SerializationError{Err: err} 596 } 597 598 if err := awsRestjson1_serializeOpHttpBindingsDeleteIntentInput(input, restEncoder); err != nil { 599 return out, metadata, &smithy.SerializationError{Err: err} 600 } 601 602 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 603 return out, metadata, &smithy.SerializationError{Err: err} 604 } 605 in.Request = request 606 607 return next.HandleSerialize(ctx, in) 608} 609func awsRestjson1_serializeOpHttpBindingsDeleteIntentInput(v *DeleteIntentInput, encoder *httpbinding.Encoder) error { 610 if v == nil { 611 return fmt.Errorf("unsupported serialization of nil %T", v) 612 } 613 614 if v.Name == nil || len(*v.Name) == 0 { 615 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 616 } 617 if v.Name != nil { 618 if err := encoder.SetURI("name").String(*v.Name); err != nil { 619 return err 620 } 621 } 622 623 return nil 624} 625 626type awsRestjson1_serializeOpDeleteIntentVersion struct { 627} 628 629func (*awsRestjson1_serializeOpDeleteIntentVersion) ID() string { 630 return "OperationSerializer" 631} 632 633func (m *awsRestjson1_serializeOpDeleteIntentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 634 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 635) { 636 request, ok := in.Request.(*smithyhttp.Request) 637 if !ok { 638 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 639 } 640 641 input, ok := in.Parameters.(*DeleteIntentVersionInput) 642 _ = input 643 if !ok { 644 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 645 } 646 647 opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions/{version}") 648 request.URL.Path = opPath 649 if len(request.URL.RawQuery) > 0 { 650 request.URL.RawQuery = "&" + opQuery 651 } else { 652 request.URL.RawQuery = opQuery 653 } 654 655 request.Method = "DELETE" 656 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 657 if err != nil { 658 return out, metadata, &smithy.SerializationError{Err: err} 659 } 660 661 if err := awsRestjson1_serializeOpHttpBindingsDeleteIntentVersionInput(input, restEncoder); err != nil { 662 return out, metadata, &smithy.SerializationError{Err: err} 663 } 664 665 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 666 return out, metadata, &smithy.SerializationError{Err: err} 667 } 668 in.Request = request 669 670 return next.HandleSerialize(ctx, in) 671} 672func awsRestjson1_serializeOpHttpBindingsDeleteIntentVersionInput(v *DeleteIntentVersionInput, encoder *httpbinding.Encoder) error { 673 if v == nil { 674 return fmt.Errorf("unsupported serialization of nil %T", v) 675 } 676 677 if v.Name == nil || len(*v.Name) == 0 { 678 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 679 } 680 if v.Name != nil { 681 if err := encoder.SetURI("name").String(*v.Name); err != nil { 682 return err 683 } 684 } 685 686 if v.Version == nil || len(*v.Version) == 0 { 687 return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")} 688 } 689 if v.Version != nil { 690 if err := encoder.SetURI("version").String(*v.Version); err != nil { 691 return err 692 } 693 } 694 695 return nil 696} 697 698type awsRestjson1_serializeOpDeleteSlotType struct { 699} 700 701func (*awsRestjson1_serializeOpDeleteSlotType) ID() string { 702 return "OperationSerializer" 703} 704 705func (m *awsRestjson1_serializeOpDeleteSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 706 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 707) { 708 request, ok := in.Request.(*smithyhttp.Request) 709 if !ok { 710 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 711 } 712 713 input, ok := in.Parameters.(*DeleteSlotTypeInput) 714 _ = input 715 if !ok { 716 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 717 } 718 719 opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}") 720 request.URL.Path = opPath 721 if len(request.URL.RawQuery) > 0 { 722 request.URL.RawQuery = "&" + opQuery 723 } else { 724 request.URL.RawQuery = opQuery 725 } 726 727 request.Method = "DELETE" 728 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 729 if err != nil { 730 return out, metadata, &smithy.SerializationError{Err: err} 731 } 732 733 if err := awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeInput(input, restEncoder); err != nil { 734 return out, metadata, &smithy.SerializationError{Err: err} 735 } 736 737 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 738 return out, metadata, &smithy.SerializationError{Err: err} 739 } 740 in.Request = request 741 742 return next.HandleSerialize(ctx, in) 743} 744func awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeInput(v *DeleteSlotTypeInput, encoder *httpbinding.Encoder) error { 745 if v == nil { 746 return fmt.Errorf("unsupported serialization of nil %T", v) 747 } 748 749 if v.Name == nil || len(*v.Name) == 0 { 750 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 751 } 752 if v.Name != nil { 753 if err := encoder.SetURI("name").String(*v.Name); err != nil { 754 return err 755 } 756 } 757 758 return nil 759} 760 761type awsRestjson1_serializeOpDeleteSlotTypeVersion struct { 762} 763 764func (*awsRestjson1_serializeOpDeleteSlotTypeVersion) ID() string { 765 return "OperationSerializer" 766} 767 768func (m *awsRestjson1_serializeOpDeleteSlotTypeVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 769 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 770) { 771 request, ok := in.Request.(*smithyhttp.Request) 772 if !ok { 773 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 774 } 775 776 input, ok := in.Parameters.(*DeleteSlotTypeVersionInput) 777 _ = input 778 if !ok { 779 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 780 } 781 782 opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/version/{version}") 783 request.URL.Path = opPath 784 if len(request.URL.RawQuery) > 0 { 785 request.URL.RawQuery = "&" + opQuery 786 } else { 787 request.URL.RawQuery = opQuery 788 } 789 790 request.Method = "DELETE" 791 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 792 if err != nil { 793 return out, metadata, &smithy.SerializationError{Err: err} 794 } 795 796 if err := awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeVersionInput(input, restEncoder); err != nil { 797 return out, metadata, &smithy.SerializationError{Err: err} 798 } 799 800 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 801 return out, metadata, &smithy.SerializationError{Err: err} 802 } 803 in.Request = request 804 805 return next.HandleSerialize(ctx, in) 806} 807func awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeVersionInput(v *DeleteSlotTypeVersionInput, encoder *httpbinding.Encoder) error { 808 if v == nil { 809 return fmt.Errorf("unsupported serialization of nil %T", v) 810 } 811 812 if v.Name == nil || len(*v.Name) == 0 { 813 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 814 } 815 if v.Name != nil { 816 if err := encoder.SetURI("name").String(*v.Name); err != nil { 817 return err 818 } 819 } 820 821 if v.Version == nil || len(*v.Version) == 0 { 822 return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")} 823 } 824 if v.Version != nil { 825 if err := encoder.SetURI("version").String(*v.Version); err != nil { 826 return err 827 } 828 } 829 830 return nil 831} 832 833type awsRestjson1_serializeOpDeleteUtterances struct { 834} 835 836func (*awsRestjson1_serializeOpDeleteUtterances) ID() string { 837 return "OperationSerializer" 838} 839 840func (m *awsRestjson1_serializeOpDeleteUtterances) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 841 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 842) { 843 request, ok := in.Request.(*smithyhttp.Request) 844 if !ok { 845 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 846 } 847 848 input, ok := in.Parameters.(*DeleteUtterancesInput) 849 _ = input 850 if !ok { 851 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 852 } 853 854 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/utterances/{userId}") 855 request.URL.Path = opPath 856 if len(request.URL.RawQuery) > 0 { 857 request.URL.RawQuery = "&" + opQuery 858 } else { 859 request.URL.RawQuery = opQuery 860 } 861 862 request.Method = "DELETE" 863 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 864 if err != nil { 865 return out, metadata, &smithy.SerializationError{Err: err} 866 } 867 868 if err := awsRestjson1_serializeOpHttpBindingsDeleteUtterancesInput(input, restEncoder); err != nil { 869 return out, metadata, &smithy.SerializationError{Err: err} 870 } 871 872 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 873 return out, metadata, &smithy.SerializationError{Err: err} 874 } 875 in.Request = request 876 877 return next.HandleSerialize(ctx, in) 878} 879func awsRestjson1_serializeOpHttpBindingsDeleteUtterancesInput(v *DeleteUtterancesInput, encoder *httpbinding.Encoder) error { 880 if v == nil { 881 return fmt.Errorf("unsupported serialization of nil %T", v) 882 } 883 884 if v.BotName == nil || len(*v.BotName) == 0 { 885 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 886 } 887 if v.BotName != nil { 888 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 889 return err 890 } 891 } 892 893 if v.UserId == nil || len(*v.UserId) == 0 { 894 return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")} 895 } 896 if v.UserId != nil { 897 if err := encoder.SetURI("userId").String(*v.UserId); err != nil { 898 return err 899 } 900 } 901 902 return nil 903} 904 905type awsRestjson1_serializeOpGetBot struct { 906} 907 908func (*awsRestjson1_serializeOpGetBot) ID() string { 909 return "OperationSerializer" 910} 911 912func (m *awsRestjson1_serializeOpGetBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 913 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 914) { 915 request, ok := in.Request.(*smithyhttp.Request) 916 if !ok { 917 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 918 } 919 920 input, ok := in.Parameters.(*GetBotInput) 921 _ = input 922 if !ok { 923 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 924 } 925 926 opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions/{versionOrAlias}") 927 request.URL.Path = opPath 928 if len(request.URL.RawQuery) > 0 { 929 request.URL.RawQuery = "&" + opQuery 930 } else { 931 request.URL.RawQuery = opQuery 932 } 933 934 request.Method = "GET" 935 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 936 if err != nil { 937 return out, metadata, &smithy.SerializationError{Err: err} 938 } 939 940 if err := awsRestjson1_serializeOpHttpBindingsGetBotInput(input, restEncoder); err != nil { 941 return out, metadata, &smithy.SerializationError{Err: err} 942 } 943 944 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 945 return out, metadata, &smithy.SerializationError{Err: err} 946 } 947 in.Request = request 948 949 return next.HandleSerialize(ctx, in) 950} 951func awsRestjson1_serializeOpHttpBindingsGetBotInput(v *GetBotInput, encoder *httpbinding.Encoder) error { 952 if v == nil { 953 return fmt.Errorf("unsupported serialization of nil %T", v) 954 } 955 956 if v.Name == nil || len(*v.Name) == 0 { 957 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 958 } 959 if v.Name != nil { 960 if err := encoder.SetURI("name").String(*v.Name); err != nil { 961 return err 962 } 963 } 964 965 if v.VersionOrAlias == nil || len(*v.VersionOrAlias) == 0 { 966 return &smithy.SerializationError{Err: fmt.Errorf("input member versionOrAlias must not be empty")} 967 } 968 if v.VersionOrAlias != nil { 969 if err := encoder.SetURI("versionOrAlias").String(*v.VersionOrAlias); err != nil { 970 return err 971 } 972 } 973 974 return nil 975} 976 977type awsRestjson1_serializeOpGetBotAlias struct { 978} 979 980func (*awsRestjson1_serializeOpGetBotAlias) ID() string { 981 return "OperationSerializer" 982} 983 984func (m *awsRestjson1_serializeOpGetBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 985 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 986) { 987 request, ok := in.Request.(*smithyhttp.Request) 988 if !ok { 989 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 990 } 991 992 input, ok := in.Parameters.(*GetBotAliasInput) 993 _ = input 994 if !ok { 995 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 996 } 997 998 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{name}") 999 request.URL.Path = opPath 1000 if len(request.URL.RawQuery) > 0 { 1001 request.URL.RawQuery = "&" + opQuery 1002 } else { 1003 request.URL.RawQuery = opQuery 1004 } 1005 1006 request.Method = "GET" 1007 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1008 if err != nil { 1009 return out, metadata, &smithy.SerializationError{Err: err} 1010 } 1011 1012 if err := awsRestjson1_serializeOpHttpBindingsGetBotAliasInput(input, restEncoder); err != nil { 1013 return out, metadata, &smithy.SerializationError{Err: err} 1014 } 1015 1016 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1017 return out, metadata, &smithy.SerializationError{Err: err} 1018 } 1019 in.Request = request 1020 1021 return next.HandleSerialize(ctx, in) 1022} 1023func awsRestjson1_serializeOpHttpBindingsGetBotAliasInput(v *GetBotAliasInput, encoder *httpbinding.Encoder) error { 1024 if v == nil { 1025 return fmt.Errorf("unsupported serialization of nil %T", v) 1026 } 1027 1028 if v.BotName == nil || len(*v.BotName) == 0 { 1029 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 1030 } 1031 if v.BotName != nil { 1032 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 1033 return err 1034 } 1035 } 1036 1037 if v.Name == nil || len(*v.Name) == 0 { 1038 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 1039 } 1040 if v.Name != nil { 1041 if err := encoder.SetURI("name").String(*v.Name); err != nil { 1042 return err 1043 } 1044 } 1045 1046 return nil 1047} 1048 1049type awsRestjson1_serializeOpGetBotAliases struct { 1050} 1051 1052func (*awsRestjson1_serializeOpGetBotAliases) ID() string { 1053 return "OperationSerializer" 1054} 1055 1056func (m *awsRestjson1_serializeOpGetBotAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1057 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1058) { 1059 request, ok := in.Request.(*smithyhttp.Request) 1060 if !ok { 1061 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1062 } 1063 1064 input, ok := in.Parameters.(*GetBotAliasesInput) 1065 _ = input 1066 if !ok { 1067 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1068 } 1069 1070 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases") 1071 request.URL.Path = opPath 1072 if len(request.URL.RawQuery) > 0 { 1073 request.URL.RawQuery = "&" + opQuery 1074 } else { 1075 request.URL.RawQuery = opQuery 1076 } 1077 1078 request.Method = "GET" 1079 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1080 if err != nil { 1081 return out, metadata, &smithy.SerializationError{Err: err} 1082 } 1083 1084 if err := awsRestjson1_serializeOpHttpBindingsGetBotAliasesInput(input, restEncoder); err != nil { 1085 return out, metadata, &smithy.SerializationError{Err: err} 1086 } 1087 1088 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1089 return out, metadata, &smithy.SerializationError{Err: err} 1090 } 1091 in.Request = request 1092 1093 return next.HandleSerialize(ctx, in) 1094} 1095func awsRestjson1_serializeOpHttpBindingsGetBotAliasesInput(v *GetBotAliasesInput, encoder *httpbinding.Encoder) error { 1096 if v == nil { 1097 return fmt.Errorf("unsupported serialization of nil %T", v) 1098 } 1099 1100 if v.BotName == nil || len(*v.BotName) == 0 { 1101 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 1102 } 1103 if v.BotName != nil { 1104 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 1105 return err 1106 } 1107 } 1108 1109 if v.MaxResults != nil { 1110 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1111 } 1112 1113 if v.NameContains != nil { 1114 encoder.SetQuery("nameContains").String(*v.NameContains) 1115 } 1116 1117 if v.NextToken != nil { 1118 encoder.SetQuery("nextToken").String(*v.NextToken) 1119 } 1120 1121 return nil 1122} 1123 1124type awsRestjson1_serializeOpGetBotChannelAssociation struct { 1125} 1126 1127func (*awsRestjson1_serializeOpGetBotChannelAssociation) ID() string { 1128 return "OperationSerializer" 1129} 1130 1131func (m *awsRestjson1_serializeOpGetBotChannelAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1132 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1133) { 1134 request, ok := in.Request.(*smithyhttp.Request) 1135 if !ok { 1136 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1137 } 1138 1139 input, ok := in.Parameters.(*GetBotChannelAssociationInput) 1140 _ = input 1141 if !ok { 1142 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1143 } 1144 1145 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{botAlias}/channels/{name}") 1146 request.URL.Path = opPath 1147 if len(request.URL.RawQuery) > 0 { 1148 request.URL.RawQuery = "&" + opQuery 1149 } else { 1150 request.URL.RawQuery = opQuery 1151 } 1152 1153 request.Method = "GET" 1154 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1155 if err != nil { 1156 return out, metadata, &smithy.SerializationError{Err: err} 1157 } 1158 1159 if err := awsRestjson1_serializeOpHttpBindingsGetBotChannelAssociationInput(input, restEncoder); err != nil { 1160 return out, metadata, &smithy.SerializationError{Err: err} 1161 } 1162 1163 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1164 return out, metadata, &smithy.SerializationError{Err: err} 1165 } 1166 in.Request = request 1167 1168 return next.HandleSerialize(ctx, in) 1169} 1170func awsRestjson1_serializeOpHttpBindingsGetBotChannelAssociationInput(v *GetBotChannelAssociationInput, encoder *httpbinding.Encoder) error { 1171 if v == nil { 1172 return fmt.Errorf("unsupported serialization of nil %T", v) 1173 } 1174 1175 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 1176 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 1177 } 1178 if v.BotAlias != nil { 1179 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 1180 return err 1181 } 1182 } 1183 1184 if v.BotName == nil || len(*v.BotName) == 0 { 1185 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 1186 } 1187 if v.BotName != nil { 1188 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 1189 return err 1190 } 1191 } 1192 1193 if v.Name == nil || len(*v.Name) == 0 { 1194 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 1195 } 1196 if v.Name != nil { 1197 if err := encoder.SetURI("name").String(*v.Name); err != nil { 1198 return err 1199 } 1200 } 1201 1202 return nil 1203} 1204 1205type awsRestjson1_serializeOpGetBotChannelAssociations struct { 1206} 1207 1208func (*awsRestjson1_serializeOpGetBotChannelAssociations) ID() string { 1209 return "OperationSerializer" 1210} 1211 1212func (m *awsRestjson1_serializeOpGetBotChannelAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1213 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1214) { 1215 request, ok := in.Request.(*smithyhttp.Request) 1216 if !ok { 1217 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1218 } 1219 1220 input, ok := in.Parameters.(*GetBotChannelAssociationsInput) 1221 _ = input 1222 if !ok { 1223 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1224 } 1225 1226 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{botAlias}/channels") 1227 request.URL.Path = opPath 1228 if len(request.URL.RawQuery) > 0 { 1229 request.URL.RawQuery = "&" + opQuery 1230 } else { 1231 request.URL.RawQuery = opQuery 1232 } 1233 1234 request.Method = "GET" 1235 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1236 if err != nil { 1237 return out, metadata, &smithy.SerializationError{Err: err} 1238 } 1239 1240 if err := awsRestjson1_serializeOpHttpBindingsGetBotChannelAssociationsInput(input, restEncoder); err != nil { 1241 return out, metadata, &smithy.SerializationError{Err: err} 1242 } 1243 1244 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1245 return out, metadata, &smithy.SerializationError{Err: err} 1246 } 1247 in.Request = request 1248 1249 return next.HandleSerialize(ctx, in) 1250} 1251func awsRestjson1_serializeOpHttpBindingsGetBotChannelAssociationsInput(v *GetBotChannelAssociationsInput, encoder *httpbinding.Encoder) error { 1252 if v == nil { 1253 return fmt.Errorf("unsupported serialization of nil %T", v) 1254 } 1255 1256 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 1257 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 1258 } 1259 if v.BotAlias != nil { 1260 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 1261 return err 1262 } 1263 } 1264 1265 if v.BotName == nil || len(*v.BotName) == 0 { 1266 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 1267 } 1268 if v.BotName != nil { 1269 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 1270 return err 1271 } 1272 } 1273 1274 if v.MaxResults != nil { 1275 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1276 } 1277 1278 if v.NameContains != nil { 1279 encoder.SetQuery("nameContains").String(*v.NameContains) 1280 } 1281 1282 if v.NextToken != nil { 1283 encoder.SetQuery("nextToken").String(*v.NextToken) 1284 } 1285 1286 return nil 1287} 1288 1289type awsRestjson1_serializeOpGetBots struct { 1290} 1291 1292func (*awsRestjson1_serializeOpGetBots) ID() string { 1293 return "OperationSerializer" 1294} 1295 1296func (m *awsRestjson1_serializeOpGetBots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1297 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1298) { 1299 request, ok := in.Request.(*smithyhttp.Request) 1300 if !ok { 1301 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1302 } 1303 1304 input, ok := in.Parameters.(*GetBotsInput) 1305 _ = input 1306 if !ok { 1307 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1308 } 1309 1310 opPath, opQuery := httpbinding.SplitURI("/bots") 1311 request.URL.Path = opPath 1312 if len(request.URL.RawQuery) > 0 { 1313 request.URL.RawQuery = "&" + opQuery 1314 } else { 1315 request.URL.RawQuery = opQuery 1316 } 1317 1318 request.Method = "GET" 1319 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1320 if err != nil { 1321 return out, metadata, &smithy.SerializationError{Err: err} 1322 } 1323 1324 if err := awsRestjson1_serializeOpHttpBindingsGetBotsInput(input, restEncoder); err != nil { 1325 return out, metadata, &smithy.SerializationError{Err: err} 1326 } 1327 1328 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1329 return out, metadata, &smithy.SerializationError{Err: err} 1330 } 1331 in.Request = request 1332 1333 return next.HandleSerialize(ctx, in) 1334} 1335func awsRestjson1_serializeOpHttpBindingsGetBotsInput(v *GetBotsInput, encoder *httpbinding.Encoder) error { 1336 if v == nil { 1337 return fmt.Errorf("unsupported serialization of nil %T", v) 1338 } 1339 1340 if v.MaxResults != nil { 1341 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1342 } 1343 1344 if v.NameContains != nil { 1345 encoder.SetQuery("nameContains").String(*v.NameContains) 1346 } 1347 1348 if v.NextToken != nil { 1349 encoder.SetQuery("nextToken").String(*v.NextToken) 1350 } 1351 1352 return nil 1353} 1354 1355type awsRestjson1_serializeOpGetBotVersions struct { 1356} 1357 1358func (*awsRestjson1_serializeOpGetBotVersions) ID() string { 1359 return "OperationSerializer" 1360} 1361 1362func (m *awsRestjson1_serializeOpGetBotVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1363 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1364) { 1365 request, ok := in.Request.(*smithyhttp.Request) 1366 if !ok { 1367 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1368 } 1369 1370 input, ok := in.Parameters.(*GetBotVersionsInput) 1371 _ = input 1372 if !ok { 1373 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1374 } 1375 1376 opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions") 1377 request.URL.Path = opPath 1378 if len(request.URL.RawQuery) > 0 { 1379 request.URL.RawQuery = "&" + opQuery 1380 } else { 1381 request.URL.RawQuery = opQuery 1382 } 1383 1384 request.Method = "GET" 1385 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1386 if err != nil { 1387 return out, metadata, &smithy.SerializationError{Err: err} 1388 } 1389 1390 if err := awsRestjson1_serializeOpHttpBindingsGetBotVersionsInput(input, restEncoder); err != nil { 1391 return out, metadata, &smithy.SerializationError{Err: err} 1392 } 1393 1394 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1395 return out, metadata, &smithy.SerializationError{Err: err} 1396 } 1397 in.Request = request 1398 1399 return next.HandleSerialize(ctx, in) 1400} 1401func awsRestjson1_serializeOpHttpBindingsGetBotVersionsInput(v *GetBotVersionsInput, encoder *httpbinding.Encoder) error { 1402 if v == nil { 1403 return fmt.Errorf("unsupported serialization of nil %T", v) 1404 } 1405 1406 if v.MaxResults != nil { 1407 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1408 } 1409 1410 if v.Name == nil || len(*v.Name) == 0 { 1411 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 1412 } 1413 if v.Name != nil { 1414 if err := encoder.SetURI("name").String(*v.Name); err != nil { 1415 return err 1416 } 1417 } 1418 1419 if v.NextToken != nil { 1420 encoder.SetQuery("nextToken").String(*v.NextToken) 1421 } 1422 1423 return nil 1424} 1425 1426type awsRestjson1_serializeOpGetBuiltinIntent struct { 1427} 1428 1429func (*awsRestjson1_serializeOpGetBuiltinIntent) ID() string { 1430 return "OperationSerializer" 1431} 1432 1433func (m *awsRestjson1_serializeOpGetBuiltinIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1434 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1435) { 1436 request, ok := in.Request.(*smithyhttp.Request) 1437 if !ok { 1438 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1439 } 1440 1441 input, ok := in.Parameters.(*GetBuiltinIntentInput) 1442 _ = input 1443 if !ok { 1444 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1445 } 1446 1447 opPath, opQuery := httpbinding.SplitURI("/builtins/intents/{signature}") 1448 request.URL.Path = opPath 1449 if len(request.URL.RawQuery) > 0 { 1450 request.URL.RawQuery = "&" + opQuery 1451 } else { 1452 request.URL.RawQuery = opQuery 1453 } 1454 1455 request.Method = "GET" 1456 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1457 if err != nil { 1458 return out, metadata, &smithy.SerializationError{Err: err} 1459 } 1460 1461 if err := awsRestjson1_serializeOpHttpBindingsGetBuiltinIntentInput(input, restEncoder); err != nil { 1462 return out, metadata, &smithy.SerializationError{Err: err} 1463 } 1464 1465 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1466 return out, metadata, &smithy.SerializationError{Err: err} 1467 } 1468 in.Request = request 1469 1470 return next.HandleSerialize(ctx, in) 1471} 1472func awsRestjson1_serializeOpHttpBindingsGetBuiltinIntentInput(v *GetBuiltinIntentInput, encoder *httpbinding.Encoder) error { 1473 if v == nil { 1474 return fmt.Errorf("unsupported serialization of nil %T", v) 1475 } 1476 1477 if v.Signature == nil || len(*v.Signature) == 0 { 1478 return &smithy.SerializationError{Err: fmt.Errorf("input member signature must not be empty")} 1479 } 1480 if v.Signature != nil { 1481 if err := encoder.SetURI("signature").String(*v.Signature); err != nil { 1482 return err 1483 } 1484 } 1485 1486 return nil 1487} 1488 1489type awsRestjson1_serializeOpGetBuiltinIntents struct { 1490} 1491 1492func (*awsRestjson1_serializeOpGetBuiltinIntents) ID() string { 1493 return "OperationSerializer" 1494} 1495 1496func (m *awsRestjson1_serializeOpGetBuiltinIntents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1497 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1498) { 1499 request, ok := in.Request.(*smithyhttp.Request) 1500 if !ok { 1501 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1502 } 1503 1504 input, ok := in.Parameters.(*GetBuiltinIntentsInput) 1505 _ = input 1506 if !ok { 1507 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1508 } 1509 1510 opPath, opQuery := httpbinding.SplitURI("/builtins/intents") 1511 request.URL.Path = opPath 1512 if len(request.URL.RawQuery) > 0 { 1513 request.URL.RawQuery = "&" + opQuery 1514 } else { 1515 request.URL.RawQuery = opQuery 1516 } 1517 1518 request.Method = "GET" 1519 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1520 if err != nil { 1521 return out, metadata, &smithy.SerializationError{Err: err} 1522 } 1523 1524 if err := awsRestjson1_serializeOpHttpBindingsGetBuiltinIntentsInput(input, restEncoder); err != nil { 1525 return out, metadata, &smithy.SerializationError{Err: err} 1526 } 1527 1528 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1529 return out, metadata, &smithy.SerializationError{Err: err} 1530 } 1531 in.Request = request 1532 1533 return next.HandleSerialize(ctx, in) 1534} 1535func awsRestjson1_serializeOpHttpBindingsGetBuiltinIntentsInput(v *GetBuiltinIntentsInput, encoder *httpbinding.Encoder) error { 1536 if v == nil { 1537 return fmt.Errorf("unsupported serialization of nil %T", v) 1538 } 1539 1540 if len(v.Locale) > 0 { 1541 encoder.SetQuery("locale").String(string(v.Locale)) 1542 } 1543 1544 if v.MaxResults != nil { 1545 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1546 } 1547 1548 if v.NextToken != nil { 1549 encoder.SetQuery("nextToken").String(*v.NextToken) 1550 } 1551 1552 if v.SignatureContains != nil { 1553 encoder.SetQuery("signatureContains").String(*v.SignatureContains) 1554 } 1555 1556 return nil 1557} 1558 1559type awsRestjson1_serializeOpGetBuiltinSlotTypes struct { 1560} 1561 1562func (*awsRestjson1_serializeOpGetBuiltinSlotTypes) ID() string { 1563 return "OperationSerializer" 1564} 1565 1566func (m *awsRestjson1_serializeOpGetBuiltinSlotTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1567 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1568) { 1569 request, ok := in.Request.(*smithyhttp.Request) 1570 if !ok { 1571 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1572 } 1573 1574 input, ok := in.Parameters.(*GetBuiltinSlotTypesInput) 1575 _ = input 1576 if !ok { 1577 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1578 } 1579 1580 opPath, opQuery := httpbinding.SplitURI("/builtins/slottypes") 1581 request.URL.Path = opPath 1582 if len(request.URL.RawQuery) > 0 { 1583 request.URL.RawQuery = "&" + opQuery 1584 } else { 1585 request.URL.RawQuery = opQuery 1586 } 1587 1588 request.Method = "GET" 1589 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1590 if err != nil { 1591 return out, metadata, &smithy.SerializationError{Err: err} 1592 } 1593 1594 if err := awsRestjson1_serializeOpHttpBindingsGetBuiltinSlotTypesInput(input, restEncoder); err != nil { 1595 return out, metadata, &smithy.SerializationError{Err: err} 1596 } 1597 1598 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1599 return out, metadata, &smithy.SerializationError{Err: err} 1600 } 1601 in.Request = request 1602 1603 return next.HandleSerialize(ctx, in) 1604} 1605func awsRestjson1_serializeOpHttpBindingsGetBuiltinSlotTypesInput(v *GetBuiltinSlotTypesInput, encoder *httpbinding.Encoder) error { 1606 if v == nil { 1607 return fmt.Errorf("unsupported serialization of nil %T", v) 1608 } 1609 1610 if len(v.Locale) > 0 { 1611 encoder.SetQuery("locale").String(string(v.Locale)) 1612 } 1613 1614 if v.MaxResults != nil { 1615 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1616 } 1617 1618 if v.NextToken != nil { 1619 encoder.SetQuery("nextToken").String(*v.NextToken) 1620 } 1621 1622 if v.SignatureContains != nil { 1623 encoder.SetQuery("signatureContains").String(*v.SignatureContains) 1624 } 1625 1626 return nil 1627} 1628 1629type awsRestjson1_serializeOpGetExport struct { 1630} 1631 1632func (*awsRestjson1_serializeOpGetExport) ID() string { 1633 return "OperationSerializer" 1634} 1635 1636func (m *awsRestjson1_serializeOpGetExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1637 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1638) { 1639 request, ok := in.Request.(*smithyhttp.Request) 1640 if !ok { 1641 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1642 } 1643 1644 input, ok := in.Parameters.(*GetExportInput) 1645 _ = input 1646 if !ok { 1647 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1648 } 1649 1650 opPath, opQuery := httpbinding.SplitURI("/exports") 1651 request.URL.Path = opPath 1652 if len(request.URL.RawQuery) > 0 { 1653 request.URL.RawQuery = "&" + opQuery 1654 } else { 1655 request.URL.RawQuery = opQuery 1656 } 1657 1658 request.Method = "GET" 1659 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1660 if err != nil { 1661 return out, metadata, &smithy.SerializationError{Err: err} 1662 } 1663 1664 if err := awsRestjson1_serializeOpHttpBindingsGetExportInput(input, restEncoder); err != nil { 1665 return out, metadata, &smithy.SerializationError{Err: err} 1666 } 1667 1668 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1669 return out, metadata, &smithy.SerializationError{Err: err} 1670 } 1671 in.Request = request 1672 1673 return next.HandleSerialize(ctx, in) 1674} 1675func awsRestjson1_serializeOpHttpBindingsGetExportInput(v *GetExportInput, encoder *httpbinding.Encoder) error { 1676 if v == nil { 1677 return fmt.Errorf("unsupported serialization of nil %T", v) 1678 } 1679 1680 if len(v.ExportType) > 0 { 1681 encoder.SetQuery("exportType").String(string(v.ExportType)) 1682 } 1683 1684 if v.Name != nil { 1685 encoder.SetQuery("name").String(*v.Name) 1686 } 1687 1688 if len(v.ResourceType) > 0 { 1689 encoder.SetQuery("resourceType").String(string(v.ResourceType)) 1690 } 1691 1692 if v.Version != nil { 1693 encoder.SetQuery("version").String(*v.Version) 1694 } 1695 1696 return nil 1697} 1698 1699type awsRestjson1_serializeOpGetImport struct { 1700} 1701 1702func (*awsRestjson1_serializeOpGetImport) ID() string { 1703 return "OperationSerializer" 1704} 1705 1706func (m *awsRestjson1_serializeOpGetImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1707 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1708) { 1709 request, ok := in.Request.(*smithyhttp.Request) 1710 if !ok { 1711 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1712 } 1713 1714 input, ok := in.Parameters.(*GetImportInput) 1715 _ = input 1716 if !ok { 1717 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1718 } 1719 1720 opPath, opQuery := httpbinding.SplitURI("/imports/{importId}") 1721 request.URL.Path = opPath 1722 if len(request.URL.RawQuery) > 0 { 1723 request.URL.RawQuery = "&" + opQuery 1724 } else { 1725 request.URL.RawQuery = opQuery 1726 } 1727 1728 request.Method = "GET" 1729 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1730 if err != nil { 1731 return out, metadata, &smithy.SerializationError{Err: err} 1732 } 1733 1734 if err := awsRestjson1_serializeOpHttpBindingsGetImportInput(input, restEncoder); err != nil { 1735 return out, metadata, &smithy.SerializationError{Err: err} 1736 } 1737 1738 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1739 return out, metadata, &smithy.SerializationError{Err: err} 1740 } 1741 in.Request = request 1742 1743 return next.HandleSerialize(ctx, in) 1744} 1745func awsRestjson1_serializeOpHttpBindingsGetImportInput(v *GetImportInput, encoder *httpbinding.Encoder) error { 1746 if v == nil { 1747 return fmt.Errorf("unsupported serialization of nil %T", v) 1748 } 1749 1750 if v.ImportId == nil || len(*v.ImportId) == 0 { 1751 return &smithy.SerializationError{Err: fmt.Errorf("input member importId must not be empty")} 1752 } 1753 if v.ImportId != nil { 1754 if err := encoder.SetURI("importId").String(*v.ImportId); err != nil { 1755 return err 1756 } 1757 } 1758 1759 return nil 1760} 1761 1762type awsRestjson1_serializeOpGetIntent struct { 1763} 1764 1765func (*awsRestjson1_serializeOpGetIntent) ID() string { 1766 return "OperationSerializer" 1767} 1768 1769func (m *awsRestjson1_serializeOpGetIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1770 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1771) { 1772 request, ok := in.Request.(*smithyhttp.Request) 1773 if !ok { 1774 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1775 } 1776 1777 input, ok := in.Parameters.(*GetIntentInput) 1778 _ = input 1779 if !ok { 1780 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1781 } 1782 1783 opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions/{version}") 1784 request.URL.Path = opPath 1785 if len(request.URL.RawQuery) > 0 { 1786 request.URL.RawQuery = "&" + opQuery 1787 } else { 1788 request.URL.RawQuery = opQuery 1789 } 1790 1791 request.Method = "GET" 1792 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1793 if err != nil { 1794 return out, metadata, &smithy.SerializationError{Err: err} 1795 } 1796 1797 if err := awsRestjson1_serializeOpHttpBindingsGetIntentInput(input, restEncoder); err != nil { 1798 return out, metadata, &smithy.SerializationError{Err: err} 1799 } 1800 1801 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1802 return out, metadata, &smithy.SerializationError{Err: err} 1803 } 1804 in.Request = request 1805 1806 return next.HandleSerialize(ctx, in) 1807} 1808func awsRestjson1_serializeOpHttpBindingsGetIntentInput(v *GetIntentInput, encoder *httpbinding.Encoder) error { 1809 if v == nil { 1810 return fmt.Errorf("unsupported serialization of nil %T", v) 1811 } 1812 1813 if v.Name == nil || len(*v.Name) == 0 { 1814 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 1815 } 1816 if v.Name != nil { 1817 if err := encoder.SetURI("name").String(*v.Name); err != nil { 1818 return err 1819 } 1820 } 1821 1822 if v.Version == nil || len(*v.Version) == 0 { 1823 return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")} 1824 } 1825 if v.Version != nil { 1826 if err := encoder.SetURI("version").String(*v.Version); err != nil { 1827 return err 1828 } 1829 } 1830 1831 return nil 1832} 1833 1834type awsRestjson1_serializeOpGetIntents struct { 1835} 1836 1837func (*awsRestjson1_serializeOpGetIntents) ID() string { 1838 return "OperationSerializer" 1839} 1840 1841func (m *awsRestjson1_serializeOpGetIntents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1842 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1843) { 1844 request, ok := in.Request.(*smithyhttp.Request) 1845 if !ok { 1846 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1847 } 1848 1849 input, ok := in.Parameters.(*GetIntentsInput) 1850 _ = input 1851 if !ok { 1852 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1853 } 1854 1855 opPath, opQuery := httpbinding.SplitURI("/intents") 1856 request.URL.Path = opPath 1857 if len(request.URL.RawQuery) > 0 { 1858 request.URL.RawQuery = "&" + opQuery 1859 } else { 1860 request.URL.RawQuery = opQuery 1861 } 1862 1863 request.Method = "GET" 1864 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1865 if err != nil { 1866 return out, metadata, &smithy.SerializationError{Err: err} 1867 } 1868 1869 if err := awsRestjson1_serializeOpHttpBindingsGetIntentsInput(input, restEncoder); err != nil { 1870 return out, metadata, &smithy.SerializationError{Err: err} 1871 } 1872 1873 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1874 return out, metadata, &smithy.SerializationError{Err: err} 1875 } 1876 in.Request = request 1877 1878 return next.HandleSerialize(ctx, in) 1879} 1880func awsRestjson1_serializeOpHttpBindingsGetIntentsInput(v *GetIntentsInput, encoder *httpbinding.Encoder) error { 1881 if v == nil { 1882 return fmt.Errorf("unsupported serialization of nil %T", v) 1883 } 1884 1885 if v.MaxResults != nil { 1886 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1887 } 1888 1889 if v.NameContains != nil { 1890 encoder.SetQuery("nameContains").String(*v.NameContains) 1891 } 1892 1893 if v.NextToken != nil { 1894 encoder.SetQuery("nextToken").String(*v.NextToken) 1895 } 1896 1897 return nil 1898} 1899 1900type awsRestjson1_serializeOpGetIntentVersions struct { 1901} 1902 1903func (*awsRestjson1_serializeOpGetIntentVersions) ID() string { 1904 return "OperationSerializer" 1905} 1906 1907func (m *awsRestjson1_serializeOpGetIntentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1908 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1909) { 1910 request, ok := in.Request.(*smithyhttp.Request) 1911 if !ok { 1912 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1913 } 1914 1915 input, ok := in.Parameters.(*GetIntentVersionsInput) 1916 _ = input 1917 if !ok { 1918 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1919 } 1920 1921 opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions") 1922 request.URL.Path = opPath 1923 if len(request.URL.RawQuery) > 0 { 1924 request.URL.RawQuery = "&" + opQuery 1925 } else { 1926 request.URL.RawQuery = opQuery 1927 } 1928 1929 request.Method = "GET" 1930 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1931 if err != nil { 1932 return out, metadata, &smithy.SerializationError{Err: err} 1933 } 1934 1935 if err := awsRestjson1_serializeOpHttpBindingsGetIntentVersionsInput(input, restEncoder); err != nil { 1936 return out, metadata, &smithy.SerializationError{Err: err} 1937 } 1938 1939 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1940 return out, metadata, &smithy.SerializationError{Err: err} 1941 } 1942 in.Request = request 1943 1944 return next.HandleSerialize(ctx, in) 1945} 1946func awsRestjson1_serializeOpHttpBindingsGetIntentVersionsInput(v *GetIntentVersionsInput, encoder *httpbinding.Encoder) error { 1947 if v == nil { 1948 return fmt.Errorf("unsupported serialization of nil %T", v) 1949 } 1950 1951 if v.MaxResults != nil { 1952 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 1953 } 1954 1955 if v.Name == nil || len(*v.Name) == 0 { 1956 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 1957 } 1958 if v.Name != nil { 1959 if err := encoder.SetURI("name").String(*v.Name); err != nil { 1960 return err 1961 } 1962 } 1963 1964 if v.NextToken != nil { 1965 encoder.SetQuery("nextToken").String(*v.NextToken) 1966 } 1967 1968 return nil 1969} 1970 1971type awsRestjson1_serializeOpGetSlotType struct { 1972} 1973 1974func (*awsRestjson1_serializeOpGetSlotType) ID() string { 1975 return "OperationSerializer" 1976} 1977 1978func (m *awsRestjson1_serializeOpGetSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1979 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1980) { 1981 request, ok := in.Request.(*smithyhttp.Request) 1982 if !ok { 1983 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1984 } 1985 1986 input, ok := in.Parameters.(*GetSlotTypeInput) 1987 _ = input 1988 if !ok { 1989 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1990 } 1991 1992 opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions/{version}") 1993 request.URL.Path = opPath 1994 if len(request.URL.RawQuery) > 0 { 1995 request.URL.RawQuery = "&" + opQuery 1996 } else { 1997 request.URL.RawQuery = opQuery 1998 } 1999 2000 request.Method = "GET" 2001 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2002 if err != nil { 2003 return out, metadata, &smithy.SerializationError{Err: err} 2004 } 2005 2006 if err := awsRestjson1_serializeOpHttpBindingsGetSlotTypeInput(input, restEncoder); err != nil { 2007 return out, metadata, &smithy.SerializationError{Err: err} 2008 } 2009 2010 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2011 return out, metadata, &smithy.SerializationError{Err: err} 2012 } 2013 in.Request = request 2014 2015 return next.HandleSerialize(ctx, in) 2016} 2017func awsRestjson1_serializeOpHttpBindingsGetSlotTypeInput(v *GetSlotTypeInput, encoder *httpbinding.Encoder) error { 2018 if v == nil { 2019 return fmt.Errorf("unsupported serialization of nil %T", v) 2020 } 2021 2022 if v.Name == nil || len(*v.Name) == 0 { 2023 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 2024 } 2025 if v.Name != nil { 2026 if err := encoder.SetURI("name").String(*v.Name); err != nil { 2027 return err 2028 } 2029 } 2030 2031 if v.Version == nil || len(*v.Version) == 0 { 2032 return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")} 2033 } 2034 if v.Version != nil { 2035 if err := encoder.SetURI("version").String(*v.Version); err != nil { 2036 return err 2037 } 2038 } 2039 2040 return nil 2041} 2042 2043type awsRestjson1_serializeOpGetSlotTypes struct { 2044} 2045 2046func (*awsRestjson1_serializeOpGetSlotTypes) ID() string { 2047 return "OperationSerializer" 2048} 2049 2050func (m *awsRestjson1_serializeOpGetSlotTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2051 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2052) { 2053 request, ok := in.Request.(*smithyhttp.Request) 2054 if !ok { 2055 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2056 } 2057 2058 input, ok := in.Parameters.(*GetSlotTypesInput) 2059 _ = input 2060 if !ok { 2061 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2062 } 2063 2064 opPath, opQuery := httpbinding.SplitURI("/slottypes") 2065 request.URL.Path = opPath 2066 if len(request.URL.RawQuery) > 0 { 2067 request.URL.RawQuery = "&" + opQuery 2068 } else { 2069 request.URL.RawQuery = opQuery 2070 } 2071 2072 request.Method = "GET" 2073 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2074 if err != nil { 2075 return out, metadata, &smithy.SerializationError{Err: err} 2076 } 2077 2078 if err := awsRestjson1_serializeOpHttpBindingsGetSlotTypesInput(input, restEncoder); err != nil { 2079 return out, metadata, &smithy.SerializationError{Err: err} 2080 } 2081 2082 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2083 return out, metadata, &smithy.SerializationError{Err: err} 2084 } 2085 in.Request = request 2086 2087 return next.HandleSerialize(ctx, in) 2088} 2089func awsRestjson1_serializeOpHttpBindingsGetSlotTypesInput(v *GetSlotTypesInput, encoder *httpbinding.Encoder) error { 2090 if v == nil { 2091 return fmt.Errorf("unsupported serialization of nil %T", v) 2092 } 2093 2094 if v.MaxResults != nil { 2095 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2096 } 2097 2098 if v.NameContains != nil { 2099 encoder.SetQuery("nameContains").String(*v.NameContains) 2100 } 2101 2102 if v.NextToken != nil { 2103 encoder.SetQuery("nextToken").String(*v.NextToken) 2104 } 2105 2106 return nil 2107} 2108 2109type awsRestjson1_serializeOpGetSlotTypeVersions struct { 2110} 2111 2112func (*awsRestjson1_serializeOpGetSlotTypeVersions) ID() string { 2113 return "OperationSerializer" 2114} 2115 2116func (m *awsRestjson1_serializeOpGetSlotTypeVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2117 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2118) { 2119 request, ok := in.Request.(*smithyhttp.Request) 2120 if !ok { 2121 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2122 } 2123 2124 input, ok := in.Parameters.(*GetSlotTypeVersionsInput) 2125 _ = input 2126 if !ok { 2127 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2128 } 2129 2130 opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions") 2131 request.URL.Path = opPath 2132 if len(request.URL.RawQuery) > 0 { 2133 request.URL.RawQuery = "&" + opQuery 2134 } else { 2135 request.URL.RawQuery = opQuery 2136 } 2137 2138 request.Method = "GET" 2139 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2140 if err != nil { 2141 return out, metadata, &smithy.SerializationError{Err: err} 2142 } 2143 2144 if err := awsRestjson1_serializeOpHttpBindingsGetSlotTypeVersionsInput(input, restEncoder); err != nil { 2145 return out, metadata, &smithy.SerializationError{Err: err} 2146 } 2147 2148 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2149 return out, metadata, &smithy.SerializationError{Err: err} 2150 } 2151 in.Request = request 2152 2153 return next.HandleSerialize(ctx, in) 2154} 2155func awsRestjson1_serializeOpHttpBindingsGetSlotTypeVersionsInput(v *GetSlotTypeVersionsInput, encoder *httpbinding.Encoder) error { 2156 if v == nil { 2157 return fmt.Errorf("unsupported serialization of nil %T", v) 2158 } 2159 2160 if v.MaxResults != nil { 2161 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2162 } 2163 2164 if v.Name == nil || len(*v.Name) == 0 { 2165 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 2166 } 2167 if v.Name != nil { 2168 if err := encoder.SetURI("name").String(*v.Name); err != nil { 2169 return err 2170 } 2171 } 2172 2173 if v.NextToken != nil { 2174 encoder.SetQuery("nextToken").String(*v.NextToken) 2175 } 2176 2177 return nil 2178} 2179 2180type awsRestjson1_serializeOpGetUtterancesView struct { 2181} 2182 2183func (*awsRestjson1_serializeOpGetUtterancesView) ID() string { 2184 return "OperationSerializer" 2185} 2186 2187func (m *awsRestjson1_serializeOpGetUtterancesView) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2188 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2189) { 2190 request, ok := in.Request.(*smithyhttp.Request) 2191 if !ok { 2192 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2193 } 2194 2195 input, ok := in.Parameters.(*GetUtterancesViewInput) 2196 _ = input 2197 if !ok { 2198 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2199 } 2200 2201 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/utterances?view=aggregation") 2202 request.URL.Path = opPath 2203 if len(request.URL.RawQuery) > 0 { 2204 request.URL.RawQuery = "&" + opQuery 2205 } else { 2206 request.URL.RawQuery = opQuery 2207 } 2208 2209 request.Method = "GET" 2210 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2211 if err != nil { 2212 return out, metadata, &smithy.SerializationError{Err: err} 2213 } 2214 2215 if err := awsRestjson1_serializeOpHttpBindingsGetUtterancesViewInput(input, restEncoder); err != nil { 2216 return out, metadata, &smithy.SerializationError{Err: err} 2217 } 2218 2219 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2220 return out, metadata, &smithy.SerializationError{Err: err} 2221 } 2222 in.Request = request 2223 2224 return next.HandleSerialize(ctx, in) 2225} 2226func awsRestjson1_serializeOpHttpBindingsGetUtterancesViewInput(v *GetUtterancesViewInput, encoder *httpbinding.Encoder) error { 2227 if v == nil { 2228 return fmt.Errorf("unsupported serialization of nil %T", v) 2229 } 2230 2231 if v.BotName == nil || len(*v.BotName) == 0 { 2232 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 2233 } 2234 if v.BotName != nil { 2235 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 2236 return err 2237 } 2238 } 2239 2240 if v.BotVersions != nil { 2241 for i := range v.BotVersions { 2242 encoder.AddQuery("bot_versions").String(v.BotVersions[i]) 2243 } 2244 } 2245 2246 if len(v.StatusType) > 0 { 2247 encoder.SetQuery("status_type").String(string(v.StatusType)) 2248 } 2249 2250 return nil 2251} 2252 2253type awsRestjson1_serializeOpListTagsForResource struct { 2254} 2255 2256func (*awsRestjson1_serializeOpListTagsForResource) ID() string { 2257 return "OperationSerializer" 2258} 2259 2260func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2261 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2262) { 2263 request, ok := in.Request.(*smithyhttp.Request) 2264 if !ok { 2265 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2266 } 2267 2268 input, ok := in.Parameters.(*ListTagsForResourceInput) 2269 _ = input 2270 if !ok { 2271 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2272 } 2273 2274 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 2275 request.URL.Path = opPath 2276 if len(request.URL.RawQuery) > 0 { 2277 request.URL.RawQuery = "&" + opQuery 2278 } else { 2279 request.URL.RawQuery = opQuery 2280 } 2281 2282 request.Method = "GET" 2283 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2284 if err != nil { 2285 return out, metadata, &smithy.SerializationError{Err: err} 2286 } 2287 2288 if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { 2289 return out, metadata, &smithy.SerializationError{Err: err} 2290 } 2291 2292 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2293 return out, metadata, &smithy.SerializationError{Err: err} 2294 } 2295 in.Request = request 2296 2297 return next.HandleSerialize(ctx, in) 2298} 2299func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { 2300 if v == nil { 2301 return fmt.Errorf("unsupported serialization of nil %T", v) 2302 } 2303 2304 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 2305 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 2306 } 2307 if v.ResourceArn != nil { 2308 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 2309 return err 2310 } 2311 } 2312 2313 return nil 2314} 2315 2316type awsRestjson1_serializeOpPutBot struct { 2317} 2318 2319func (*awsRestjson1_serializeOpPutBot) ID() string { 2320 return "OperationSerializer" 2321} 2322 2323func (m *awsRestjson1_serializeOpPutBot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2324 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2325) { 2326 request, ok := in.Request.(*smithyhttp.Request) 2327 if !ok { 2328 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2329 } 2330 2331 input, ok := in.Parameters.(*PutBotInput) 2332 _ = input 2333 if !ok { 2334 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2335 } 2336 2337 opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions/$LATEST") 2338 request.URL.Path = opPath 2339 if len(request.URL.RawQuery) > 0 { 2340 request.URL.RawQuery = "&" + opQuery 2341 } else { 2342 request.URL.RawQuery = opQuery 2343 } 2344 2345 request.Method = "PUT" 2346 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2347 if err != nil { 2348 return out, metadata, &smithy.SerializationError{Err: err} 2349 } 2350 2351 if err := awsRestjson1_serializeOpHttpBindingsPutBotInput(input, restEncoder); err != nil { 2352 return out, metadata, &smithy.SerializationError{Err: err} 2353 } 2354 2355 restEncoder.SetHeader("Content-Type").String("application/json") 2356 2357 jsonEncoder := smithyjson.NewEncoder() 2358 if err := awsRestjson1_serializeOpDocumentPutBotInput(input, jsonEncoder.Value); err != nil { 2359 return out, metadata, &smithy.SerializationError{Err: err} 2360 } 2361 2362 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2363 return out, metadata, &smithy.SerializationError{Err: err} 2364 } 2365 2366 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2367 return out, metadata, &smithy.SerializationError{Err: err} 2368 } 2369 in.Request = request 2370 2371 return next.HandleSerialize(ctx, in) 2372} 2373func awsRestjson1_serializeOpHttpBindingsPutBotInput(v *PutBotInput, encoder *httpbinding.Encoder) error { 2374 if v == nil { 2375 return fmt.Errorf("unsupported serialization of nil %T", v) 2376 } 2377 2378 if v.Name == nil || len(*v.Name) == 0 { 2379 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 2380 } 2381 if v.Name != nil { 2382 if err := encoder.SetURI("name").String(*v.Name); err != nil { 2383 return err 2384 } 2385 } 2386 2387 return nil 2388} 2389 2390func awsRestjson1_serializeOpDocumentPutBotInput(v *PutBotInput, value smithyjson.Value) error { 2391 object := value.Object() 2392 defer object.Close() 2393 2394 if v.AbortStatement != nil { 2395 ok := object.Key("abortStatement") 2396 if err := awsRestjson1_serializeDocumentStatement(v.AbortStatement, ok); err != nil { 2397 return err 2398 } 2399 } 2400 2401 if v.Checksum != nil { 2402 ok := object.Key("checksum") 2403 ok.String(*v.Checksum) 2404 } 2405 2406 if v.ChildDirected != nil { 2407 ok := object.Key("childDirected") 2408 ok.Boolean(*v.ChildDirected) 2409 } 2410 2411 if v.ClarificationPrompt != nil { 2412 ok := object.Key("clarificationPrompt") 2413 if err := awsRestjson1_serializeDocumentPrompt(v.ClarificationPrompt, ok); err != nil { 2414 return err 2415 } 2416 } 2417 2418 if v.CreateVersion != nil { 2419 ok := object.Key("createVersion") 2420 ok.Boolean(*v.CreateVersion) 2421 } 2422 2423 if v.Description != nil { 2424 ok := object.Key("description") 2425 ok.String(*v.Description) 2426 } 2427 2428 if v.DetectSentiment != nil { 2429 ok := object.Key("detectSentiment") 2430 ok.Boolean(*v.DetectSentiment) 2431 } 2432 2433 if v.EnableModelImprovements != nil { 2434 ok := object.Key("enableModelImprovements") 2435 ok.Boolean(*v.EnableModelImprovements) 2436 } 2437 2438 if v.IdleSessionTTLInSeconds != nil { 2439 ok := object.Key("idleSessionTTLInSeconds") 2440 ok.Integer(*v.IdleSessionTTLInSeconds) 2441 } 2442 2443 if v.Intents != nil { 2444 ok := object.Key("intents") 2445 if err := awsRestjson1_serializeDocumentIntentList(v.Intents, ok); err != nil { 2446 return err 2447 } 2448 } 2449 2450 if len(v.Locale) > 0 { 2451 ok := object.Key("locale") 2452 ok.String(string(v.Locale)) 2453 } 2454 2455 if v.NluIntentConfidenceThreshold != nil { 2456 ok := object.Key("nluIntentConfidenceThreshold") 2457 ok.Double(*v.NluIntentConfidenceThreshold) 2458 } 2459 2460 if len(v.ProcessBehavior) > 0 { 2461 ok := object.Key("processBehavior") 2462 ok.String(string(v.ProcessBehavior)) 2463 } 2464 2465 if v.Tags != nil { 2466 ok := object.Key("tags") 2467 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 2468 return err 2469 } 2470 } 2471 2472 if v.VoiceId != nil { 2473 ok := object.Key("voiceId") 2474 ok.String(*v.VoiceId) 2475 } 2476 2477 return nil 2478} 2479 2480type awsRestjson1_serializeOpPutBotAlias struct { 2481} 2482 2483func (*awsRestjson1_serializeOpPutBotAlias) ID() string { 2484 return "OperationSerializer" 2485} 2486 2487func (m *awsRestjson1_serializeOpPutBotAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2488 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2489) { 2490 request, ok := in.Request.(*smithyhttp.Request) 2491 if !ok { 2492 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2493 } 2494 2495 input, ok := in.Parameters.(*PutBotAliasInput) 2496 _ = input 2497 if !ok { 2498 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2499 } 2500 2501 opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{name}") 2502 request.URL.Path = opPath 2503 if len(request.URL.RawQuery) > 0 { 2504 request.URL.RawQuery = "&" + opQuery 2505 } else { 2506 request.URL.RawQuery = opQuery 2507 } 2508 2509 request.Method = "PUT" 2510 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2511 if err != nil { 2512 return out, metadata, &smithy.SerializationError{Err: err} 2513 } 2514 2515 if err := awsRestjson1_serializeOpHttpBindingsPutBotAliasInput(input, restEncoder); err != nil { 2516 return out, metadata, &smithy.SerializationError{Err: err} 2517 } 2518 2519 restEncoder.SetHeader("Content-Type").String("application/json") 2520 2521 jsonEncoder := smithyjson.NewEncoder() 2522 if err := awsRestjson1_serializeOpDocumentPutBotAliasInput(input, jsonEncoder.Value); err != nil { 2523 return out, metadata, &smithy.SerializationError{Err: err} 2524 } 2525 2526 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2527 return out, metadata, &smithy.SerializationError{Err: err} 2528 } 2529 2530 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2531 return out, metadata, &smithy.SerializationError{Err: err} 2532 } 2533 in.Request = request 2534 2535 return next.HandleSerialize(ctx, in) 2536} 2537func awsRestjson1_serializeOpHttpBindingsPutBotAliasInput(v *PutBotAliasInput, encoder *httpbinding.Encoder) error { 2538 if v == nil { 2539 return fmt.Errorf("unsupported serialization of nil %T", v) 2540 } 2541 2542 if v.BotName == nil || len(*v.BotName) == 0 { 2543 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 2544 } 2545 if v.BotName != nil { 2546 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 2547 return err 2548 } 2549 } 2550 2551 if v.Name == nil || len(*v.Name) == 0 { 2552 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 2553 } 2554 if v.Name != nil { 2555 if err := encoder.SetURI("name").String(*v.Name); err != nil { 2556 return err 2557 } 2558 } 2559 2560 return nil 2561} 2562 2563func awsRestjson1_serializeOpDocumentPutBotAliasInput(v *PutBotAliasInput, value smithyjson.Value) error { 2564 object := value.Object() 2565 defer object.Close() 2566 2567 if v.BotVersion != nil { 2568 ok := object.Key("botVersion") 2569 ok.String(*v.BotVersion) 2570 } 2571 2572 if v.Checksum != nil { 2573 ok := object.Key("checksum") 2574 ok.String(*v.Checksum) 2575 } 2576 2577 if v.ConversationLogs != nil { 2578 ok := object.Key("conversationLogs") 2579 if err := awsRestjson1_serializeDocumentConversationLogsRequest(v.ConversationLogs, ok); err != nil { 2580 return err 2581 } 2582 } 2583 2584 if v.Description != nil { 2585 ok := object.Key("description") 2586 ok.String(*v.Description) 2587 } 2588 2589 if v.Tags != nil { 2590 ok := object.Key("tags") 2591 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 2592 return err 2593 } 2594 } 2595 2596 return nil 2597} 2598 2599type awsRestjson1_serializeOpPutIntent struct { 2600} 2601 2602func (*awsRestjson1_serializeOpPutIntent) ID() string { 2603 return "OperationSerializer" 2604} 2605 2606func (m *awsRestjson1_serializeOpPutIntent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2607 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2608) { 2609 request, ok := in.Request.(*smithyhttp.Request) 2610 if !ok { 2611 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2612 } 2613 2614 input, ok := in.Parameters.(*PutIntentInput) 2615 _ = input 2616 if !ok { 2617 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2618 } 2619 2620 opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions/$LATEST") 2621 request.URL.Path = opPath 2622 if len(request.URL.RawQuery) > 0 { 2623 request.URL.RawQuery = "&" + opQuery 2624 } else { 2625 request.URL.RawQuery = opQuery 2626 } 2627 2628 request.Method = "PUT" 2629 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2630 if err != nil { 2631 return out, metadata, &smithy.SerializationError{Err: err} 2632 } 2633 2634 if err := awsRestjson1_serializeOpHttpBindingsPutIntentInput(input, restEncoder); err != nil { 2635 return out, metadata, &smithy.SerializationError{Err: err} 2636 } 2637 2638 restEncoder.SetHeader("Content-Type").String("application/json") 2639 2640 jsonEncoder := smithyjson.NewEncoder() 2641 if err := awsRestjson1_serializeOpDocumentPutIntentInput(input, jsonEncoder.Value); err != nil { 2642 return out, metadata, &smithy.SerializationError{Err: err} 2643 } 2644 2645 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2646 return out, metadata, &smithy.SerializationError{Err: err} 2647 } 2648 2649 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2650 return out, metadata, &smithy.SerializationError{Err: err} 2651 } 2652 in.Request = request 2653 2654 return next.HandleSerialize(ctx, in) 2655} 2656func awsRestjson1_serializeOpHttpBindingsPutIntentInput(v *PutIntentInput, encoder *httpbinding.Encoder) error { 2657 if v == nil { 2658 return fmt.Errorf("unsupported serialization of nil %T", v) 2659 } 2660 2661 if v.Name == nil || len(*v.Name) == 0 { 2662 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 2663 } 2664 if v.Name != nil { 2665 if err := encoder.SetURI("name").String(*v.Name); err != nil { 2666 return err 2667 } 2668 } 2669 2670 return nil 2671} 2672 2673func awsRestjson1_serializeOpDocumentPutIntentInput(v *PutIntentInput, value smithyjson.Value) error { 2674 object := value.Object() 2675 defer object.Close() 2676 2677 if v.Checksum != nil { 2678 ok := object.Key("checksum") 2679 ok.String(*v.Checksum) 2680 } 2681 2682 if v.ConclusionStatement != nil { 2683 ok := object.Key("conclusionStatement") 2684 if err := awsRestjson1_serializeDocumentStatement(v.ConclusionStatement, ok); err != nil { 2685 return err 2686 } 2687 } 2688 2689 if v.ConfirmationPrompt != nil { 2690 ok := object.Key("confirmationPrompt") 2691 if err := awsRestjson1_serializeDocumentPrompt(v.ConfirmationPrompt, ok); err != nil { 2692 return err 2693 } 2694 } 2695 2696 if v.CreateVersion != nil { 2697 ok := object.Key("createVersion") 2698 ok.Boolean(*v.CreateVersion) 2699 } 2700 2701 if v.Description != nil { 2702 ok := object.Key("description") 2703 ok.String(*v.Description) 2704 } 2705 2706 if v.DialogCodeHook != nil { 2707 ok := object.Key("dialogCodeHook") 2708 if err := awsRestjson1_serializeDocumentCodeHook(v.DialogCodeHook, ok); err != nil { 2709 return err 2710 } 2711 } 2712 2713 if v.FollowUpPrompt != nil { 2714 ok := object.Key("followUpPrompt") 2715 if err := awsRestjson1_serializeDocumentFollowUpPrompt(v.FollowUpPrompt, ok); err != nil { 2716 return err 2717 } 2718 } 2719 2720 if v.FulfillmentActivity != nil { 2721 ok := object.Key("fulfillmentActivity") 2722 if err := awsRestjson1_serializeDocumentFulfillmentActivity(v.FulfillmentActivity, ok); err != nil { 2723 return err 2724 } 2725 } 2726 2727 if v.InputContexts != nil { 2728 ok := object.Key("inputContexts") 2729 if err := awsRestjson1_serializeDocumentInputContextList(v.InputContexts, ok); err != nil { 2730 return err 2731 } 2732 } 2733 2734 if v.KendraConfiguration != nil { 2735 ok := object.Key("kendraConfiguration") 2736 if err := awsRestjson1_serializeDocumentKendraConfiguration(v.KendraConfiguration, ok); err != nil { 2737 return err 2738 } 2739 } 2740 2741 if v.OutputContexts != nil { 2742 ok := object.Key("outputContexts") 2743 if err := awsRestjson1_serializeDocumentOutputContextList(v.OutputContexts, ok); err != nil { 2744 return err 2745 } 2746 } 2747 2748 if v.ParentIntentSignature != nil { 2749 ok := object.Key("parentIntentSignature") 2750 ok.String(*v.ParentIntentSignature) 2751 } 2752 2753 if v.RejectionStatement != nil { 2754 ok := object.Key("rejectionStatement") 2755 if err := awsRestjson1_serializeDocumentStatement(v.RejectionStatement, ok); err != nil { 2756 return err 2757 } 2758 } 2759 2760 if v.SampleUtterances != nil { 2761 ok := object.Key("sampleUtterances") 2762 if err := awsRestjson1_serializeDocumentIntentUtteranceList(v.SampleUtterances, ok); err != nil { 2763 return err 2764 } 2765 } 2766 2767 if v.Slots != nil { 2768 ok := object.Key("slots") 2769 if err := awsRestjson1_serializeDocumentSlotList(v.Slots, ok); err != nil { 2770 return err 2771 } 2772 } 2773 2774 return nil 2775} 2776 2777type awsRestjson1_serializeOpPutSlotType struct { 2778} 2779 2780func (*awsRestjson1_serializeOpPutSlotType) ID() string { 2781 return "OperationSerializer" 2782} 2783 2784func (m *awsRestjson1_serializeOpPutSlotType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2785 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2786) { 2787 request, ok := in.Request.(*smithyhttp.Request) 2788 if !ok { 2789 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2790 } 2791 2792 input, ok := in.Parameters.(*PutSlotTypeInput) 2793 _ = input 2794 if !ok { 2795 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2796 } 2797 2798 opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions/$LATEST") 2799 request.URL.Path = opPath 2800 if len(request.URL.RawQuery) > 0 { 2801 request.URL.RawQuery = "&" + opQuery 2802 } else { 2803 request.URL.RawQuery = opQuery 2804 } 2805 2806 request.Method = "PUT" 2807 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2808 if err != nil { 2809 return out, metadata, &smithy.SerializationError{Err: err} 2810 } 2811 2812 if err := awsRestjson1_serializeOpHttpBindingsPutSlotTypeInput(input, restEncoder); err != nil { 2813 return out, metadata, &smithy.SerializationError{Err: err} 2814 } 2815 2816 restEncoder.SetHeader("Content-Type").String("application/json") 2817 2818 jsonEncoder := smithyjson.NewEncoder() 2819 if err := awsRestjson1_serializeOpDocumentPutSlotTypeInput(input, jsonEncoder.Value); err != nil { 2820 return out, metadata, &smithy.SerializationError{Err: err} 2821 } 2822 2823 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2824 return out, metadata, &smithy.SerializationError{Err: err} 2825 } 2826 2827 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2828 return out, metadata, &smithy.SerializationError{Err: err} 2829 } 2830 in.Request = request 2831 2832 return next.HandleSerialize(ctx, in) 2833} 2834func awsRestjson1_serializeOpHttpBindingsPutSlotTypeInput(v *PutSlotTypeInput, encoder *httpbinding.Encoder) error { 2835 if v == nil { 2836 return fmt.Errorf("unsupported serialization of nil %T", v) 2837 } 2838 2839 if v.Name == nil || len(*v.Name) == 0 { 2840 return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")} 2841 } 2842 if v.Name != nil { 2843 if err := encoder.SetURI("name").String(*v.Name); err != nil { 2844 return err 2845 } 2846 } 2847 2848 return nil 2849} 2850 2851func awsRestjson1_serializeOpDocumentPutSlotTypeInput(v *PutSlotTypeInput, value smithyjson.Value) error { 2852 object := value.Object() 2853 defer object.Close() 2854 2855 if v.Checksum != nil { 2856 ok := object.Key("checksum") 2857 ok.String(*v.Checksum) 2858 } 2859 2860 if v.CreateVersion != nil { 2861 ok := object.Key("createVersion") 2862 ok.Boolean(*v.CreateVersion) 2863 } 2864 2865 if v.Description != nil { 2866 ok := object.Key("description") 2867 ok.String(*v.Description) 2868 } 2869 2870 if v.EnumerationValues != nil { 2871 ok := object.Key("enumerationValues") 2872 if err := awsRestjson1_serializeDocumentEnumerationValues(v.EnumerationValues, ok); err != nil { 2873 return err 2874 } 2875 } 2876 2877 if v.ParentSlotTypeSignature != nil { 2878 ok := object.Key("parentSlotTypeSignature") 2879 ok.String(*v.ParentSlotTypeSignature) 2880 } 2881 2882 if v.SlotTypeConfigurations != nil { 2883 ok := object.Key("slotTypeConfigurations") 2884 if err := awsRestjson1_serializeDocumentSlotTypeConfigurations(v.SlotTypeConfigurations, ok); err != nil { 2885 return err 2886 } 2887 } 2888 2889 if len(v.ValueSelectionStrategy) > 0 { 2890 ok := object.Key("valueSelectionStrategy") 2891 ok.String(string(v.ValueSelectionStrategy)) 2892 } 2893 2894 return nil 2895} 2896 2897type awsRestjson1_serializeOpStartImport struct { 2898} 2899 2900func (*awsRestjson1_serializeOpStartImport) ID() string { 2901 return "OperationSerializer" 2902} 2903 2904func (m *awsRestjson1_serializeOpStartImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2905 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2906) { 2907 request, ok := in.Request.(*smithyhttp.Request) 2908 if !ok { 2909 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2910 } 2911 2912 input, ok := in.Parameters.(*StartImportInput) 2913 _ = input 2914 if !ok { 2915 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2916 } 2917 2918 opPath, opQuery := httpbinding.SplitURI("/imports") 2919 request.URL.Path = opPath 2920 if len(request.URL.RawQuery) > 0 { 2921 request.URL.RawQuery = "&" + opQuery 2922 } else { 2923 request.URL.RawQuery = opQuery 2924 } 2925 2926 request.Method = "POST" 2927 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2928 if err != nil { 2929 return out, metadata, &smithy.SerializationError{Err: err} 2930 } 2931 2932 restEncoder.SetHeader("Content-Type").String("application/json") 2933 2934 jsonEncoder := smithyjson.NewEncoder() 2935 if err := awsRestjson1_serializeOpDocumentStartImportInput(input, jsonEncoder.Value); err != nil { 2936 return out, metadata, &smithy.SerializationError{Err: err} 2937 } 2938 2939 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2940 return out, metadata, &smithy.SerializationError{Err: err} 2941 } 2942 2943 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2944 return out, metadata, &smithy.SerializationError{Err: err} 2945 } 2946 in.Request = request 2947 2948 return next.HandleSerialize(ctx, in) 2949} 2950func awsRestjson1_serializeOpHttpBindingsStartImportInput(v *StartImportInput, encoder *httpbinding.Encoder) error { 2951 if v == nil { 2952 return fmt.Errorf("unsupported serialization of nil %T", v) 2953 } 2954 2955 return nil 2956} 2957 2958func awsRestjson1_serializeOpDocumentStartImportInput(v *StartImportInput, value smithyjson.Value) error { 2959 object := value.Object() 2960 defer object.Close() 2961 2962 if len(v.MergeStrategy) > 0 { 2963 ok := object.Key("mergeStrategy") 2964 ok.String(string(v.MergeStrategy)) 2965 } 2966 2967 if v.Payload != nil { 2968 ok := object.Key("payload") 2969 ok.Base64EncodeBytes(v.Payload) 2970 } 2971 2972 if len(v.ResourceType) > 0 { 2973 ok := object.Key("resourceType") 2974 ok.String(string(v.ResourceType)) 2975 } 2976 2977 if v.Tags != nil { 2978 ok := object.Key("tags") 2979 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 2980 return err 2981 } 2982 } 2983 2984 return nil 2985} 2986 2987type awsRestjson1_serializeOpTagResource struct { 2988} 2989 2990func (*awsRestjson1_serializeOpTagResource) ID() string { 2991 return "OperationSerializer" 2992} 2993 2994func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2995 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2996) { 2997 request, ok := in.Request.(*smithyhttp.Request) 2998 if !ok { 2999 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3000 } 3001 3002 input, ok := in.Parameters.(*TagResourceInput) 3003 _ = input 3004 if !ok { 3005 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3006 } 3007 3008 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 3009 request.URL.Path = opPath 3010 if len(request.URL.RawQuery) > 0 { 3011 request.URL.RawQuery = "&" + opQuery 3012 } else { 3013 request.URL.RawQuery = opQuery 3014 } 3015 3016 request.Method = "POST" 3017 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3018 if err != nil { 3019 return out, metadata, &smithy.SerializationError{Err: err} 3020 } 3021 3022 if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { 3023 return out, metadata, &smithy.SerializationError{Err: err} 3024 } 3025 3026 restEncoder.SetHeader("Content-Type").String("application/json") 3027 3028 jsonEncoder := smithyjson.NewEncoder() 3029 if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { 3030 return out, metadata, &smithy.SerializationError{Err: err} 3031 } 3032 3033 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3034 return out, metadata, &smithy.SerializationError{Err: err} 3035 } 3036 3037 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3038 return out, metadata, &smithy.SerializationError{Err: err} 3039 } 3040 in.Request = request 3041 3042 return next.HandleSerialize(ctx, in) 3043} 3044func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { 3045 if v == nil { 3046 return fmt.Errorf("unsupported serialization of nil %T", v) 3047 } 3048 3049 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 3050 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 3051 } 3052 if v.ResourceArn != nil { 3053 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 3054 return err 3055 } 3056 } 3057 3058 return nil 3059} 3060 3061func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { 3062 object := value.Object() 3063 defer object.Close() 3064 3065 if v.Tags != nil { 3066 ok := object.Key("tags") 3067 if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { 3068 return err 3069 } 3070 } 3071 3072 return nil 3073} 3074 3075type awsRestjson1_serializeOpUntagResource struct { 3076} 3077 3078func (*awsRestjson1_serializeOpUntagResource) ID() string { 3079 return "OperationSerializer" 3080} 3081 3082func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3083 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3084) { 3085 request, ok := in.Request.(*smithyhttp.Request) 3086 if !ok { 3087 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3088 } 3089 3090 input, ok := in.Parameters.(*UntagResourceInput) 3091 _ = input 3092 if !ok { 3093 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3094 } 3095 3096 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 3097 request.URL.Path = opPath 3098 if len(request.URL.RawQuery) > 0 { 3099 request.URL.RawQuery = "&" + opQuery 3100 } else { 3101 request.URL.RawQuery = opQuery 3102 } 3103 3104 request.Method = "DELETE" 3105 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3106 if err != nil { 3107 return out, metadata, &smithy.SerializationError{Err: err} 3108 } 3109 3110 if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { 3111 return out, metadata, &smithy.SerializationError{Err: err} 3112 } 3113 3114 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3115 return out, metadata, &smithy.SerializationError{Err: err} 3116 } 3117 in.Request = request 3118 3119 return next.HandleSerialize(ctx, in) 3120} 3121func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { 3122 if v == nil { 3123 return fmt.Errorf("unsupported serialization of nil %T", v) 3124 } 3125 3126 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 3127 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 3128 } 3129 if v.ResourceArn != nil { 3130 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 3131 return err 3132 } 3133 } 3134 3135 if v.TagKeys != nil { 3136 for i := range v.TagKeys { 3137 encoder.AddQuery("tagKeys").String(v.TagKeys[i]) 3138 } 3139 } 3140 3141 return nil 3142} 3143 3144func awsRestjson1_serializeDocumentCodeHook(v *types.CodeHook, value smithyjson.Value) error { 3145 object := value.Object() 3146 defer object.Close() 3147 3148 if v.MessageVersion != nil { 3149 ok := object.Key("messageVersion") 3150 ok.String(*v.MessageVersion) 3151 } 3152 3153 if v.Uri != nil { 3154 ok := object.Key("uri") 3155 ok.String(*v.Uri) 3156 } 3157 3158 return nil 3159} 3160 3161func awsRestjson1_serializeDocumentConversationLogsRequest(v *types.ConversationLogsRequest, value smithyjson.Value) error { 3162 object := value.Object() 3163 defer object.Close() 3164 3165 if v.IamRoleArn != nil { 3166 ok := object.Key("iamRoleArn") 3167 ok.String(*v.IamRoleArn) 3168 } 3169 3170 if v.LogSettings != nil { 3171 ok := object.Key("logSettings") 3172 if err := awsRestjson1_serializeDocumentLogSettingsRequestList(v.LogSettings, ok); err != nil { 3173 return err 3174 } 3175 } 3176 3177 return nil 3178} 3179 3180func awsRestjson1_serializeDocumentEnumerationValue(v *types.EnumerationValue, value smithyjson.Value) error { 3181 object := value.Object() 3182 defer object.Close() 3183 3184 if v.Synonyms != nil { 3185 ok := object.Key("synonyms") 3186 if err := awsRestjson1_serializeDocumentSynonymList(v.Synonyms, ok); err != nil { 3187 return err 3188 } 3189 } 3190 3191 if v.Value != nil { 3192 ok := object.Key("value") 3193 ok.String(*v.Value) 3194 } 3195 3196 return nil 3197} 3198 3199func awsRestjson1_serializeDocumentEnumerationValues(v []types.EnumerationValue, value smithyjson.Value) error { 3200 array := value.Array() 3201 defer array.Close() 3202 3203 for i := range v { 3204 av := array.Value() 3205 if err := awsRestjson1_serializeDocumentEnumerationValue(&v[i], av); err != nil { 3206 return err 3207 } 3208 } 3209 return nil 3210} 3211 3212func awsRestjson1_serializeDocumentFollowUpPrompt(v *types.FollowUpPrompt, value smithyjson.Value) error { 3213 object := value.Object() 3214 defer object.Close() 3215 3216 if v.Prompt != nil { 3217 ok := object.Key("prompt") 3218 if err := awsRestjson1_serializeDocumentPrompt(v.Prompt, ok); err != nil { 3219 return err 3220 } 3221 } 3222 3223 if v.RejectionStatement != nil { 3224 ok := object.Key("rejectionStatement") 3225 if err := awsRestjson1_serializeDocumentStatement(v.RejectionStatement, ok); err != nil { 3226 return err 3227 } 3228 } 3229 3230 return nil 3231} 3232 3233func awsRestjson1_serializeDocumentFulfillmentActivity(v *types.FulfillmentActivity, value smithyjson.Value) error { 3234 object := value.Object() 3235 defer object.Close() 3236 3237 if v.CodeHook != nil { 3238 ok := object.Key("codeHook") 3239 if err := awsRestjson1_serializeDocumentCodeHook(v.CodeHook, ok); err != nil { 3240 return err 3241 } 3242 } 3243 3244 if len(v.Type) > 0 { 3245 ok := object.Key("type") 3246 ok.String(string(v.Type)) 3247 } 3248 3249 return nil 3250} 3251 3252func awsRestjson1_serializeDocumentInputContext(v *types.InputContext, value smithyjson.Value) error { 3253 object := value.Object() 3254 defer object.Close() 3255 3256 if v.Name != nil { 3257 ok := object.Key("name") 3258 ok.String(*v.Name) 3259 } 3260 3261 return nil 3262} 3263 3264func awsRestjson1_serializeDocumentInputContextList(v []types.InputContext, value smithyjson.Value) error { 3265 array := value.Array() 3266 defer array.Close() 3267 3268 for i := range v { 3269 av := array.Value() 3270 if err := awsRestjson1_serializeDocumentInputContext(&v[i], av); err != nil { 3271 return err 3272 } 3273 } 3274 return nil 3275} 3276 3277func awsRestjson1_serializeDocumentIntent(v *types.Intent, value smithyjson.Value) error { 3278 object := value.Object() 3279 defer object.Close() 3280 3281 if v.IntentName != nil { 3282 ok := object.Key("intentName") 3283 ok.String(*v.IntentName) 3284 } 3285 3286 if v.IntentVersion != nil { 3287 ok := object.Key("intentVersion") 3288 ok.String(*v.IntentVersion) 3289 } 3290 3291 return nil 3292} 3293 3294func awsRestjson1_serializeDocumentIntentList(v []types.Intent, value smithyjson.Value) error { 3295 array := value.Array() 3296 defer array.Close() 3297 3298 for i := range v { 3299 av := array.Value() 3300 if err := awsRestjson1_serializeDocumentIntent(&v[i], av); err != nil { 3301 return err 3302 } 3303 } 3304 return nil 3305} 3306 3307func awsRestjson1_serializeDocumentIntentUtteranceList(v []string, value smithyjson.Value) error { 3308 array := value.Array() 3309 defer array.Close() 3310 3311 for i := range v { 3312 av := array.Value() 3313 av.String(v[i]) 3314 } 3315 return nil 3316} 3317 3318func awsRestjson1_serializeDocumentKendraConfiguration(v *types.KendraConfiguration, value smithyjson.Value) error { 3319 object := value.Object() 3320 defer object.Close() 3321 3322 if v.KendraIndex != nil { 3323 ok := object.Key("kendraIndex") 3324 ok.String(*v.KendraIndex) 3325 } 3326 3327 if v.QueryFilterString != nil { 3328 ok := object.Key("queryFilterString") 3329 ok.String(*v.QueryFilterString) 3330 } 3331 3332 if v.Role != nil { 3333 ok := object.Key("role") 3334 ok.String(*v.Role) 3335 } 3336 3337 return nil 3338} 3339 3340func awsRestjson1_serializeDocumentLogSettingsRequest(v *types.LogSettingsRequest, value smithyjson.Value) error { 3341 object := value.Object() 3342 defer object.Close() 3343 3344 if len(v.Destination) > 0 { 3345 ok := object.Key("destination") 3346 ok.String(string(v.Destination)) 3347 } 3348 3349 if v.KmsKeyArn != nil { 3350 ok := object.Key("kmsKeyArn") 3351 ok.String(*v.KmsKeyArn) 3352 } 3353 3354 if len(v.LogType) > 0 { 3355 ok := object.Key("logType") 3356 ok.String(string(v.LogType)) 3357 } 3358 3359 if v.ResourceArn != nil { 3360 ok := object.Key("resourceArn") 3361 ok.String(*v.ResourceArn) 3362 } 3363 3364 return nil 3365} 3366 3367func awsRestjson1_serializeDocumentLogSettingsRequestList(v []types.LogSettingsRequest, value smithyjson.Value) error { 3368 array := value.Array() 3369 defer array.Close() 3370 3371 for i := range v { 3372 av := array.Value() 3373 if err := awsRestjson1_serializeDocumentLogSettingsRequest(&v[i], av); err != nil { 3374 return err 3375 } 3376 } 3377 return nil 3378} 3379 3380func awsRestjson1_serializeDocumentMessage(v *types.Message, value smithyjson.Value) error { 3381 object := value.Object() 3382 defer object.Close() 3383 3384 if v.Content != nil { 3385 ok := object.Key("content") 3386 ok.String(*v.Content) 3387 } 3388 3389 if len(v.ContentType) > 0 { 3390 ok := object.Key("contentType") 3391 ok.String(string(v.ContentType)) 3392 } 3393 3394 if v.GroupNumber != nil { 3395 ok := object.Key("groupNumber") 3396 ok.Integer(*v.GroupNumber) 3397 } 3398 3399 return nil 3400} 3401 3402func awsRestjson1_serializeDocumentMessageList(v []types.Message, value smithyjson.Value) error { 3403 array := value.Array() 3404 defer array.Close() 3405 3406 for i := range v { 3407 av := array.Value() 3408 if err := awsRestjson1_serializeDocumentMessage(&v[i], av); err != nil { 3409 return err 3410 } 3411 } 3412 return nil 3413} 3414 3415func awsRestjson1_serializeDocumentOutputContext(v *types.OutputContext, value smithyjson.Value) error { 3416 object := value.Object() 3417 defer object.Close() 3418 3419 if v.Name != nil { 3420 ok := object.Key("name") 3421 ok.String(*v.Name) 3422 } 3423 3424 if v.TimeToLiveInSeconds != nil { 3425 ok := object.Key("timeToLiveInSeconds") 3426 ok.Integer(*v.TimeToLiveInSeconds) 3427 } 3428 3429 if v.TurnsToLive != nil { 3430 ok := object.Key("turnsToLive") 3431 ok.Integer(*v.TurnsToLive) 3432 } 3433 3434 return nil 3435} 3436 3437func awsRestjson1_serializeDocumentOutputContextList(v []types.OutputContext, value smithyjson.Value) error { 3438 array := value.Array() 3439 defer array.Close() 3440 3441 for i := range v { 3442 av := array.Value() 3443 if err := awsRestjson1_serializeDocumentOutputContext(&v[i], av); err != nil { 3444 return err 3445 } 3446 } 3447 return nil 3448} 3449 3450func awsRestjson1_serializeDocumentPrompt(v *types.Prompt, value smithyjson.Value) error { 3451 object := value.Object() 3452 defer object.Close() 3453 3454 if v.MaxAttempts != nil { 3455 ok := object.Key("maxAttempts") 3456 ok.Integer(*v.MaxAttempts) 3457 } 3458 3459 if v.Messages != nil { 3460 ok := object.Key("messages") 3461 if err := awsRestjson1_serializeDocumentMessageList(v.Messages, ok); err != nil { 3462 return err 3463 } 3464 } 3465 3466 if v.ResponseCard != nil { 3467 ok := object.Key("responseCard") 3468 ok.String(*v.ResponseCard) 3469 } 3470 3471 return nil 3472} 3473 3474func awsRestjson1_serializeDocumentSlot(v *types.Slot, value smithyjson.Value) error { 3475 object := value.Object() 3476 defer object.Close() 3477 3478 if v.DefaultValueSpec != nil { 3479 ok := object.Key("defaultValueSpec") 3480 if err := awsRestjson1_serializeDocumentSlotDefaultValueSpec(v.DefaultValueSpec, ok); err != nil { 3481 return err 3482 } 3483 } 3484 3485 if v.Description != nil { 3486 ok := object.Key("description") 3487 ok.String(*v.Description) 3488 } 3489 3490 if v.Name != nil { 3491 ok := object.Key("name") 3492 ok.String(*v.Name) 3493 } 3494 3495 if len(v.ObfuscationSetting) > 0 { 3496 ok := object.Key("obfuscationSetting") 3497 ok.String(string(v.ObfuscationSetting)) 3498 } 3499 3500 if v.Priority != nil { 3501 ok := object.Key("priority") 3502 ok.Integer(*v.Priority) 3503 } 3504 3505 if v.ResponseCard != nil { 3506 ok := object.Key("responseCard") 3507 ok.String(*v.ResponseCard) 3508 } 3509 3510 if v.SampleUtterances != nil { 3511 ok := object.Key("sampleUtterances") 3512 if err := awsRestjson1_serializeDocumentSlotUtteranceList(v.SampleUtterances, ok); err != nil { 3513 return err 3514 } 3515 } 3516 3517 if len(v.SlotConstraint) > 0 { 3518 ok := object.Key("slotConstraint") 3519 ok.String(string(v.SlotConstraint)) 3520 } 3521 3522 if v.SlotType != nil { 3523 ok := object.Key("slotType") 3524 ok.String(*v.SlotType) 3525 } 3526 3527 if v.SlotTypeVersion != nil { 3528 ok := object.Key("slotTypeVersion") 3529 ok.String(*v.SlotTypeVersion) 3530 } 3531 3532 if v.ValueElicitationPrompt != nil { 3533 ok := object.Key("valueElicitationPrompt") 3534 if err := awsRestjson1_serializeDocumentPrompt(v.ValueElicitationPrompt, ok); err != nil { 3535 return err 3536 } 3537 } 3538 3539 return nil 3540} 3541 3542func awsRestjson1_serializeDocumentSlotDefaultValue(v *types.SlotDefaultValue, value smithyjson.Value) error { 3543 object := value.Object() 3544 defer object.Close() 3545 3546 if v.DefaultValue != nil { 3547 ok := object.Key("defaultValue") 3548 ok.String(*v.DefaultValue) 3549 } 3550 3551 return nil 3552} 3553 3554func awsRestjson1_serializeDocumentSlotDefaultValueList(v []types.SlotDefaultValue, value smithyjson.Value) error { 3555 array := value.Array() 3556 defer array.Close() 3557 3558 for i := range v { 3559 av := array.Value() 3560 if err := awsRestjson1_serializeDocumentSlotDefaultValue(&v[i], av); err != nil { 3561 return err 3562 } 3563 } 3564 return nil 3565} 3566 3567func awsRestjson1_serializeDocumentSlotDefaultValueSpec(v *types.SlotDefaultValueSpec, value smithyjson.Value) error { 3568 object := value.Object() 3569 defer object.Close() 3570 3571 if v.DefaultValueList != nil { 3572 ok := object.Key("defaultValueList") 3573 if err := awsRestjson1_serializeDocumentSlotDefaultValueList(v.DefaultValueList, ok); err != nil { 3574 return err 3575 } 3576 } 3577 3578 return nil 3579} 3580 3581func awsRestjson1_serializeDocumentSlotList(v []types.Slot, value smithyjson.Value) error { 3582 array := value.Array() 3583 defer array.Close() 3584 3585 for i := range v { 3586 av := array.Value() 3587 if err := awsRestjson1_serializeDocumentSlot(&v[i], av); err != nil { 3588 return err 3589 } 3590 } 3591 return nil 3592} 3593 3594func awsRestjson1_serializeDocumentSlotTypeConfiguration(v *types.SlotTypeConfiguration, value smithyjson.Value) error { 3595 object := value.Object() 3596 defer object.Close() 3597 3598 if v.RegexConfiguration != nil { 3599 ok := object.Key("regexConfiguration") 3600 if err := awsRestjson1_serializeDocumentSlotTypeRegexConfiguration(v.RegexConfiguration, ok); err != nil { 3601 return err 3602 } 3603 } 3604 3605 return nil 3606} 3607 3608func awsRestjson1_serializeDocumentSlotTypeConfigurations(v []types.SlotTypeConfiguration, value smithyjson.Value) error { 3609 array := value.Array() 3610 defer array.Close() 3611 3612 for i := range v { 3613 av := array.Value() 3614 if err := awsRestjson1_serializeDocumentSlotTypeConfiguration(&v[i], av); err != nil { 3615 return err 3616 } 3617 } 3618 return nil 3619} 3620 3621func awsRestjson1_serializeDocumentSlotTypeRegexConfiguration(v *types.SlotTypeRegexConfiguration, value smithyjson.Value) error { 3622 object := value.Object() 3623 defer object.Close() 3624 3625 if v.Pattern != nil { 3626 ok := object.Key("pattern") 3627 ok.String(*v.Pattern) 3628 } 3629 3630 return nil 3631} 3632 3633func awsRestjson1_serializeDocumentSlotUtteranceList(v []string, value smithyjson.Value) error { 3634 array := value.Array() 3635 defer array.Close() 3636 3637 for i := range v { 3638 av := array.Value() 3639 av.String(v[i]) 3640 } 3641 return nil 3642} 3643 3644func awsRestjson1_serializeDocumentStatement(v *types.Statement, value smithyjson.Value) error { 3645 object := value.Object() 3646 defer object.Close() 3647 3648 if v.Messages != nil { 3649 ok := object.Key("messages") 3650 if err := awsRestjson1_serializeDocumentMessageList(v.Messages, ok); err != nil { 3651 return err 3652 } 3653 } 3654 3655 if v.ResponseCard != nil { 3656 ok := object.Key("responseCard") 3657 ok.String(*v.ResponseCard) 3658 } 3659 3660 return nil 3661} 3662 3663func awsRestjson1_serializeDocumentSynonymList(v []string, value smithyjson.Value) error { 3664 array := value.Array() 3665 defer array.Close() 3666 3667 for i := range v { 3668 av := array.Value() 3669 av.String(v[i]) 3670 } 3671 return nil 3672} 3673 3674func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { 3675 object := value.Object() 3676 defer object.Close() 3677 3678 if v.Key != nil { 3679 ok := object.Key("key") 3680 ok.String(*v.Key) 3681 } 3682 3683 if v.Value != nil { 3684 ok := object.Key("value") 3685 ok.String(*v.Value) 3686 } 3687 3688 return nil 3689} 3690 3691func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { 3692 array := value.Array() 3693 defer array.Close() 3694 3695 for i := range v { 3696 av := array.Value() 3697 if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { 3698 return err 3699 } 3700 } 3701 return nil 3702} 3703