1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package lexruntimeservice 4 5import ( 6 "bytes" 7 "context" 8 "encoding/base64" 9 "fmt" 10 "github.com/aws/aws-sdk-go-v2/service/lexruntimeservice/types" 11 smithy "github.com/aws/smithy-go" 12 "github.com/aws/smithy-go/encoding/httpbinding" 13 smithyjson "github.com/aws/smithy-go/encoding/json" 14 "github.com/aws/smithy-go/middleware" 15 "github.com/aws/smithy-go/ptr" 16 smithyhttp "github.com/aws/smithy-go/transport/http" 17) 18 19type awsRestjson1_serializeOpDeleteSession struct { 20} 21 22func (*awsRestjson1_serializeOpDeleteSession) ID() string { 23 return "OperationSerializer" 24} 25 26func (m *awsRestjson1_serializeOpDeleteSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 27 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 28) { 29 request, ok := in.Request.(*smithyhttp.Request) 30 if !ok { 31 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 32 } 33 34 input, ok := in.Parameters.(*DeleteSessionInput) 35 _ = input 36 if !ok { 37 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 38 } 39 40 opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/session") 41 request.URL.Path = opPath 42 if len(request.URL.RawQuery) > 0 { 43 request.URL.RawQuery = "&" + opQuery 44 } else { 45 request.URL.RawQuery = opQuery 46 } 47 48 request.Method = "DELETE" 49 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 50 if err != nil { 51 return out, metadata, &smithy.SerializationError{Err: err} 52 } 53 54 if err := awsRestjson1_serializeOpHttpBindingsDeleteSessionInput(input, restEncoder); err != nil { 55 return out, metadata, &smithy.SerializationError{Err: err} 56 } 57 58 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 59 return out, metadata, &smithy.SerializationError{Err: err} 60 } 61 in.Request = request 62 63 return next.HandleSerialize(ctx, in) 64} 65func awsRestjson1_serializeOpHttpBindingsDeleteSessionInput(v *DeleteSessionInput, encoder *httpbinding.Encoder) error { 66 if v == nil { 67 return fmt.Errorf("unsupported serialization of nil %T", v) 68 } 69 70 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 71 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 72 } 73 if v.BotAlias != nil { 74 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 75 return err 76 } 77 } 78 79 if v.BotName == nil || len(*v.BotName) == 0 { 80 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 81 } 82 if v.BotName != nil { 83 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 84 return err 85 } 86 } 87 88 if v.UserId == nil || len(*v.UserId) == 0 { 89 return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")} 90 } 91 if v.UserId != nil { 92 if err := encoder.SetURI("userId").String(*v.UserId); err != nil { 93 return err 94 } 95 } 96 97 return nil 98} 99 100type awsRestjson1_serializeOpGetSession struct { 101} 102 103func (*awsRestjson1_serializeOpGetSession) ID() string { 104 return "OperationSerializer" 105} 106 107func (m *awsRestjson1_serializeOpGetSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 108 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 109) { 110 request, ok := in.Request.(*smithyhttp.Request) 111 if !ok { 112 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 113 } 114 115 input, ok := in.Parameters.(*GetSessionInput) 116 _ = input 117 if !ok { 118 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 119 } 120 121 opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/session") 122 request.URL.Path = opPath 123 if len(request.URL.RawQuery) > 0 { 124 request.URL.RawQuery = "&" + opQuery 125 } else { 126 request.URL.RawQuery = opQuery 127 } 128 129 request.Method = "GET" 130 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 131 if err != nil { 132 return out, metadata, &smithy.SerializationError{Err: err} 133 } 134 135 if err := awsRestjson1_serializeOpHttpBindingsGetSessionInput(input, restEncoder); err != nil { 136 return out, metadata, &smithy.SerializationError{Err: err} 137 } 138 139 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 140 return out, metadata, &smithy.SerializationError{Err: err} 141 } 142 in.Request = request 143 144 return next.HandleSerialize(ctx, in) 145} 146func awsRestjson1_serializeOpHttpBindingsGetSessionInput(v *GetSessionInput, encoder *httpbinding.Encoder) error { 147 if v == nil { 148 return fmt.Errorf("unsupported serialization of nil %T", v) 149 } 150 151 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 152 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 153 } 154 if v.BotAlias != nil { 155 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 156 return err 157 } 158 } 159 160 if v.BotName == nil || len(*v.BotName) == 0 { 161 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 162 } 163 if v.BotName != nil { 164 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 165 return err 166 } 167 } 168 169 if v.CheckpointLabelFilter != nil { 170 encoder.SetQuery("checkpointLabelFilter").String(*v.CheckpointLabelFilter) 171 } 172 173 if v.UserId == nil || len(*v.UserId) == 0 { 174 return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")} 175 } 176 if v.UserId != nil { 177 if err := encoder.SetURI("userId").String(*v.UserId); err != nil { 178 return err 179 } 180 } 181 182 return nil 183} 184 185type awsRestjson1_serializeOpPostContent struct { 186} 187 188func (*awsRestjson1_serializeOpPostContent) ID() string { 189 return "OperationSerializer" 190} 191 192func (m *awsRestjson1_serializeOpPostContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 193 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 194) { 195 request, ok := in.Request.(*smithyhttp.Request) 196 if !ok { 197 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 198 } 199 200 input, ok := in.Parameters.(*PostContentInput) 201 _ = input 202 if !ok { 203 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 204 } 205 206 opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/content") 207 request.URL.Path = opPath 208 if len(request.URL.RawQuery) > 0 { 209 request.URL.RawQuery = "&" + opQuery 210 } else { 211 request.URL.RawQuery = opQuery 212 } 213 214 request.Method = "POST" 215 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 216 if err != nil { 217 return out, metadata, &smithy.SerializationError{Err: err} 218 } 219 220 if err := awsRestjson1_serializeOpHttpBindingsPostContentInput(input, restEncoder); err != nil { 221 return out, metadata, &smithy.SerializationError{Err: err} 222 } 223 224 if input.InputStream != nil { 225 if !restEncoder.HasHeader("Content-Type") { 226 restEncoder.SetHeader("Content-Type").String("application/octet-stream") 227 } 228 229 payload := input.InputStream 230 if request, err = request.SetStream(payload); err != nil { 231 return out, metadata, &smithy.SerializationError{Err: err} 232 } 233 } 234 235 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 236 return out, metadata, &smithy.SerializationError{Err: err} 237 } 238 in.Request = request 239 240 return next.HandleSerialize(ctx, in) 241} 242func awsRestjson1_serializeOpHttpBindingsPostContentInput(v *PostContentInput, encoder *httpbinding.Encoder) error { 243 if v == nil { 244 return fmt.Errorf("unsupported serialization of nil %T", v) 245 } 246 247 if v.Accept != nil && len(*v.Accept) > 0 { 248 locationName := "Accept" 249 encoder.SetHeader(locationName).String(*v.Accept) 250 } 251 252 if v.ActiveContexts != nil && len(*v.ActiveContexts) > 0 { 253 locationName := "X-Amz-Lex-Active-Contexts" 254 encoded := ptr.String(base64.StdEncoding.EncodeToString([]byte(*v.ActiveContexts))) 255 encoder.SetHeader(locationName).String(*encoded) 256 } 257 258 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 259 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 260 } 261 if v.BotAlias != nil { 262 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 263 return err 264 } 265 } 266 267 if v.BotName == nil || len(*v.BotName) == 0 { 268 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 269 } 270 if v.BotName != nil { 271 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 272 return err 273 } 274 } 275 276 if v.ContentType != nil && len(*v.ContentType) > 0 { 277 locationName := "Content-Type" 278 encoder.SetHeader(locationName).String(*v.ContentType) 279 } 280 281 if v.RequestAttributes != nil && len(*v.RequestAttributes) > 0 { 282 locationName := "X-Amz-Lex-Request-Attributes" 283 encoded := ptr.String(base64.StdEncoding.EncodeToString([]byte(*v.RequestAttributes))) 284 encoder.SetHeader(locationName).String(*encoded) 285 } 286 287 if v.SessionAttributes != nil && len(*v.SessionAttributes) > 0 { 288 locationName := "X-Amz-Lex-Session-Attributes" 289 encoded := ptr.String(base64.StdEncoding.EncodeToString([]byte(*v.SessionAttributes))) 290 encoder.SetHeader(locationName).String(*encoded) 291 } 292 293 if v.UserId == nil || len(*v.UserId) == 0 { 294 return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")} 295 } 296 if v.UserId != nil { 297 if err := encoder.SetURI("userId").String(*v.UserId); err != nil { 298 return err 299 } 300 } 301 302 return nil 303} 304 305type awsRestjson1_serializeOpPostText struct { 306} 307 308func (*awsRestjson1_serializeOpPostText) ID() string { 309 return "OperationSerializer" 310} 311 312func (m *awsRestjson1_serializeOpPostText) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 313 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 314) { 315 request, ok := in.Request.(*smithyhttp.Request) 316 if !ok { 317 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 318 } 319 320 input, ok := in.Parameters.(*PostTextInput) 321 _ = input 322 if !ok { 323 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 324 } 325 326 opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/text") 327 request.URL.Path = opPath 328 if len(request.URL.RawQuery) > 0 { 329 request.URL.RawQuery = "&" + opQuery 330 } else { 331 request.URL.RawQuery = opQuery 332 } 333 334 request.Method = "POST" 335 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 336 if err != nil { 337 return out, metadata, &smithy.SerializationError{Err: err} 338 } 339 340 if err := awsRestjson1_serializeOpHttpBindingsPostTextInput(input, restEncoder); err != nil { 341 return out, metadata, &smithy.SerializationError{Err: err} 342 } 343 344 restEncoder.SetHeader("Content-Type").String("application/json") 345 346 jsonEncoder := smithyjson.NewEncoder() 347 if err := awsRestjson1_serializeOpDocumentPostTextInput(input, jsonEncoder.Value); err != nil { 348 return out, metadata, &smithy.SerializationError{Err: err} 349 } 350 351 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 352 return out, metadata, &smithy.SerializationError{Err: err} 353 } 354 355 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 356 return out, metadata, &smithy.SerializationError{Err: err} 357 } 358 in.Request = request 359 360 return next.HandleSerialize(ctx, in) 361} 362func awsRestjson1_serializeOpHttpBindingsPostTextInput(v *PostTextInput, encoder *httpbinding.Encoder) error { 363 if v == nil { 364 return fmt.Errorf("unsupported serialization of nil %T", v) 365 } 366 367 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 368 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 369 } 370 if v.BotAlias != nil { 371 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 372 return err 373 } 374 } 375 376 if v.BotName == nil || len(*v.BotName) == 0 { 377 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 378 } 379 if v.BotName != nil { 380 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 381 return err 382 } 383 } 384 385 if v.UserId == nil || len(*v.UserId) == 0 { 386 return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")} 387 } 388 if v.UserId != nil { 389 if err := encoder.SetURI("userId").String(*v.UserId); err != nil { 390 return err 391 } 392 } 393 394 return nil 395} 396 397func awsRestjson1_serializeOpDocumentPostTextInput(v *PostTextInput, value smithyjson.Value) error { 398 object := value.Object() 399 defer object.Close() 400 401 if v.ActiveContexts != nil { 402 ok := object.Key("activeContexts") 403 if err := awsRestjson1_serializeDocumentActiveContextsList(v.ActiveContexts, ok); err != nil { 404 return err 405 } 406 } 407 408 if v.InputText != nil { 409 ok := object.Key("inputText") 410 ok.String(*v.InputText) 411 } 412 413 if v.RequestAttributes != nil { 414 ok := object.Key("requestAttributes") 415 if err := awsRestjson1_serializeDocumentStringMap(v.RequestAttributes, ok); err != nil { 416 return err 417 } 418 } 419 420 if v.SessionAttributes != nil { 421 ok := object.Key("sessionAttributes") 422 if err := awsRestjson1_serializeDocumentStringMap(v.SessionAttributes, ok); err != nil { 423 return err 424 } 425 } 426 427 return nil 428} 429 430type awsRestjson1_serializeOpPutSession struct { 431} 432 433func (*awsRestjson1_serializeOpPutSession) ID() string { 434 return "OperationSerializer" 435} 436 437func (m *awsRestjson1_serializeOpPutSession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 438 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 439) { 440 request, ok := in.Request.(*smithyhttp.Request) 441 if !ok { 442 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 443 } 444 445 input, ok := in.Parameters.(*PutSessionInput) 446 _ = input 447 if !ok { 448 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 449 } 450 451 opPath, opQuery := httpbinding.SplitURI("/bot/{botName}/alias/{botAlias}/user/{userId}/session") 452 request.URL.Path = opPath 453 if len(request.URL.RawQuery) > 0 { 454 request.URL.RawQuery = "&" + opQuery 455 } else { 456 request.URL.RawQuery = opQuery 457 } 458 459 request.Method = "POST" 460 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 461 if err != nil { 462 return out, metadata, &smithy.SerializationError{Err: err} 463 } 464 465 if err := awsRestjson1_serializeOpHttpBindingsPutSessionInput(input, restEncoder); err != nil { 466 return out, metadata, &smithy.SerializationError{Err: err} 467 } 468 469 restEncoder.SetHeader("Content-Type").String("application/json") 470 471 jsonEncoder := smithyjson.NewEncoder() 472 if err := awsRestjson1_serializeOpDocumentPutSessionInput(input, jsonEncoder.Value); err != nil { 473 return out, metadata, &smithy.SerializationError{Err: err} 474 } 475 476 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 477 return out, metadata, &smithy.SerializationError{Err: err} 478 } 479 480 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 481 return out, metadata, &smithy.SerializationError{Err: err} 482 } 483 in.Request = request 484 485 return next.HandleSerialize(ctx, in) 486} 487func awsRestjson1_serializeOpHttpBindingsPutSessionInput(v *PutSessionInput, encoder *httpbinding.Encoder) error { 488 if v == nil { 489 return fmt.Errorf("unsupported serialization of nil %T", v) 490 } 491 492 if v.Accept != nil && len(*v.Accept) > 0 { 493 locationName := "Accept" 494 encoder.SetHeader(locationName).String(*v.Accept) 495 } 496 497 if v.BotAlias == nil || len(*v.BotAlias) == 0 { 498 return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")} 499 } 500 if v.BotAlias != nil { 501 if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil { 502 return err 503 } 504 } 505 506 if v.BotName == nil || len(*v.BotName) == 0 { 507 return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")} 508 } 509 if v.BotName != nil { 510 if err := encoder.SetURI("botName").String(*v.BotName); err != nil { 511 return err 512 } 513 } 514 515 if v.UserId == nil || len(*v.UserId) == 0 { 516 return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")} 517 } 518 if v.UserId != nil { 519 if err := encoder.SetURI("userId").String(*v.UserId); err != nil { 520 return err 521 } 522 } 523 524 return nil 525} 526 527func awsRestjson1_serializeOpDocumentPutSessionInput(v *PutSessionInput, value smithyjson.Value) error { 528 object := value.Object() 529 defer object.Close() 530 531 if v.ActiveContexts != nil { 532 ok := object.Key("activeContexts") 533 if err := awsRestjson1_serializeDocumentActiveContextsList(v.ActiveContexts, ok); err != nil { 534 return err 535 } 536 } 537 538 if v.DialogAction != nil { 539 ok := object.Key("dialogAction") 540 if err := awsRestjson1_serializeDocumentDialogAction(v.DialogAction, ok); err != nil { 541 return err 542 } 543 } 544 545 if v.RecentIntentSummaryView != nil { 546 ok := object.Key("recentIntentSummaryView") 547 if err := awsRestjson1_serializeDocumentIntentSummaryList(v.RecentIntentSummaryView, ok); err != nil { 548 return err 549 } 550 } 551 552 if v.SessionAttributes != nil { 553 ok := object.Key("sessionAttributes") 554 if err := awsRestjson1_serializeDocumentStringMap(v.SessionAttributes, ok); err != nil { 555 return err 556 } 557 } 558 559 return nil 560} 561 562func awsRestjson1_serializeDocumentActiveContext(v *types.ActiveContext, value smithyjson.Value) error { 563 object := value.Object() 564 defer object.Close() 565 566 if v.Name != nil { 567 ok := object.Key("name") 568 ok.String(*v.Name) 569 } 570 571 if v.Parameters != nil { 572 ok := object.Key("parameters") 573 if err := awsRestjson1_serializeDocumentActiveContextParametersMap(v.Parameters, ok); err != nil { 574 return err 575 } 576 } 577 578 if v.TimeToLive != nil { 579 ok := object.Key("timeToLive") 580 if err := awsRestjson1_serializeDocumentActiveContextTimeToLive(v.TimeToLive, ok); err != nil { 581 return err 582 } 583 } 584 585 return nil 586} 587 588func awsRestjson1_serializeDocumentActiveContextParametersMap(v map[string]string, value smithyjson.Value) error { 589 object := value.Object() 590 defer object.Close() 591 592 for key := range v { 593 om := object.Key(key) 594 om.String(v[key]) 595 } 596 return nil 597} 598 599func awsRestjson1_serializeDocumentActiveContextsList(v []types.ActiveContext, value smithyjson.Value) error { 600 array := value.Array() 601 defer array.Close() 602 603 for i := range v { 604 av := array.Value() 605 if err := awsRestjson1_serializeDocumentActiveContext(&v[i], av); err != nil { 606 return err 607 } 608 } 609 return nil 610} 611 612func awsRestjson1_serializeDocumentActiveContextTimeToLive(v *types.ActiveContextTimeToLive, value smithyjson.Value) error { 613 object := value.Object() 614 defer object.Close() 615 616 if v.TimeToLiveInSeconds != nil { 617 ok := object.Key("timeToLiveInSeconds") 618 ok.Integer(*v.TimeToLiveInSeconds) 619 } 620 621 if v.TurnsToLive != nil { 622 ok := object.Key("turnsToLive") 623 ok.Integer(*v.TurnsToLive) 624 } 625 626 return nil 627} 628 629func awsRestjson1_serializeDocumentDialogAction(v *types.DialogAction, value smithyjson.Value) error { 630 object := value.Object() 631 defer object.Close() 632 633 if len(v.FulfillmentState) > 0 { 634 ok := object.Key("fulfillmentState") 635 ok.String(string(v.FulfillmentState)) 636 } 637 638 if v.IntentName != nil { 639 ok := object.Key("intentName") 640 ok.String(*v.IntentName) 641 } 642 643 if v.Message != nil { 644 ok := object.Key("message") 645 ok.String(*v.Message) 646 } 647 648 if len(v.MessageFormat) > 0 { 649 ok := object.Key("messageFormat") 650 ok.String(string(v.MessageFormat)) 651 } 652 653 if v.Slots != nil { 654 ok := object.Key("slots") 655 if err := awsRestjson1_serializeDocumentStringMap(v.Slots, ok); err != nil { 656 return err 657 } 658 } 659 660 if v.SlotToElicit != nil { 661 ok := object.Key("slotToElicit") 662 ok.String(*v.SlotToElicit) 663 } 664 665 if len(v.Type) > 0 { 666 ok := object.Key("type") 667 ok.String(string(v.Type)) 668 } 669 670 return nil 671} 672 673func awsRestjson1_serializeDocumentIntentSummary(v *types.IntentSummary, value smithyjson.Value) error { 674 object := value.Object() 675 defer object.Close() 676 677 if v.CheckpointLabel != nil { 678 ok := object.Key("checkpointLabel") 679 ok.String(*v.CheckpointLabel) 680 } 681 682 if len(v.ConfirmationStatus) > 0 { 683 ok := object.Key("confirmationStatus") 684 ok.String(string(v.ConfirmationStatus)) 685 } 686 687 if len(v.DialogActionType) > 0 { 688 ok := object.Key("dialogActionType") 689 ok.String(string(v.DialogActionType)) 690 } 691 692 if len(v.FulfillmentState) > 0 { 693 ok := object.Key("fulfillmentState") 694 ok.String(string(v.FulfillmentState)) 695 } 696 697 if v.IntentName != nil { 698 ok := object.Key("intentName") 699 ok.String(*v.IntentName) 700 } 701 702 if v.Slots != nil { 703 ok := object.Key("slots") 704 if err := awsRestjson1_serializeDocumentStringMap(v.Slots, ok); err != nil { 705 return err 706 } 707 } 708 709 if v.SlotToElicit != nil { 710 ok := object.Key("slotToElicit") 711 ok.String(*v.SlotToElicit) 712 } 713 714 return nil 715} 716 717func awsRestjson1_serializeDocumentIntentSummaryList(v []types.IntentSummary, value smithyjson.Value) error { 718 array := value.Array() 719 defer array.Close() 720 721 for i := range v { 722 av := array.Value() 723 if err := awsRestjson1_serializeDocumentIntentSummary(&v[i], av); err != nil { 724 return err 725 } 726 } 727 return nil 728} 729 730func awsRestjson1_serializeDocumentStringMap(v map[string]string, value smithyjson.Value) error { 731 object := value.Object() 732 defer object.Close() 733 734 for key := range v { 735 om := object.Key(key) 736 om.String(v[key]) 737 } 738 return nil 739} 740