1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package iotsitewise 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/iotsitewise/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 smithytime "github.com/aws/smithy-go/time" 15 smithyhttp "github.com/aws/smithy-go/transport/http" 16) 17 18type awsRestjson1_serializeOpAssociateAssets struct { 19} 20 21func (*awsRestjson1_serializeOpAssociateAssets) ID() string { 22 return "OperationSerializer" 23} 24 25func (m *awsRestjson1_serializeOpAssociateAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 26 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 27) { 28 request, ok := in.Request.(*smithyhttp.Request) 29 if !ok { 30 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 31 } 32 33 input, ok := in.Parameters.(*AssociateAssetsInput) 34 _ = input 35 if !ok { 36 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 37 } 38 39 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/associate") 40 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 41 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 42 request.Method = "POST" 43 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 44 if err != nil { 45 return out, metadata, &smithy.SerializationError{Err: err} 46 } 47 48 if err := awsRestjson1_serializeOpHttpBindingsAssociateAssetsInput(input, restEncoder); err != nil { 49 return out, metadata, &smithy.SerializationError{Err: err} 50 } 51 52 restEncoder.SetHeader("Content-Type").String("application/json") 53 54 jsonEncoder := smithyjson.NewEncoder() 55 if err := awsRestjson1_serializeOpDocumentAssociateAssetsInput(input, jsonEncoder.Value); err != nil { 56 return out, metadata, &smithy.SerializationError{Err: err} 57 } 58 59 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 60 return out, metadata, &smithy.SerializationError{Err: err} 61 } 62 63 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 64 return out, metadata, &smithy.SerializationError{Err: err} 65 } 66 in.Request = request 67 68 return next.HandleSerialize(ctx, in) 69} 70func awsRestjson1_serializeOpHttpBindingsAssociateAssetsInput(v *AssociateAssetsInput, encoder *httpbinding.Encoder) error { 71 if v == nil { 72 return fmt.Errorf("unsupported serialization of nil %T", v) 73 } 74 75 if v.AssetId == nil || len(*v.AssetId) == 0 { 76 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 77 } 78 if v.AssetId != nil { 79 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 80 return err 81 } 82 } 83 84 return nil 85} 86 87func awsRestjson1_serializeOpDocumentAssociateAssetsInput(v *AssociateAssetsInput, value smithyjson.Value) error { 88 object := value.Object() 89 defer object.Close() 90 91 if v.ChildAssetId != nil { 92 ok := object.Key("childAssetId") 93 ok.String(*v.ChildAssetId) 94 } 95 96 if v.ClientToken != nil { 97 ok := object.Key("clientToken") 98 ok.String(*v.ClientToken) 99 } 100 101 if v.HierarchyId != nil { 102 ok := object.Key("hierarchyId") 103 ok.String(*v.HierarchyId) 104 } 105 106 return nil 107} 108 109type awsRestjson1_serializeOpBatchAssociateProjectAssets struct { 110} 111 112func (*awsRestjson1_serializeOpBatchAssociateProjectAssets) ID() string { 113 return "OperationSerializer" 114} 115 116func (m *awsRestjson1_serializeOpBatchAssociateProjectAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 117 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 118) { 119 request, ok := in.Request.(*smithyhttp.Request) 120 if !ok { 121 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 122 } 123 124 input, ok := in.Parameters.(*BatchAssociateProjectAssetsInput) 125 _ = input 126 if !ok { 127 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 128 } 129 130 opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets/associate") 131 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 132 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 133 request.Method = "POST" 134 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 135 if err != nil { 136 return out, metadata, &smithy.SerializationError{Err: err} 137 } 138 139 if err := awsRestjson1_serializeOpHttpBindingsBatchAssociateProjectAssetsInput(input, restEncoder); err != nil { 140 return out, metadata, &smithy.SerializationError{Err: err} 141 } 142 143 restEncoder.SetHeader("Content-Type").String("application/json") 144 145 jsonEncoder := smithyjson.NewEncoder() 146 if err := awsRestjson1_serializeOpDocumentBatchAssociateProjectAssetsInput(input, jsonEncoder.Value); err != nil { 147 return out, metadata, &smithy.SerializationError{Err: err} 148 } 149 150 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 151 return out, metadata, &smithy.SerializationError{Err: err} 152 } 153 154 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 155 return out, metadata, &smithy.SerializationError{Err: err} 156 } 157 in.Request = request 158 159 return next.HandleSerialize(ctx, in) 160} 161func awsRestjson1_serializeOpHttpBindingsBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput, encoder *httpbinding.Encoder) error { 162 if v == nil { 163 return fmt.Errorf("unsupported serialization of nil %T", v) 164 } 165 166 if v.ProjectId == nil || len(*v.ProjectId) == 0 { 167 return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} 168 } 169 if v.ProjectId != nil { 170 if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { 171 return err 172 } 173 } 174 175 return nil 176} 177 178func awsRestjson1_serializeOpDocumentBatchAssociateProjectAssetsInput(v *BatchAssociateProjectAssetsInput, value smithyjson.Value) error { 179 object := value.Object() 180 defer object.Close() 181 182 if v.AssetIds != nil { 183 ok := object.Key("assetIds") 184 if err := awsRestjson1_serializeDocumentIDs(v.AssetIds, ok); err != nil { 185 return err 186 } 187 } 188 189 if v.ClientToken != nil { 190 ok := object.Key("clientToken") 191 ok.String(*v.ClientToken) 192 } 193 194 return nil 195} 196 197type awsRestjson1_serializeOpBatchDisassociateProjectAssets struct { 198} 199 200func (*awsRestjson1_serializeOpBatchDisassociateProjectAssets) ID() string { 201 return "OperationSerializer" 202} 203 204func (m *awsRestjson1_serializeOpBatchDisassociateProjectAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 205 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 206) { 207 request, ok := in.Request.(*smithyhttp.Request) 208 if !ok { 209 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 210 } 211 212 input, ok := in.Parameters.(*BatchDisassociateProjectAssetsInput) 213 _ = input 214 if !ok { 215 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 216 } 217 218 opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets/disassociate") 219 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 220 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 221 request.Method = "POST" 222 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 223 if err != nil { 224 return out, metadata, &smithy.SerializationError{Err: err} 225 } 226 227 if err := awsRestjson1_serializeOpHttpBindingsBatchDisassociateProjectAssetsInput(input, restEncoder); err != nil { 228 return out, metadata, &smithy.SerializationError{Err: err} 229 } 230 231 restEncoder.SetHeader("Content-Type").String("application/json") 232 233 jsonEncoder := smithyjson.NewEncoder() 234 if err := awsRestjson1_serializeOpDocumentBatchDisassociateProjectAssetsInput(input, jsonEncoder.Value); err != nil { 235 return out, metadata, &smithy.SerializationError{Err: err} 236 } 237 238 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 239 return out, metadata, &smithy.SerializationError{Err: err} 240 } 241 242 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 243 return out, metadata, &smithy.SerializationError{Err: err} 244 } 245 in.Request = request 246 247 return next.HandleSerialize(ctx, in) 248} 249func awsRestjson1_serializeOpHttpBindingsBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput, encoder *httpbinding.Encoder) error { 250 if v == nil { 251 return fmt.Errorf("unsupported serialization of nil %T", v) 252 } 253 254 if v.ProjectId == nil || len(*v.ProjectId) == 0 { 255 return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} 256 } 257 if v.ProjectId != nil { 258 if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { 259 return err 260 } 261 } 262 263 return nil 264} 265 266func awsRestjson1_serializeOpDocumentBatchDisassociateProjectAssetsInput(v *BatchDisassociateProjectAssetsInput, value smithyjson.Value) error { 267 object := value.Object() 268 defer object.Close() 269 270 if v.AssetIds != nil { 271 ok := object.Key("assetIds") 272 if err := awsRestjson1_serializeDocumentIDs(v.AssetIds, ok); err != nil { 273 return err 274 } 275 } 276 277 if v.ClientToken != nil { 278 ok := object.Key("clientToken") 279 ok.String(*v.ClientToken) 280 } 281 282 return nil 283} 284 285type awsRestjson1_serializeOpBatchPutAssetPropertyValue struct { 286} 287 288func (*awsRestjson1_serializeOpBatchPutAssetPropertyValue) ID() string { 289 return "OperationSerializer" 290} 291 292func (m *awsRestjson1_serializeOpBatchPutAssetPropertyValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 293 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 294) { 295 request, ok := in.Request.(*smithyhttp.Request) 296 if !ok { 297 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 298 } 299 300 input, ok := in.Parameters.(*BatchPutAssetPropertyValueInput) 301 _ = input 302 if !ok { 303 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 304 } 305 306 opPath, opQuery := httpbinding.SplitURI("/properties") 307 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 308 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 309 request.Method = "POST" 310 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 311 if err != nil { 312 return out, metadata, &smithy.SerializationError{Err: err} 313 } 314 315 restEncoder.SetHeader("Content-Type").String("application/json") 316 317 jsonEncoder := smithyjson.NewEncoder() 318 if err := awsRestjson1_serializeOpDocumentBatchPutAssetPropertyValueInput(input, jsonEncoder.Value); err != nil { 319 return out, metadata, &smithy.SerializationError{Err: err} 320 } 321 322 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 323 return out, metadata, &smithy.SerializationError{Err: err} 324 } 325 326 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 327 return out, metadata, &smithy.SerializationError{Err: err} 328 } 329 in.Request = request 330 331 return next.HandleSerialize(ctx, in) 332} 333func awsRestjson1_serializeOpHttpBindingsBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput, encoder *httpbinding.Encoder) error { 334 if v == nil { 335 return fmt.Errorf("unsupported serialization of nil %T", v) 336 } 337 338 return nil 339} 340 341func awsRestjson1_serializeOpDocumentBatchPutAssetPropertyValueInput(v *BatchPutAssetPropertyValueInput, value smithyjson.Value) error { 342 object := value.Object() 343 defer object.Close() 344 345 if v.Entries != nil { 346 ok := object.Key("entries") 347 if err := awsRestjson1_serializeDocumentPutAssetPropertyValueEntries(v.Entries, ok); err != nil { 348 return err 349 } 350 } 351 352 return nil 353} 354 355type awsRestjson1_serializeOpCreateAccessPolicy struct { 356} 357 358func (*awsRestjson1_serializeOpCreateAccessPolicy) ID() string { 359 return "OperationSerializer" 360} 361 362func (m *awsRestjson1_serializeOpCreateAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 363 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 364) { 365 request, ok := in.Request.(*smithyhttp.Request) 366 if !ok { 367 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 368 } 369 370 input, ok := in.Parameters.(*CreateAccessPolicyInput) 371 _ = input 372 if !ok { 373 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 374 } 375 376 opPath, opQuery := httpbinding.SplitURI("/access-policies") 377 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 378 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 379 request.Method = "POST" 380 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 381 if err != nil { 382 return out, metadata, &smithy.SerializationError{Err: err} 383 } 384 385 restEncoder.SetHeader("Content-Type").String("application/json") 386 387 jsonEncoder := smithyjson.NewEncoder() 388 if err := awsRestjson1_serializeOpDocumentCreateAccessPolicyInput(input, jsonEncoder.Value); err != nil { 389 return out, metadata, &smithy.SerializationError{Err: err} 390 } 391 392 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 393 return out, metadata, &smithy.SerializationError{Err: err} 394 } 395 396 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 397 return out, metadata, &smithy.SerializationError{Err: err} 398 } 399 in.Request = request 400 401 return next.HandleSerialize(ctx, in) 402} 403func awsRestjson1_serializeOpHttpBindingsCreateAccessPolicyInput(v *CreateAccessPolicyInput, encoder *httpbinding.Encoder) error { 404 if v == nil { 405 return fmt.Errorf("unsupported serialization of nil %T", v) 406 } 407 408 return nil 409} 410 411func awsRestjson1_serializeOpDocumentCreateAccessPolicyInput(v *CreateAccessPolicyInput, value smithyjson.Value) error { 412 object := value.Object() 413 defer object.Close() 414 415 if v.AccessPolicyIdentity != nil { 416 ok := object.Key("accessPolicyIdentity") 417 if err := awsRestjson1_serializeDocumentIdentity(v.AccessPolicyIdentity, ok); err != nil { 418 return err 419 } 420 } 421 422 if len(v.AccessPolicyPermission) > 0 { 423 ok := object.Key("accessPolicyPermission") 424 ok.String(string(v.AccessPolicyPermission)) 425 } 426 427 if v.AccessPolicyResource != nil { 428 ok := object.Key("accessPolicyResource") 429 if err := awsRestjson1_serializeDocumentResource(v.AccessPolicyResource, ok); err != nil { 430 return err 431 } 432 } 433 434 if v.ClientToken != nil { 435 ok := object.Key("clientToken") 436 ok.String(*v.ClientToken) 437 } 438 439 if v.Tags != nil { 440 ok := object.Key("tags") 441 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 442 return err 443 } 444 } 445 446 return nil 447} 448 449type awsRestjson1_serializeOpCreateAsset struct { 450} 451 452func (*awsRestjson1_serializeOpCreateAsset) ID() string { 453 return "OperationSerializer" 454} 455 456func (m *awsRestjson1_serializeOpCreateAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 457 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 458) { 459 request, ok := in.Request.(*smithyhttp.Request) 460 if !ok { 461 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 462 } 463 464 input, ok := in.Parameters.(*CreateAssetInput) 465 _ = input 466 if !ok { 467 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 468 } 469 470 opPath, opQuery := httpbinding.SplitURI("/assets") 471 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 472 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 473 request.Method = "POST" 474 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 475 if err != nil { 476 return out, metadata, &smithy.SerializationError{Err: err} 477 } 478 479 restEncoder.SetHeader("Content-Type").String("application/json") 480 481 jsonEncoder := smithyjson.NewEncoder() 482 if err := awsRestjson1_serializeOpDocumentCreateAssetInput(input, jsonEncoder.Value); err != nil { 483 return out, metadata, &smithy.SerializationError{Err: err} 484 } 485 486 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 487 return out, metadata, &smithy.SerializationError{Err: err} 488 } 489 490 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 491 return out, metadata, &smithy.SerializationError{Err: err} 492 } 493 in.Request = request 494 495 return next.HandleSerialize(ctx, in) 496} 497func awsRestjson1_serializeOpHttpBindingsCreateAssetInput(v *CreateAssetInput, encoder *httpbinding.Encoder) error { 498 if v == nil { 499 return fmt.Errorf("unsupported serialization of nil %T", v) 500 } 501 502 return nil 503} 504 505func awsRestjson1_serializeOpDocumentCreateAssetInput(v *CreateAssetInput, value smithyjson.Value) error { 506 object := value.Object() 507 defer object.Close() 508 509 if v.AssetModelId != nil { 510 ok := object.Key("assetModelId") 511 ok.String(*v.AssetModelId) 512 } 513 514 if v.AssetName != nil { 515 ok := object.Key("assetName") 516 ok.String(*v.AssetName) 517 } 518 519 if v.ClientToken != nil { 520 ok := object.Key("clientToken") 521 ok.String(*v.ClientToken) 522 } 523 524 if v.Tags != nil { 525 ok := object.Key("tags") 526 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 527 return err 528 } 529 } 530 531 return nil 532} 533 534type awsRestjson1_serializeOpCreateAssetModel struct { 535} 536 537func (*awsRestjson1_serializeOpCreateAssetModel) ID() string { 538 return "OperationSerializer" 539} 540 541func (m *awsRestjson1_serializeOpCreateAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 542 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 543) { 544 request, ok := in.Request.(*smithyhttp.Request) 545 if !ok { 546 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 547 } 548 549 input, ok := in.Parameters.(*CreateAssetModelInput) 550 _ = input 551 if !ok { 552 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 553 } 554 555 opPath, opQuery := httpbinding.SplitURI("/asset-models") 556 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 557 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 558 request.Method = "POST" 559 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 560 if err != nil { 561 return out, metadata, &smithy.SerializationError{Err: err} 562 } 563 564 restEncoder.SetHeader("Content-Type").String("application/json") 565 566 jsonEncoder := smithyjson.NewEncoder() 567 if err := awsRestjson1_serializeOpDocumentCreateAssetModelInput(input, jsonEncoder.Value); err != nil { 568 return out, metadata, &smithy.SerializationError{Err: err} 569 } 570 571 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 572 return out, metadata, &smithy.SerializationError{Err: err} 573 } 574 575 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 576 return out, metadata, &smithy.SerializationError{Err: err} 577 } 578 in.Request = request 579 580 return next.HandleSerialize(ctx, in) 581} 582func awsRestjson1_serializeOpHttpBindingsCreateAssetModelInput(v *CreateAssetModelInput, encoder *httpbinding.Encoder) error { 583 if v == nil { 584 return fmt.Errorf("unsupported serialization of nil %T", v) 585 } 586 587 return nil 588} 589 590func awsRestjson1_serializeOpDocumentCreateAssetModelInput(v *CreateAssetModelInput, value smithyjson.Value) error { 591 object := value.Object() 592 defer object.Close() 593 594 if v.AssetModelCompositeModels != nil { 595 ok := object.Key("assetModelCompositeModels") 596 if err := awsRestjson1_serializeDocumentAssetModelCompositeModelDefinitions(v.AssetModelCompositeModels, ok); err != nil { 597 return err 598 } 599 } 600 601 if v.AssetModelDescription != nil { 602 ok := object.Key("assetModelDescription") 603 ok.String(*v.AssetModelDescription) 604 } 605 606 if v.AssetModelHierarchies != nil { 607 ok := object.Key("assetModelHierarchies") 608 if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v.AssetModelHierarchies, ok); err != nil { 609 return err 610 } 611 } 612 613 if v.AssetModelName != nil { 614 ok := object.Key("assetModelName") 615 ok.String(*v.AssetModelName) 616 } 617 618 if v.AssetModelProperties != nil { 619 ok := object.Key("assetModelProperties") 620 if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.AssetModelProperties, ok); err != nil { 621 return err 622 } 623 } 624 625 if v.ClientToken != nil { 626 ok := object.Key("clientToken") 627 ok.String(*v.ClientToken) 628 } 629 630 if v.Tags != nil { 631 ok := object.Key("tags") 632 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 633 return err 634 } 635 } 636 637 return nil 638} 639 640type awsRestjson1_serializeOpCreateDashboard struct { 641} 642 643func (*awsRestjson1_serializeOpCreateDashboard) ID() string { 644 return "OperationSerializer" 645} 646 647func (m *awsRestjson1_serializeOpCreateDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 648 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 649) { 650 request, ok := in.Request.(*smithyhttp.Request) 651 if !ok { 652 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 653 } 654 655 input, ok := in.Parameters.(*CreateDashboardInput) 656 _ = input 657 if !ok { 658 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 659 } 660 661 opPath, opQuery := httpbinding.SplitURI("/dashboards") 662 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 663 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 664 request.Method = "POST" 665 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 666 if err != nil { 667 return out, metadata, &smithy.SerializationError{Err: err} 668 } 669 670 restEncoder.SetHeader("Content-Type").String("application/json") 671 672 jsonEncoder := smithyjson.NewEncoder() 673 if err := awsRestjson1_serializeOpDocumentCreateDashboardInput(input, jsonEncoder.Value); err != nil { 674 return out, metadata, &smithy.SerializationError{Err: err} 675 } 676 677 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 678 return out, metadata, &smithy.SerializationError{Err: err} 679 } 680 681 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 682 return out, metadata, &smithy.SerializationError{Err: err} 683 } 684 in.Request = request 685 686 return next.HandleSerialize(ctx, in) 687} 688func awsRestjson1_serializeOpHttpBindingsCreateDashboardInput(v *CreateDashboardInput, encoder *httpbinding.Encoder) error { 689 if v == nil { 690 return fmt.Errorf("unsupported serialization of nil %T", v) 691 } 692 693 return nil 694} 695 696func awsRestjson1_serializeOpDocumentCreateDashboardInput(v *CreateDashboardInput, value smithyjson.Value) error { 697 object := value.Object() 698 defer object.Close() 699 700 if v.ClientToken != nil { 701 ok := object.Key("clientToken") 702 ok.String(*v.ClientToken) 703 } 704 705 if v.DashboardDefinition != nil { 706 ok := object.Key("dashboardDefinition") 707 ok.String(*v.DashboardDefinition) 708 } 709 710 if v.DashboardDescription != nil { 711 ok := object.Key("dashboardDescription") 712 ok.String(*v.DashboardDescription) 713 } 714 715 if v.DashboardName != nil { 716 ok := object.Key("dashboardName") 717 ok.String(*v.DashboardName) 718 } 719 720 if v.ProjectId != nil { 721 ok := object.Key("projectId") 722 ok.String(*v.ProjectId) 723 } 724 725 if v.Tags != nil { 726 ok := object.Key("tags") 727 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 728 return err 729 } 730 } 731 732 return nil 733} 734 735type awsRestjson1_serializeOpCreateGateway struct { 736} 737 738func (*awsRestjson1_serializeOpCreateGateway) ID() string { 739 return "OperationSerializer" 740} 741 742func (m *awsRestjson1_serializeOpCreateGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 743 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 744) { 745 request, ok := in.Request.(*smithyhttp.Request) 746 if !ok { 747 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 748 } 749 750 input, ok := in.Parameters.(*CreateGatewayInput) 751 _ = input 752 if !ok { 753 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 754 } 755 756 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways") 757 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 758 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 759 request.Method = "POST" 760 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 761 if err != nil { 762 return out, metadata, &smithy.SerializationError{Err: err} 763 } 764 765 restEncoder.SetHeader("Content-Type").String("application/json") 766 767 jsonEncoder := smithyjson.NewEncoder() 768 if err := awsRestjson1_serializeOpDocumentCreateGatewayInput(input, jsonEncoder.Value); err != nil { 769 return out, metadata, &smithy.SerializationError{Err: err} 770 } 771 772 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 773 return out, metadata, &smithy.SerializationError{Err: err} 774 } 775 776 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 777 return out, metadata, &smithy.SerializationError{Err: err} 778 } 779 in.Request = request 780 781 return next.HandleSerialize(ctx, in) 782} 783func awsRestjson1_serializeOpHttpBindingsCreateGatewayInput(v *CreateGatewayInput, encoder *httpbinding.Encoder) error { 784 if v == nil { 785 return fmt.Errorf("unsupported serialization of nil %T", v) 786 } 787 788 return nil 789} 790 791func awsRestjson1_serializeOpDocumentCreateGatewayInput(v *CreateGatewayInput, value smithyjson.Value) error { 792 object := value.Object() 793 defer object.Close() 794 795 if v.GatewayName != nil { 796 ok := object.Key("gatewayName") 797 ok.String(*v.GatewayName) 798 } 799 800 if v.GatewayPlatform != nil { 801 ok := object.Key("gatewayPlatform") 802 if err := awsRestjson1_serializeDocumentGatewayPlatform(v.GatewayPlatform, ok); err != nil { 803 return err 804 } 805 } 806 807 if v.Tags != nil { 808 ok := object.Key("tags") 809 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 810 return err 811 } 812 } 813 814 return nil 815} 816 817type awsRestjson1_serializeOpCreatePortal struct { 818} 819 820func (*awsRestjson1_serializeOpCreatePortal) ID() string { 821 return "OperationSerializer" 822} 823 824func (m *awsRestjson1_serializeOpCreatePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 825 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 826) { 827 request, ok := in.Request.(*smithyhttp.Request) 828 if !ok { 829 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 830 } 831 832 input, ok := in.Parameters.(*CreatePortalInput) 833 _ = input 834 if !ok { 835 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 836 } 837 838 opPath, opQuery := httpbinding.SplitURI("/portals") 839 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 840 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 841 request.Method = "POST" 842 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 843 if err != nil { 844 return out, metadata, &smithy.SerializationError{Err: err} 845 } 846 847 restEncoder.SetHeader("Content-Type").String("application/json") 848 849 jsonEncoder := smithyjson.NewEncoder() 850 if err := awsRestjson1_serializeOpDocumentCreatePortalInput(input, jsonEncoder.Value); err != nil { 851 return out, metadata, &smithy.SerializationError{Err: err} 852 } 853 854 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 855 return out, metadata, &smithy.SerializationError{Err: err} 856 } 857 858 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 859 return out, metadata, &smithy.SerializationError{Err: err} 860 } 861 in.Request = request 862 863 return next.HandleSerialize(ctx, in) 864} 865func awsRestjson1_serializeOpHttpBindingsCreatePortalInput(v *CreatePortalInput, encoder *httpbinding.Encoder) error { 866 if v == nil { 867 return fmt.Errorf("unsupported serialization of nil %T", v) 868 } 869 870 return nil 871} 872 873func awsRestjson1_serializeOpDocumentCreatePortalInput(v *CreatePortalInput, value smithyjson.Value) error { 874 object := value.Object() 875 defer object.Close() 876 877 if v.ClientToken != nil { 878 ok := object.Key("clientToken") 879 ok.String(*v.ClientToken) 880 } 881 882 if len(v.PortalAuthMode) > 0 { 883 ok := object.Key("portalAuthMode") 884 ok.String(string(v.PortalAuthMode)) 885 } 886 887 if v.PortalContactEmail != nil { 888 ok := object.Key("portalContactEmail") 889 ok.String(*v.PortalContactEmail) 890 } 891 892 if v.PortalDescription != nil { 893 ok := object.Key("portalDescription") 894 ok.String(*v.PortalDescription) 895 } 896 897 if v.PortalLogoImageFile != nil { 898 ok := object.Key("portalLogoImageFile") 899 if err := awsRestjson1_serializeDocumentImageFile(v.PortalLogoImageFile, ok); err != nil { 900 return err 901 } 902 } 903 904 if v.PortalName != nil { 905 ok := object.Key("portalName") 906 ok.String(*v.PortalName) 907 } 908 909 if v.RoleArn != nil { 910 ok := object.Key("roleArn") 911 ok.String(*v.RoleArn) 912 } 913 914 if v.Tags != nil { 915 ok := object.Key("tags") 916 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 917 return err 918 } 919 } 920 921 return nil 922} 923 924type awsRestjson1_serializeOpCreateProject struct { 925} 926 927func (*awsRestjson1_serializeOpCreateProject) ID() string { 928 return "OperationSerializer" 929} 930 931func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 932 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 933) { 934 request, ok := in.Request.(*smithyhttp.Request) 935 if !ok { 936 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 937 } 938 939 input, ok := in.Parameters.(*CreateProjectInput) 940 _ = input 941 if !ok { 942 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 943 } 944 945 opPath, opQuery := httpbinding.SplitURI("/projects") 946 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 947 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 948 request.Method = "POST" 949 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 950 if err != nil { 951 return out, metadata, &smithy.SerializationError{Err: err} 952 } 953 954 restEncoder.SetHeader("Content-Type").String("application/json") 955 956 jsonEncoder := smithyjson.NewEncoder() 957 if err := awsRestjson1_serializeOpDocumentCreateProjectInput(input, jsonEncoder.Value); err != nil { 958 return out, metadata, &smithy.SerializationError{Err: err} 959 } 960 961 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 962 return out, metadata, &smithy.SerializationError{Err: err} 963 } 964 965 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 966 return out, metadata, &smithy.SerializationError{Err: err} 967 } 968 in.Request = request 969 970 return next.HandleSerialize(ctx, in) 971} 972func awsRestjson1_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error { 973 if v == nil { 974 return fmt.Errorf("unsupported serialization of nil %T", v) 975 } 976 977 return nil 978} 979 980func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { 981 object := value.Object() 982 defer object.Close() 983 984 if v.ClientToken != nil { 985 ok := object.Key("clientToken") 986 ok.String(*v.ClientToken) 987 } 988 989 if v.PortalId != nil { 990 ok := object.Key("portalId") 991 ok.String(*v.PortalId) 992 } 993 994 if v.ProjectDescription != nil { 995 ok := object.Key("projectDescription") 996 ok.String(*v.ProjectDescription) 997 } 998 999 if v.ProjectName != nil { 1000 ok := object.Key("projectName") 1001 ok.String(*v.ProjectName) 1002 } 1003 1004 if v.Tags != nil { 1005 ok := object.Key("tags") 1006 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 1007 return err 1008 } 1009 } 1010 1011 return nil 1012} 1013 1014type awsRestjson1_serializeOpDeleteAccessPolicy struct { 1015} 1016 1017func (*awsRestjson1_serializeOpDeleteAccessPolicy) ID() string { 1018 return "OperationSerializer" 1019} 1020 1021func (m *awsRestjson1_serializeOpDeleteAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1022 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1023) { 1024 request, ok := in.Request.(*smithyhttp.Request) 1025 if !ok { 1026 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1027 } 1028 1029 input, ok := in.Parameters.(*DeleteAccessPolicyInput) 1030 _ = input 1031 if !ok { 1032 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1033 } 1034 1035 opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}") 1036 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1037 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1038 request.Method = "DELETE" 1039 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1040 if err != nil { 1041 return out, metadata, &smithy.SerializationError{Err: err} 1042 } 1043 1044 if err := awsRestjson1_serializeOpHttpBindingsDeleteAccessPolicyInput(input, restEncoder); err != nil { 1045 return out, metadata, &smithy.SerializationError{Err: err} 1046 } 1047 1048 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1049 return out, metadata, &smithy.SerializationError{Err: err} 1050 } 1051 in.Request = request 1052 1053 return next.HandleSerialize(ctx, in) 1054} 1055func awsRestjson1_serializeOpHttpBindingsDeleteAccessPolicyInput(v *DeleteAccessPolicyInput, encoder *httpbinding.Encoder) error { 1056 if v == nil { 1057 return fmt.Errorf("unsupported serialization of nil %T", v) 1058 } 1059 1060 if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 { 1061 return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")} 1062 } 1063 if v.AccessPolicyId != nil { 1064 if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil { 1065 return err 1066 } 1067 } 1068 1069 if v.ClientToken != nil { 1070 encoder.SetQuery("clientToken").String(*v.ClientToken) 1071 } 1072 1073 return nil 1074} 1075 1076type awsRestjson1_serializeOpDeleteAsset struct { 1077} 1078 1079func (*awsRestjson1_serializeOpDeleteAsset) ID() string { 1080 return "OperationSerializer" 1081} 1082 1083func (m *awsRestjson1_serializeOpDeleteAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1084 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1085) { 1086 request, ok := in.Request.(*smithyhttp.Request) 1087 if !ok { 1088 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1089 } 1090 1091 input, ok := in.Parameters.(*DeleteAssetInput) 1092 _ = input 1093 if !ok { 1094 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1095 } 1096 1097 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}") 1098 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1099 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1100 request.Method = "DELETE" 1101 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1102 if err != nil { 1103 return out, metadata, &smithy.SerializationError{Err: err} 1104 } 1105 1106 if err := awsRestjson1_serializeOpHttpBindingsDeleteAssetInput(input, restEncoder); err != nil { 1107 return out, metadata, &smithy.SerializationError{Err: err} 1108 } 1109 1110 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1111 return out, metadata, &smithy.SerializationError{Err: err} 1112 } 1113 in.Request = request 1114 1115 return next.HandleSerialize(ctx, in) 1116} 1117func awsRestjson1_serializeOpHttpBindingsDeleteAssetInput(v *DeleteAssetInput, encoder *httpbinding.Encoder) error { 1118 if v == nil { 1119 return fmt.Errorf("unsupported serialization of nil %T", v) 1120 } 1121 1122 if v.AssetId == nil || len(*v.AssetId) == 0 { 1123 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 1124 } 1125 if v.AssetId != nil { 1126 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 1127 return err 1128 } 1129 } 1130 1131 if v.ClientToken != nil { 1132 encoder.SetQuery("clientToken").String(*v.ClientToken) 1133 } 1134 1135 return nil 1136} 1137 1138type awsRestjson1_serializeOpDeleteAssetModel struct { 1139} 1140 1141func (*awsRestjson1_serializeOpDeleteAssetModel) ID() string { 1142 return "OperationSerializer" 1143} 1144 1145func (m *awsRestjson1_serializeOpDeleteAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1146 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1147) { 1148 request, ok := in.Request.(*smithyhttp.Request) 1149 if !ok { 1150 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1151 } 1152 1153 input, ok := in.Parameters.(*DeleteAssetModelInput) 1154 _ = input 1155 if !ok { 1156 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1157 } 1158 1159 opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}") 1160 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1161 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1162 request.Method = "DELETE" 1163 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1164 if err != nil { 1165 return out, metadata, &smithy.SerializationError{Err: err} 1166 } 1167 1168 if err := awsRestjson1_serializeOpHttpBindingsDeleteAssetModelInput(input, restEncoder); err != nil { 1169 return out, metadata, &smithy.SerializationError{Err: err} 1170 } 1171 1172 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1173 return out, metadata, &smithy.SerializationError{Err: err} 1174 } 1175 in.Request = request 1176 1177 return next.HandleSerialize(ctx, in) 1178} 1179func awsRestjson1_serializeOpHttpBindingsDeleteAssetModelInput(v *DeleteAssetModelInput, encoder *httpbinding.Encoder) error { 1180 if v == nil { 1181 return fmt.Errorf("unsupported serialization of nil %T", v) 1182 } 1183 1184 if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { 1185 return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} 1186 } 1187 if v.AssetModelId != nil { 1188 if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { 1189 return err 1190 } 1191 } 1192 1193 if v.ClientToken != nil { 1194 encoder.SetQuery("clientToken").String(*v.ClientToken) 1195 } 1196 1197 return nil 1198} 1199 1200type awsRestjson1_serializeOpDeleteDashboard struct { 1201} 1202 1203func (*awsRestjson1_serializeOpDeleteDashboard) ID() string { 1204 return "OperationSerializer" 1205} 1206 1207func (m *awsRestjson1_serializeOpDeleteDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1208 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1209) { 1210 request, ok := in.Request.(*smithyhttp.Request) 1211 if !ok { 1212 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1213 } 1214 1215 input, ok := in.Parameters.(*DeleteDashboardInput) 1216 _ = input 1217 if !ok { 1218 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1219 } 1220 1221 opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}") 1222 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1223 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1224 request.Method = "DELETE" 1225 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1226 if err != nil { 1227 return out, metadata, &smithy.SerializationError{Err: err} 1228 } 1229 1230 if err := awsRestjson1_serializeOpHttpBindingsDeleteDashboardInput(input, restEncoder); err != nil { 1231 return out, metadata, &smithy.SerializationError{Err: err} 1232 } 1233 1234 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1235 return out, metadata, &smithy.SerializationError{Err: err} 1236 } 1237 in.Request = request 1238 1239 return next.HandleSerialize(ctx, in) 1240} 1241func awsRestjson1_serializeOpHttpBindingsDeleteDashboardInput(v *DeleteDashboardInput, encoder *httpbinding.Encoder) error { 1242 if v == nil { 1243 return fmt.Errorf("unsupported serialization of nil %T", v) 1244 } 1245 1246 if v.ClientToken != nil { 1247 encoder.SetQuery("clientToken").String(*v.ClientToken) 1248 } 1249 1250 if v.DashboardId == nil || len(*v.DashboardId) == 0 { 1251 return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")} 1252 } 1253 if v.DashboardId != nil { 1254 if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil { 1255 return err 1256 } 1257 } 1258 1259 return nil 1260} 1261 1262type awsRestjson1_serializeOpDeleteGateway struct { 1263} 1264 1265func (*awsRestjson1_serializeOpDeleteGateway) ID() string { 1266 return "OperationSerializer" 1267} 1268 1269func (m *awsRestjson1_serializeOpDeleteGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1270 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1271) { 1272 request, ok := in.Request.(*smithyhttp.Request) 1273 if !ok { 1274 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1275 } 1276 1277 input, ok := in.Parameters.(*DeleteGatewayInput) 1278 _ = input 1279 if !ok { 1280 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1281 } 1282 1283 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}") 1284 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1285 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1286 request.Method = "DELETE" 1287 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1288 if err != nil { 1289 return out, metadata, &smithy.SerializationError{Err: err} 1290 } 1291 1292 if err := awsRestjson1_serializeOpHttpBindingsDeleteGatewayInput(input, restEncoder); err != nil { 1293 return out, metadata, &smithy.SerializationError{Err: err} 1294 } 1295 1296 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1297 return out, metadata, &smithy.SerializationError{Err: err} 1298 } 1299 in.Request = request 1300 1301 return next.HandleSerialize(ctx, in) 1302} 1303func awsRestjson1_serializeOpHttpBindingsDeleteGatewayInput(v *DeleteGatewayInput, encoder *httpbinding.Encoder) error { 1304 if v == nil { 1305 return fmt.Errorf("unsupported serialization of nil %T", v) 1306 } 1307 1308 if v.GatewayId == nil || len(*v.GatewayId) == 0 { 1309 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")} 1310 } 1311 if v.GatewayId != nil { 1312 if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil { 1313 return err 1314 } 1315 } 1316 1317 return nil 1318} 1319 1320type awsRestjson1_serializeOpDeletePortal struct { 1321} 1322 1323func (*awsRestjson1_serializeOpDeletePortal) ID() string { 1324 return "OperationSerializer" 1325} 1326 1327func (m *awsRestjson1_serializeOpDeletePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1328 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1329) { 1330 request, ok := in.Request.(*smithyhttp.Request) 1331 if !ok { 1332 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1333 } 1334 1335 input, ok := in.Parameters.(*DeletePortalInput) 1336 _ = input 1337 if !ok { 1338 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1339 } 1340 1341 opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}") 1342 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1343 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1344 request.Method = "DELETE" 1345 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1346 if err != nil { 1347 return out, metadata, &smithy.SerializationError{Err: err} 1348 } 1349 1350 if err := awsRestjson1_serializeOpHttpBindingsDeletePortalInput(input, restEncoder); err != nil { 1351 return out, metadata, &smithy.SerializationError{Err: err} 1352 } 1353 1354 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1355 return out, metadata, &smithy.SerializationError{Err: err} 1356 } 1357 in.Request = request 1358 1359 return next.HandleSerialize(ctx, in) 1360} 1361func awsRestjson1_serializeOpHttpBindingsDeletePortalInput(v *DeletePortalInput, encoder *httpbinding.Encoder) error { 1362 if v == nil { 1363 return fmt.Errorf("unsupported serialization of nil %T", v) 1364 } 1365 1366 if v.ClientToken != nil { 1367 encoder.SetQuery("clientToken").String(*v.ClientToken) 1368 } 1369 1370 if v.PortalId == nil || len(*v.PortalId) == 0 { 1371 return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")} 1372 } 1373 if v.PortalId != nil { 1374 if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil { 1375 return err 1376 } 1377 } 1378 1379 return nil 1380} 1381 1382type awsRestjson1_serializeOpDeleteProject struct { 1383} 1384 1385func (*awsRestjson1_serializeOpDeleteProject) ID() string { 1386 return "OperationSerializer" 1387} 1388 1389func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1390 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1391) { 1392 request, ok := in.Request.(*smithyhttp.Request) 1393 if !ok { 1394 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1395 } 1396 1397 input, ok := in.Parameters.(*DeleteProjectInput) 1398 _ = input 1399 if !ok { 1400 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1401 } 1402 1403 opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}") 1404 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1405 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1406 request.Method = "DELETE" 1407 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1408 if err != nil { 1409 return out, metadata, &smithy.SerializationError{Err: err} 1410 } 1411 1412 if err := awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(input, restEncoder); err != nil { 1413 return out, metadata, &smithy.SerializationError{Err: err} 1414 } 1415 1416 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1417 return out, metadata, &smithy.SerializationError{Err: err} 1418 } 1419 in.Request = request 1420 1421 return next.HandleSerialize(ctx, in) 1422} 1423func awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error { 1424 if v == nil { 1425 return fmt.Errorf("unsupported serialization of nil %T", v) 1426 } 1427 1428 if v.ClientToken != nil { 1429 encoder.SetQuery("clientToken").String(*v.ClientToken) 1430 } 1431 1432 if v.ProjectId == nil || len(*v.ProjectId) == 0 { 1433 return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} 1434 } 1435 if v.ProjectId != nil { 1436 if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { 1437 return err 1438 } 1439 } 1440 1441 return nil 1442} 1443 1444type awsRestjson1_serializeOpDescribeAccessPolicy struct { 1445} 1446 1447func (*awsRestjson1_serializeOpDescribeAccessPolicy) ID() string { 1448 return "OperationSerializer" 1449} 1450 1451func (m *awsRestjson1_serializeOpDescribeAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1452 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1453) { 1454 request, ok := in.Request.(*smithyhttp.Request) 1455 if !ok { 1456 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1457 } 1458 1459 input, ok := in.Parameters.(*DescribeAccessPolicyInput) 1460 _ = input 1461 if !ok { 1462 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1463 } 1464 1465 opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}") 1466 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1467 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1468 request.Method = "GET" 1469 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1470 if err != nil { 1471 return out, metadata, &smithy.SerializationError{Err: err} 1472 } 1473 1474 if err := awsRestjson1_serializeOpHttpBindingsDescribeAccessPolicyInput(input, restEncoder); err != nil { 1475 return out, metadata, &smithy.SerializationError{Err: err} 1476 } 1477 1478 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1479 return out, metadata, &smithy.SerializationError{Err: err} 1480 } 1481 in.Request = request 1482 1483 return next.HandleSerialize(ctx, in) 1484} 1485func awsRestjson1_serializeOpHttpBindingsDescribeAccessPolicyInput(v *DescribeAccessPolicyInput, encoder *httpbinding.Encoder) error { 1486 if v == nil { 1487 return fmt.Errorf("unsupported serialization of nil %T", v) 1488 } 1489 1490 if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 { 1491 return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")} 1492 } 1493 if v.AccessPolicyId != nil { 1494 if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil { 1495 return err 1496 } 1497 } 1498 1499 return nil 1500} 1501 1502type awsRestjson1_serializeOpDescribeAsset struct { 1503} 1504 1505func (*awsRestjson1_serializeOpDescribeAsset) ID() string { 1506 return "OperationSerializer" 1507} 1508 1509func (m *awsRestjson1_serializeOpDescribeAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1510 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1511) { 1512 request, ok := in.Request.(*smithyhttp.Request) 1513 if !ok { 1514 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1515 } 1516 1517 input, ok := in.Parameters.(*DescribeAssetInput) 1518 _ = input 1519 if !ok { 1520 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1521 } 1522 1523 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}") 1524 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1525 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1526 request.Method = "GET" 1527 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1528 if err != nil { 1529 return out, metadata, &smithy.SerializationError{Err: err} 1530 } 1531 1532 if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(input, restEncoder); err != nil { 1533 return out, metadata, &smithy.SerializationError{Err: err} 1534 } 1535 1536 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1537 return out, metadata, &smithy.SerializationError{Err: err} 1538 } 1539 in.Request = request 1540 1541 return next.HandleSerialize(ctx, in) 1542} 1543func awsRestjson1_serializeOpHttpBindingsDescribeAssetInput(v *DescribeAssetInput, encoder *httpbinding.Encoder) error { 1544 if v == nil { 1545 return fmt.Errorf("unsupported serialization of nil %T", v) 1546 } 1547 1548 if v.AssetId == nil || len(*v.AssetId) == 0 { 1549 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 1550 } 1551 if v.AssetId != nil { 1552 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 1553 return err 1554 } 1555 } 1556 1557 return nil 1558} 1559 1560type awsRestjson1_serializeOpDescribeAssetModel struct { 1561} 1562 1563func (*awsRestjson1_serializeOpDescribeAssetModel) ID() string { 1564 return "OperationSerializer" 1565} 1566 1567func (m *awsRestjson1_serializeOpDescribeAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1568 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1569) { 1570 request, ok := in.Request.(*smithyhttp.Request) 1571 if !ok { 1572 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1573 } 1574 1575 input, ok := in.Parameters.(*DescribeAssetModelInput) 1576 _ = input 1577 if !ok { 1578 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1579 } 1580 1581 opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}") 1582 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1583 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1584 request.Method = "GET" 1585 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1586 if err != nil { 1587 return out, metadata, &smithy.SerializationError{Err: err} 1588 } 1589 1590 if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(input, restEncoder); err != nil { 1591 return out, metadata, &smithy.SerializationError{Err: err} 1592 } 1593 1594 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1595 return out, metadata, &smithy.SerializationError{Err: err} 1596 } 1597 in.Request = request 1598 1599 return next.HandleSerialize(ctx, in) 1600} 1601func awsRestjson1_serializeOpHttpBindingsDescribeAssetModelInput(v *DescribeAssetModelInput, encoder *httpbinding.Encoder) error { 1602 if v == nil { 1603 return fmt.Errorf("unsupported serialization of nil %T", v) 1604 } 1605 1606 if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { 1607 return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} 1608 } 1609 if v.AssetModelId != nil { 1610 if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { 1611 return err 1612 } 1613 } 1614 1615 return nil 1616} 1617 1618type awsRestjson1_serializeOpDescribeAssetProperty struct { 1619} 1620 1621func (*awsRestjson1_serializeOpDescribeAssetProperty) ID() string { 1622 return "OperationSerializer" 1623} 1624 1625func (m *awsRestjson1_serializeOpDescribeAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1626 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1627) { 1628 request, ok := in.Request.(*smithyhttp.Request) 1629 if !ok { 1630 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1631 } 1632 1633 input, ok := in.Parameters.(*DescribeAssetPropertyInput) 1634 _ = input 1635 if !ok { 1636 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1637 } 1638 1639 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}") 1640 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1641 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1642 request.Method = "GET" 1643 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1644 if err != nil { 1645 return out, metadata, &smithy.SerializationError{Err: err} 1646 } 1647 1648 if err := awsRestjson1_serializeOpHttpBindingsDescribeAssetPropertyInput(input, restEncoder); err != nil { 1649 return out, metadata, &smithy.SerializationError{Err: err} 1650 } 1651 1652 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1653 return out, metadata, &smithy.SerializationError{Err: err} 1654 } 1655 in.Request = request 1656 1657 return next.HandleSerialize(ctx, in) 1658} 1659func awsRestjson1_serializeOpHttpBindingsDescribeAssetPropertyInput(v *DescribeAssetPropertyInput, encoder *httpbinding.Encoder) error { 1660 if v == nil { 1661 return fmt.Errorf("unsupported serialization of nil %T", v) 1662 } 1663 1664 if v.AssetId == nil || len(*v.AssetId) == 0 { 1665 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 1666 } 1667 if v.AssetId != nil { 1668 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 1669 return err 1670 } 1671 } 1672 1673 if v.PropertyId == nil || len(*v.PropertyId) == 0 { 1674 return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")} 1675 } 1676 if v.PropertyId != nil { 1677 if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil { 1678 return err 1679 } 1680 } 1681 1682 return nil 1683} 1684 1685type awsRestjson1_serializeOpDescribeDashboard struct { 1686} 1687 1688func (*awsRestjson1_serializeOpDescribeDashboard) ID() string { 1689 return "OperationSerializer" 1690} 1691 1692func (m *awsRestjson1_serializeOpDescribeDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1693 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1694) { 1695 request, ok := in.Request.(*smithyhttp.Request) 1696 if !ok { 1697 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1698 } 1699 1700 input, ok := in.Parameters.(*DescribeDashboardInput) 1701 _ = input 1702 if !ok { 1703 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1704 } 1705 1706 opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}") 1707 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1708 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1709 request.Method = "GET" 1710 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1711 if err != nil { 1712 return out, metadata, &smithy.SerializationError{Err: err} 1713 } 1714 1715 if err := awsRestjson1_serializeOpHttpBindingsDescribeDashboardInput(input, restEncoder); err != nil { 1716 return out, metadata, &smithy.SerializationError{Err: err} 1717 } 1718 1719 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1720 return out, metadata, &smithy.SerializationError{Err: err} 1721 } 1722 in.Request = request 1723 1724 return next.HandleSerialize(ctx, in) 1725} 1726func awsRestjson1_serializeOpHttpBindingsDescribeDashboardInput(v *DescribeDashboardInput, encoder *httpbinding.Encoder) error { 1727 if v == nil { 1728 return fmt.Errorf("unsupported serialization of nil %T", v) 1729 } 1730 1731 if v.DashboardId == nil || len(*v.DashboardId) == 0 { 1732 return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")} 1733 } 1734 if v.DashboardId != nil { 1735 if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil { 1736 return err 1737 } 1738 } 1739 1740 return nil 1741} 1742 1743type awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration struct { 1744} 1745 1746func (*awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration) ID() string { 1747 return "OperationSerializer" 1748} 1749 1750func (m *awsRestjson1_serializeOpDescribeDefaultEncryptionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1751 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1752) { 1753 request, ok := in.Request.(*smithyhttp.Request) 1754 if !ok { 1755 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1756 } 1757 1758 input, ok := in.Parameters.(*DescribeDefaultEncryptionConfigurationInput) 1759 _ = input 1760 if !ok { 1761 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1762 } 1763 1764 opPath, opQuery := httpbinding.SplitURI("/configuration/account/encryption") 1765 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1766 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1767 request.Method = "GET" 1768 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1769 if err != nil { 1770 return out, metadata, &smithy.SerializationError{Err: err} 1771 } 1772 1773 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1774 return out, metadata, &smithy.SerializationError{Err: err} 1775 } 1776 in.Request = request 1777 1778 return next.HandleSerialize(ctx, in) 1779} 1780func awsRestjson1_serializeOpHttpBindingsDescribeDefaultEncryptionConfigurationInput(v *DescribeDefaultEncryptionConfigurationInput, encoder *httpbinding.Encoder) error { 1781 if v == nil { 1782 return fmt.Errorf("unsupported serialization of nil %T", v) 1783 } 1784 1785 return nil 1786} 1787 1788type awsRestjson1_serializeOpDescribeGateway struct { 1789} 1790 1791func (*awsRestjson1_serializeOpDescribeGateway) ID() string { 1792 return "OperationSerializer" 1793} 1794 1795func (m *awsRestjson1_serializeOpDescribeGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1796 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1797) { 1798 request, ok := in.Request.(*smithyhttp.Request) 1799 if !ok { 1800 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1801 } 1802 1803 input, ok := in.Parameters.(*DescribeGatewayInput) 1804 _ = input 1805 if !ok { 1806 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1807 } 1808 1809 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}") 1810 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1811 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1812 request.Method = "GET" 1813 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1814 if err != nil { 1815 return out, metadata, &smithy.SerializationError{Err: err} 1816 } 1817 1818 if err := awsRestjson1_serializeOpHttpBindingsDescribeGatewayInput(input, restEncoder); err != nil { 1819 return out, metadata, &smithy.SerializationError{Err: err} 1820 } 1821 1822 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1823 return out, metadata, &smithy.SerializationError{Err: err} 1824 } 1825 in.Request = request 1826 1827 return next.HandleSerialize(ctx, in) 1828} 1829func awsRestjson1_serializeOpHttpBindingsDescribeGatewayInput(v *DescribeGatewayInput, encoder *httpbinding.Encoder) error { 1830 if v == nil { 1831 return fmt.Errorf("unsupported serialization of nil %T", v) 1832 } 1833 1834 if v.GatewayId == nil || len(*v.GatewayId) == 0 { 1835 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")} 1836 } 1837 if v.GatewayId != nil { 1838 if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil { 1839 return err 1840 } 1841 } 1842 1843 return nil 1844} 1845 1846type awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration struct { 1847} 1848 1849func (*awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration) ID() string { 1850 return "OperationSerializer" 1851} 1852 1853func (m *awsRestjson1_serializeOpDescribeGatewayCapabilityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1854 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1855) { 1856 request, ok := in.Request.(*smithyhttp.Request) 1857 if !ok { 1858 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1859 } 1860 1861 input, ok := in.Parameters.(*DescribeGatewayCapabilityConfigurationInput) 1862 _ = input 1863 if !ok { 1864 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1865 } 1866 1867 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}/capability/{capabilityNamespace}") 1868 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1869 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1870 request.Method = "GET" 1871 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1872 if err != nil { 1873 return out, metadata, &smithy.SerializationError{Err: err} 1874 } 1875 1876 if err := awsRestjson1_serializeOpHttpBindingsDescribeGatewayCapabilityConfigurationInput(input, restEncoder); err != nil { 1877 return out, metadata, &smithy.SerializationError{Err: err} 1878 } 1879 1880 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1881 return out, metadata, &smithy.SerializationError{Err: err} 1882 } 1883 in.Request = request 1884 1885 return next.HandleSerialize(ctx, in) 1886} 1887func awsRestjson1_serializeOpHttpBindingsDescribeGatewayCapabilityConfigurationInput(v *DescribeGatewayCapabilityConfigurationInput, encoder *httpbinding.Encoder) error { 1888 if v == nil { 1889 return fmt.Errorf("unsupported serialization of nil %T", v) 1890 } 1891 1892 if v.CapabilityNamespace == nil || len(*v.CapabilityNamespace) == 0 { 1893 return &smithy.SerializationError{Err: fmt.Errorf("input member capabilityNamespace must not be empty")} 1894 } 1895 if v.CapabilityNamespace != nil { 1896 if err := encoder.SetURI("capabilityNamespace").String(*v.CapabilityNamespace); err != nil { 1897 return err 1898 } 1899 } 1900 1901 if v.GatewayId == nil || len(*v.GatewayId) == 0 { 1902 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")} 1903 } 1904 if v.GatewayId != nil { 1905 if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil { 1906 return err 1907 } 1908 } 1909 1910 return nil 1911} 1912 1913type awsRestjson1_serializeOpDescribeLoggingOptions struct { 1914} 1915 1916func (*awsRestjson1_serializeOpDescribeLoggingOptions) ID() string { 1917 return "OperationSerializer" 1918} 1919 1920func (m *awsRestjson1_serializeOpDescribeLoggingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1921 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1922) { 1923 request, ok := in.Request.(*smithyhttp.Request) 1924 if !ok { 1925 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1926 } 1927 1928 input, ok := in.Parameters.(*DescribeLoggingOptionsInput) 1929 _ = input 1930 if !ok { 1931 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1932 } 1933 1934 opPath, opQuery := httpbinding.SplitURI("/logging") 1935 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1936 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1937 request.Method = "GET" 1938 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1939 if err != nil { 1940 return out, metadata, &smithy.SerializationError{Err: err} 1941 } 1942 1943 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1944 return out, metadata, &smithy.SerializationError{Err: err} 1945 } 1946 in.Request = request 1947 1948 return next.HandleSerialize(ctx, in) 1949} 1950func awsRestjson1_serializeOpHttpBindingsDescribeLoggingOptionsInput(v *DescribeLoggingOptionsInput, encoder *httpbinding.Encoder) error { 1951 if v == nil { 1952 return fmt.Errorf("unsupported serialization of nil %T", v) 1953 } 1954 1955 return nil 1956} 1957 1958type awsRestjson1_serializeOpDescribePortal struct { 1959} 1960 1961func (*awsRestjson1_serializeOpDescribePortal) ID() string { 1962 return "OperationSerializer" 1963} 1964 1965func (m *awsRestjson1_serializeOpDescribePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1966 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1967) { 1968 request, ok := in.Request.(*smithyhttp.Request) 1969 if !ok { 1970 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1971 } 1972 1973 input, ok := in.Parameters.(*DescribePortalInput) 1974 _ = input 1975 if !ok { 1976 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1977 } 1978 1979 opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}") 1980 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1981 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1982 request.Method = "GET" 1983 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1984 if err != nil { 1985 return out, metadata, &smithy.SerializationError{Err: err} 1986 } 1987 1988 if err := awsRestjson1_serializeOpHttpBindingsDescribePortalInput(input, restEncoder); err != nil { 1989 return out, metadata, &smithy.SerializationError{Err: err} 1990 } 1991 1992 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1993 return out, metadata, &smithy.SerializationError{Err: err} 1994 } 1995 in.Request = request 1996 1997 return next.HandleSerialize(ctx, in) 1998} 1999func awsRestjson1_serializeOpHttpBindingsDescribePortalInput(v *DescribePortalInput, encoder *httpbinding.Encoder) error { 2000 if v == nil { 2001 return fmt.Errorf("unsupported serialization of nil %T", v) 2002 } 2003 2004 if v.PortalId == nil || len(*v.PortalId) == 0 { 2005 return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")} 2006 } 2007 if v.PortalId != nil { 2008 if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil { 2009 return err 2010 } 2011 } 2012 2013 return nil 2014} 2015 2016type awsRestjson1_serializeOpDescribeProject struct { 2017} 2018 2019func (*awsRestjson1_serializeOpDescribeProject) ID() string { 2020 return "OperationSerializer" 2021} 2022 2023func (m *awsRestjson1_serializeOpDescribeProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2024 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2025) { 2026 request, ok := in.Request.(*smithyhttp.Request) 2027 if !ok { 2028 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2029 } 2030 2031 input, ok := in.Parameters.(*DescribeProjectInput) 2032 _ = input 2033 if !ok { 2034 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2035 } 2036 2037 opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}") 2038 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2039 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2040 request.Method = "GET" 2041 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2042 if err != nil { 2043 return out, metadata, &smithy.SerializationError{Err: err} 2044 } 2045 2046 if err := awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(input, restEncoder); err != nil { 2047 return out, metadata, &smithy.SerializationError{Err: err} 2048 } 2049 2050 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2051 return out, metadata, &smithy.SerializationError{Err: err} 2052 } 2053 in.Request = request 2054 2055 return next.HandleSerialize(ctx, in) 2056} 2057func awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(v *DescribeProjectInput, encoder *httpbinding.Encoder) error { 2058 if v == nil { 2059 return fmt.Errorf("unsupported serialization of nil %T", v) 2060 } 2061 2062 if v.ProjectId == nil || len(*v.ProjectId) == 0 { 2063 return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} 2064 } 2065 if v.ProjectId != nil { 2066 if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { 2067 return err 2068 } 2069 } 2070 2071 return nil 2072} 2073 2074type awsRestjson1_serializeOpDisassociateAssets struct { 2075} 2076 2077func (*awsRestjson1_serializeOpDisassociateAssets) ID() string { 2078 return "OperationSerializer" 2079} 2080 2081func (m *awsRestjson1_serializeOpDisassociateAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2082 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2083) { 2084 request, ok := in.Request.(*smithyhttp.Request) 2085 if !ok { 2086 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2087 } 2088 2089 input, ok := in.Parameters.(*DisassociateAssetsInput) 2090 _ = input 2091 if !ok { 2092 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2093 } 2094 2095 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/disassociate") 2096 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2097 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2098 request.Method = "POST" 2099 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2100 if err != nil { 2101 return out, metadata, &smithy.SerializationError{Err: err} 2102 } 2103 2104 if err := awsRestjson1_serializeOpHttpBindingsDisassociateAssetsInput(input, restEncoder); err != nil { 2105 return out, metadata, &smithy.SerializationError{Err: err} 2106 } 2107 2108 restEncoder.SetHeader("Content-Type").String("application/json") 2109 2110 jsonEncoder := smithyjson.NewEncoder() 2111 if err := awsRestjson1_serializeOpDocumentDisassociateAssetsInput(input, jsonEncoder.Value); err != nil { 2112 return out, metadata, &smithy.SerializationError{Err: err} 2113 } 2114 2115 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 2116 return out, metadata, &smithy.SerializationError{Err: err} 2117 } 2118 2119 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2120 return out, metadata, &smithy.SerializationError{Err: err} 2121 } 2122 in.Request = request 2123 2124 return next.HandleSerialize(ctx, in) 2125} 2126func awsRestjson1_serializeOpHttpBindingsDisassociateAssetsInput(v *DisassociateAssetsInput, encoder *httpbinding.Encoder) error { 2127 if v == nil { 2128 return fmt.Errorf("unsupported serialization of nil %T", v) 2129 } 2130 2131 if v.AssetId == nil || len(*v.AssetId) == 0 { 2132 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 2133 } 2134 if v.AssetId != nil { 2135 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 2136 return err 2137 } 2138 } 2139 2140 return nil 2141} 2142 2143func awsRestjson1_serializeOpDocumentDisassociateAssetsInput(v *DisassociateAssetsInput, value smithyjson.Value) error { 2144 object := value.Object() 2145 defer object.Close() 2146 2147 if v.ChildAssetId != nil { 2148 ok := object.Key("childAssetId") 2149 ok.String(*v.ChildAssetId) 2150 } 2151 2152 if v.ClientToken != nil { 2153 ok := object.Key("clientToken") 2154 ok.String(*v.ClientToken) 2155 } 2156 2157 if v.HierarchyId != nil { 2158 ok := object.Key("hierarchyId") 2159 ok.String(*v.HierarchyId) 2160 } 2161 2162 return nil 2163} 2164 2165type awsRestjson1_serializeOpGetAssetPropertyAggregates struct { 2166} 2167 2168func (*awsRestjson1_serializeOpGetAssetPropertyAggregates) ID() string { 2169 return "OperationSerializer" 2170} 2171 2172func (m *awsRestjson1_serializeOpGetAssetPropertyAggregates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2173 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2174) { 2175 request, ok := in.Request.(*smithyhttp.Request) 2176 if !ok { 2177 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2178 } 2179 2180 input, ok := in.Parameters.(*GetAssetPropertyAggregatesInput) 2181 _ = input 2182 if !ok { 2183 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2184 } 2185 2186 opPath, opQuery := httpbinding.SplitURI("/properties/aggregates") 2187 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2188 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2189 request.Method = "GET" 2190 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2191 if err != nil { 2192 return out, metadata, &smithy.SerializationError{Err: err} 2193 } 2194 2195 if err := awsRestjson1_serializeOpHttpBindingsGetAssetPropertyAggregatesInput(input, restEncoder); err != nil { 2196 return out, metadata, &smithy.SerializationError{Err: err} 2197 } 2198 2199 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2200 return out, metadata, &smithy.SerializationError{Err: err} 2201 } 2202 in.Request = request 2203 2204 return next.HandleSerialize(ctx, in) 2205} 2206func awsRestjson1_serializeOpHttpBindingsGetAssetPropertyAggregatesInput(v *GetAssetPropertyAggregatesInput, encoder *httpbinding.Encoder) error { 2207 if v == nil { 2208 return fmt.Errorf("unsupported serialization of nil %T", v) 2209 } 2210 2211 if v.AggregateTypes != nil { 2212 for i := range v.AggregateTypes { 2213 encoder.AddQuery("aggregateTypes").String(string(v.AggregateTypes[i])) 2214 } 2215 } 2216 2217 if v.AssetId != nil { 2218 encoder.SetQuery("assetId").String(*v.AssetId) 2219 } 2220 2221 if v.EndDate != nil { 2222 encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate)) 2223 } 2224 2225 if v.MaxResults != nil { 2226 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2227 } 2228 2229 if v.NextToken != nil { 2230 encoder.SetQuery("nextToken").String(*v.NextToken) 2231 } 2232 2233 if v.PropertyAlias != nil { 2234 encoder.SetQuery("propertyAlias").String(*v.PropertyAlias) 2235 } 2236 2237 if v.PropertyId != nil { 2238 encoder.SetQuery("propertyId").String(*v.PropertyId) 2239 } 2240 2241 if v.Qualities != nil { 2242 for i := range v.Qualities { 2243 encoder.AddQuery("qualities").String(string(v.Qualities[i])) 2244 } 2245 } 2246 2247 if v.Resolution != nil { 2248 encoder.SetQuery("resolution").String(*v.Resolution) 2249 } 2250 2251 if v.StartDate != nil { 2252 encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate)) 2253 } 2254 2255 if len(v.TimeOrdering) > 0 { 2256 encoder.SetQuery("timeOrdering").String(string(v.TimeOrdering)) 2257 } 2258 2259 return nil 2260} 2261 2262type awsRestjson1_serializeOpGetAssetPropertyValue struct { 2263} 2264 2265func (*awsRestjson1_serializeOpGetAssetPropertyValue) ID() string { 2266 return "OperationSerializer" 2267} 2268 2269func (m *awsRestjson1_serializeOpGetAssetPropertyValue) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2270 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2271) { 2272 request, ok := in.Request.(*smithyhttp.Request) 2273 if !ok { 2274 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2275 } 2276 2277 input, ok := in.Parameters.(*GetAssetPropertyValueInput) 2278 _ = input 2279 if !ok { 2280 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2281 } 2282 2283 opPath, opQuery := httpbinding.SplitURI("/properties/latest") 2284 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2285 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2286 request.Method = "GET" 2287 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2288 if err != nil { 2289 return out, metadata, &smithy.SerializationError{Err: err} 2290 } 2291 2292 if err := awsRestjson1_serializeOpHttpBindingsGetAssetPropertyValueInput(input, restEncoder); err != nil { 2293 return out, metadata, &smithy.SerializationError{Err: err} 2294 } 2295 2296 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2297 return out, metadata, &smithy.SerializationError{Err: err} 2298 } 2299 in.Request = request 2300 2301 return next.HandleSerialize(ctx, in) 2302} 2303func awsRestjson1_serializeOpHttpBindingsGetAssetPropertyValueInput(v *GetAssetPropertyValueInput, encoder *httpbinding.Encoder) error { 2304 if v == nil { 2305 return fmt.Errorf("unsupported serialization of nil %T", v) 2306 } 2307 2308 if v.AssetId != nil { 2309 encoder.SetQuery("assetId").String(*v.AssetId) 2310 } 2311 2312 if v.PropertyAlias != nil { 2313 encoder.SetQuery("propertyAlias").String(*v.PropertyAlias) 2314 } 2315 2316 if v.PropertyId != nil { 2317 encoder.SetQuery("propertyId").String(*v.PropertyId) 2318 } 2319 2320 return nil 2321} 2322 2323type awsRestjson1_serializeOpGetAssetPropertyValueHistory struct { 2324} 2325 2326func (*awsRestjson1_serializeOpGetAssetPropertyValueHistory) ID() string { 2327 return "OperationSerializer" 2328} 2329 2330func (m *awsRestjson1_serializeOpGetAssetPropertyValueHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2331 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2332) { 2333 request, ok := in.Request.(*smithyhttp.Request) 2334 if !ok { 2335 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2336 } 2337 2338 input, ok := in.Parameters.(*GetAssetPropertyValueHistoryInput) 2339 _ = input 2340 if !ok { 2341 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2342 } 2343 2344 opPath, opQuery := httpbinding.SplitURI("/properties/history") 2345 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2346 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2347 request.Method = "GET" 2348 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2349 if err != nil { 2350 return out, metadata, &smithy.SerializationError{Err: err} 2351 } 2352 2353 if err := awsRestjson1_serializeOpHttpBindingsGetAssetPropertyValueHistoryInput(input, restEncoder); err != nil { 2354 return out, metadata, &smithy.SerializationError{Err: err} 2355 } 2356 2357 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2358 return out, metadata, &smithy.SerializationError{Err: err} 2359 } 2360 in.Request = request 2361 2362 return next.HandleSerialize(ctx, in) 2363} 2364func awsRestjson1_serializeOpHttpBindingsGetAssetPropertyValueHistoryInput(v *GetAssetPropertyValueHistoryInput, encoder *httpbinding.Encoder) error { 2365 if v == nil { 2366 return fmt.Errorf("unsupported serialization of nil %T", v) 2367 } 2368 2369 if v.AssetId != nil { 2370 encoder.SetQuery("assetId").String(*v.AssetId) 2371 } 2372 2373 if v.EndDate != nil { 2374 encoder.SetQuery("endDate").String(smithytime.FormatDateTime(*v.EndDate)) 2375 } 2376 2377 if v.MaxResults != nil { 2378 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2379 } 2380 2381 if v.NextToken != nil { 2382 encoder.SetQuery("nextToken").String(*v.NextToken) 2383 } 2384 2385 if v.PropertyAlias != nil { 2386 encoder.SetQuery("propertyAlias").String(*v.PropertyAlias) 2387 } 2388 2389 if v.PropertyId != nil { 2390 encoder.SetQuery("propertyId").String(*v.PropertyId) 2391 } 2392 2393 if v.Qualities != nil { 2394 for i := range v.Qualities { 2395 encoder.AddQuery("qualities").String(string(v.Qualities[i])) 2396 } 2397 } 2398 2399 if v.StartDate != nil { 2400 encoder.SetQuery("startDate").String(smithytime.FormatDateTime(*v.StartDate)) 2401 } 2402 2403 if len(v.TimeOrdering) > 0 { 2404 encoder.SetQuery("timeOrdering").String(string(v.TimeOrdering)) 2405 } 2406 2407 return nil 2408} 2409 2410type awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues struct { 2411} 2412 2413func (*awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues) ID() string { 2414 return "OperationSerializer" 2415} 2416 2417func (m *awsRestjson1_serializeOpGetInterpolatedAssetPropertyValues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2418 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2419) { 2420 request, ok := in.Request.(*smithyhttp.Request) 2421 if !ok { 2422 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2423 } 2424 2425 input, ok := in.Parameters.(*GetInterpolatedAssetPropertyValuesInput) 2426 _ = input 2427 if !ok { 2428 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2429 } 2430 2431 opPath, opQuery := httpbinding.SplitURI("/properties/interpolated") 2432 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2433 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2434 request.Method = "GET" 2435 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2436 if err != nil { 2437 return out, metadata, &smithy.SerializationError{Err: err} 2438 } 2439 2440 if err := awsRestjson1_serializeOpHttpBindingsGetInterpolatedAssetPropertyValuesInput(input, restEncoder); err != nil { 2441 return out, metadata, &smithy.SerializationError{Err: err} 2442 } 2443 2444 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2445 return out, metadata, &smithy.SerializationError{Err: err} 2446 } 2447 in.Request = request 2448 2449 return next.HandleSerialize(ctx, in) 2450} 2451func awsRestjson1_serializeOpHttpBindingsGetInterpolatedAssetPropertyValuesInput(v *GetInterpolatedAssetPropertyValuesInput, encoder *httpbinding.Encoder) error { 2452 if v == nil { 2453 return fmt.Errorf("unsupported serialization of nil %T", v) 2454 } 2455 2456 if v.AssetId != nil { 2457 encoder.SetQuery("assetId").String(*v.AssetId) 2458 } 2459 2460 if v.EndTimeInSeconds != nil { 2461 encoder.SetQuery("endTimeInSeconds").Long(*v.EndTimeInSeconds) 2462 } 2463 2464 if v.EndTimeOffsetInNanos != nil { 2465 encoder.SetQuery("endTimeOffsetInNanos").Integer(*v.EndTimeOffsetInNanos) 2466 } 2467 2468 if v.IntervalInSeconds != nil { 2469 encoder.SetQuery("intervalInSeconds").Long(*v.IntervalInSeconds) 2470 } 2471 2472 if v.MaxResults != nil { 2473 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2474 } 2475 2476 if v.NextToken != nil { 2477 encoder.SetQuery("nextToken").String(*v.NextToken) 2478 } 2479 2480 if v.PropertyAlias != nil { 2481 encoder.SetQuery("propertyAlias").String(*v.PropertyAlias) 2482 } 2483 2484 if v.PropertyId != nil { 2485 encoder.SetQuery("propertyId").String(*v.PropertyId) 2486 } 2487 2488 if len(v.Quality) > 0 { 2489 encoder.SetQuery("quality").String(string(v.Quality)) 2490 } 2491 2492 if v.StartTimeInSeconds != nil { 2493 encoder.SetQuery("startTimeInSeconds").Long(*v.StartTimeInSeconds) 2494 } 2495 2496 if v.StartTimeOffsetInNanos != nil { 2497 encoder.SetQuery("startTimeOffsetInNanos").Integer(*v.StartTimeOffsetInNanos) 2498 } 2499 2500 if v.Type != nil { 2501 encoder.SetQuery("type").String(*v.Type) 2502 } 2503 2504 return nil 2505} 2506 2507type awsRestjson1_serializeOpListAccessPolicies struct { 2508} 2509 2510func (*awsRestjson1_serializeOpListAccessPolicies) ID() string { 2511 return "OperationSerializer" 2512} 2513 2514func (m *awsRestjson1_serializeOpListAccessPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2515 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2516) { 2517 request, ok := in.Request.(*smithyhttp.Request) 2518 if !ok { 2519 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2520 } 2521 2522 input, ok := in.Parameters.(*ListAccessPoliciesInput) 2523 _ = input 2524 if !ok { 2525 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2526 } 2527 2528 opPath, opQuery := httpbinding.SplitURI("/access-policies") 2529 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2530 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2531 request.Method = "GET" 2532 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2533 if err != nil { 2534 return out, metadata, &smithy.SerializationError{Err: err} 2535 } 2536 2537 if err := awsRestjson1_serializeOpHttpBindingsListAccessPoliciesInput(input, restEncoder); err != nil { 2538 return out, metadata, &smithy.SerializationError{Err: err} 2539 } 2540 2541 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2542 return out, metadata, &smithy.SerializationError{Err: err} 2543 } 2544 in.Request = request 2545 2546 return next.HandleSerialize(ctx, in) 2547} 2548func awsRestjson1_serializeOpHttpBindingsListAccessPoliciesInput(v *ListAccessPoliciesInput, encoder *httpbinding.Encoder) error { 2549 if v == nil { 2550 return fmt.Errorf("unsupported serialization of nil %T", v) 2551 } 2552 2553 if v.IamArn != nil { 2554 encoder.SetQuery("iamArn").String(*v.IamArn) 2555 } 2556 2557 if v.IdentityId != nil { 2558 encoder.SetQuery("identityId").String(*v.IdentityId) 2559 } 2560 2561 if len(v.IdentityType) > 0 { 2562 encoder.SetQuery("identityType").String(string(v.IdentityType)) 2563 } 2564 2565 if v.MaxResults != nil { 2566 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2567 } 2568 2569 if v.NextToken != nil { 2570 encoder.SetQuery("nextToken").String(*v.NextToken) 2571 } 2572 2573 if v.ResourceId != nil { 2574 encoder.SetQuery("resourceId").String(*v.ResourceId) 2575 } 2576 2577 if len(v.ResourceType) > 0 { 2578 encoder.SetQuery("resourceType").String(string(v.ResourceType)) 2579 } 2580 2581 return nil 2582} 2583 2584type awsRestjson1_serializeOpListAssetModels struct { 2585} 2586 2587func (*awsRestjson1_serializeOpListAssetModels) ID() string { 2588 return "OperationSerializer" 2589} 2590 2591func (m *awsRestjson1_serializeOpListAssetModels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2592 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2593) { 2594 request, ok := in.Request.(*smithyhttp.Request) 2595 if !ok { 2596 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2597 } 2598 2599 input, ok := in.Parameters.(*ListAssetModelsInput) 2600 _ = input 2601 if !ok { 2602 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2603 } 2604 2605 opPath, opQuery := httpbinding.SplitURI("/asset-models") 2606 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2607 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2608 request.Method = "GET" 2609 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2610 if err != nil { 2611 return out, metadata, &smithy.SerializationError{Err: err} 2612 } 2613 2614 if err := awsRestjson1_serializeOpHttpBindingsListAssetModelsInput(input, restEncoder); err != nil { 2615 return out, metadata, &smithy.SerializationError{Err: err} 2616 } 2617 2618 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2619 return out, metadata, &smithy.SerializationError{Err: err} 2620 } 2621 in.Request = request 2622 2623 return next.HandleSerialize(ctx, in) 2624} 2625func awsRestjson1_serializeOpHttpBindingsListAssetModelsInput(v *ListAssetModelsInput, encoder *httpbinding.Encoder) error { 2626 if v == nil { 2627 return fmt.Errorf("unsupported serialization of nil %T", v) 2628 } 2629 2630 if v.MaxResults != nil { 2631 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2632 } 2633 2634 if v.NextToken != nil { 2635 encoder.SetQuery("nextToken").String(*v.NextToken) 2636 } 2637 2638 return nil 2639} 2640 2641type awsRestjson1_serializeOpListAssetRelationships struct { 2642} 2643 2644func (*awsRestjson1_serializeOpListAssetRelationships) ID() string { 2645 return "OperationSerializer" 2646} 2647 2648func (m *awsRestjson1_serializeOpListAssetRelationships) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2649 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2650) { 2651 request, ok := in.Request.(*smithyhttp.Request) 2652 if !ok { 2653 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2654 } 2655 2656 input, ok := in.Parameters.(*ListAssetRelationshipsInput) 2657 _ = input 2658 if !ok { 2659 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2660 } 2661 2662 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/assetRelationships") 2663 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2664 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2665 request.Method = "GET" 2666 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2667 if err != nil { 2668 return out, metadata, &smithy.SerializationError{Err: err} 2669 } 2670 2671 if err := awsRestjson1_serializeOpHttpBindingsListAssetRelationshipsInput(input, restEncoder); err != nil { 2672 return out, metadata, &smithy.SerializationError{Err: err} 2673 } 2674 2675 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2676 return out, metadata, &smithy.SerializationError{Err: err} 2677 } 2678 in.Request = request 2679 2680 return next.HandleSerialize(ctx, in) 2681} 2682func awsRestjson1_serializeOpHttpBindingsListAssetRelationshipsInput(v *ListAssetRelationshipsInput, encoder *httpbinding.Encoder) error { 2683 if v == nil { 2684 return fmt.Errorf("unsupported serialization of nil %T", v) 2685 } 2686 2687 if v.AssetId == nil || len(*v.AssetId) == 0 { 2688 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 2689 } 2690 if v.AssetId != nil { 2691 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 2692 return err 2693 } 2694 } 2695 2696 if v.MaxResults != nil { 2697 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2698 } 2699 2700 if v.NextToken != nil { 2701 encoder.SetQuery("nextToken").String(*v.NextToken) 2702 } 2703 2704 if len(v.TraversalType) > 0 { 2705 encoder.SetQuery("traversalType").String(string(v.TraversalType)) 2706 } 2707 2708 return nil 2709} 2710 2711type awsRestjson1_serializeOpListAssets struct { 2712} 2713 2714func (*awsRestjson1_serializeOpListAssets) ID() string { 2715 return "OperationSerializer" 2716} 2717 2718func (m *awsRestjson1_serializeOpListAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2719 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2720) { 2721 request, ok := in.Request.(*smithyhttp.Request) 2722 if !ok { 2723 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2724 } 2725 2726 input, ok := in.Parameters.(*ListAssetsInput) 2727 _ = input 2728 if !ok { 2729 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2730 } 2731 2732 opPath, opQuery := httpbinding.SplitURI("/assets") 2733 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2734 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2735 request.Method = "GET" 2736 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2737 if err != nil { 2738 return out, metadata, &smithy.SerializationError{Err: err} 2739 } 2740 2741 if err := awsRestjson1_serializeOpHttpBindingsListAssetsInput(input, restEncoder); err != nil { 2742 return out, metadata, &smithy.SerializationError{Err: err} 2743 } 2744 2745 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2746 return out, metadata, &smithy.SerializationError{Err: err} 2747 } 2748 in.Request = request 2749 2750 return next.HandleSerialize(ctx, in) 2751} 2752func awsRestjson1_serializeOpHttpBindingsListAssetsInput(v *ListAssetsInput, encoder *httpbinding.Encoder) error { 2753 if v == nil { 2754 return fmt.Errorf("unsupported serialization of nil %T", v) 2755 } 2756 2757 if v.AssetModelId != nil { 2758 encoder.SetQuery("assetModelId").String(*v.AssetModelId) 2759 } 2760 2761 if len(v.Filter) > 0 { 2762 encoder.SetQuery("filter").String(string(v.Filter)) 2763 } 2764 2765 if v.MaxResults != nil { 2766 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2767 } 2768 2769 if v.NextToken != nil { 2770 encoder.SetQuery("nextToken").String(*v.NextToken) 2771 } 2772 2773 return nil 2774} 2775 2776type awsRestjson1_serializeOpListAssociatedAssets struct { 2777} 2778 2779func (*awsRestjson1_serializeOpListAssociatedAssets) ID() string { 2780 return "OperationSerializer" 2781} 2782 2783func (m *awsRestjson1_serializeOpListAssociatedAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2784 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2785) { 2786 request, ok := in.Request.(*smithyhttp.Request) 2787 if !ok { 2788 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2789 } 2790 2791 input, ok := in.Parameters.(*ListAssociatedAssetsInput) 2792 _ = input 2793 if !ok { 2794 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2795 } 2796 2797 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/hierarchies") 2798 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2799 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2800 request.Method = "GET" 2801 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2802 if err != nil { 2803 return out, metadata, &smithy.SerializationError{Err: err} 2804 } 2805 2806 if err := awsRestjson1_serializeOpHttpBindingsListAssociatedAssetsInput(input, restEncoder); err != nil { 2807 return out, metadata, &smithy.SerializationError{Err: err} 2808 } 2809 2810 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2811 return out, metadata, &smithy.SerializationError{Err: err} 2812 } 2813 in.Request = request 2814 2815 return next.HandleSerialize(ctx, in) 2816} 2817func awsRestjson1_serializeOpHttpBindingsListAssociatedAssetsInput(v *ListAssociatedAssetsInput, encoder *httpbinding.Encoder) error { 2818 if v == nil { 2819 return fmt.Errorf("unsupported serialization of nil %T", v) 2820 } 2821 2822 if v.AssetId == nil || len(*v.AssetId) == 0 { 2823 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 2824 } 2825 if v.AssetId != nil { 2826 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 2827 return err 2828 } 2829 } 2830 2831 if v.HierarchyId != nil { 2832 encoder.SetQuery("hierarchyId").String(*v.HierarchyId) 2833 } 2834 2835 if v.MaxResults != nil { 2836 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2837 } 2838 2839 if v.NextToken != nil { 2840 encoder.SetQuery("nextToken").String(*v.NextToken) 2841 } 2842 2843 if len(v.TraversalDirection) > 0 { 2844 encoder.SetQuery("traversalDirection").String(string(v.TraversalDirection)) 2845 } 2846 2847 return nil 2848} 2849 2850type awsRestjson1_serializeOpListDashboards struct { 2851} 2852 2853func (*awsRestjson1_serializeOpListDashboards) ID() string { 2854 return "OperationSerializer" 2855} 2856 2857func (m *awsRestjson1_serializeOpListDashboards) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2858 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2859) { 2860 request, ok := in.Request.(*smithyhttp.Request) 2861 if !ok { 2862 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2863 } 2864 2865 input, ok := in.Parameters.(*ListDashboardsInput) 2866 _ = input 2867 if !ok { 2868 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2869 } 2870 2871 opPath, opQuery := httpbinding.SplitURI("/dashboards") 2872 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2873 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2874 request.Method = "GET" 2875 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2876 if err != nil { 2877 return out, metadata, &smithy.SerializationError{Err: err} 2878 } 2879 2880 if err := awsRestjson1_serializeOpHttpBindingsListDashboardsInput(input, restEncoder); err != nil { 2881 return out, metadata, &smithy.SerializationError{Err: err} 2882 } 2883 2884 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2885 return out, metadata, &smithy.SerializationError{Err: err} 2886 } 2887 in.Request = request 2888 2889 return next.HandleSerialize(ctx, in) 2890} 2891func awsRestjson1_serializeOpHttpBindingsListDashboardsInput(v *ListDashboardsInput, encoder *httpbinding.Encoder) error { 2892 if v == nil { 2893 return fmt.Errorf("unsupported serialization of nil %T", v) 2894 } 2895 2896 if v.MaxResults != nil { 2897 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2898 } 2899 2900 if v.NextToken != nil { 2901 encoder.SetQuery("nextToken").String(*v.NextToken) 2902 } 2903 2904 if v.ProjectId != nil { 2905 encoder.SetQuery("projectId").String(*v.ProjectId) 2906 } 2907 2908 return nil 2909} 2910 2911type awsRestjson1_serializeOpListGateways struct { 2912} 2913 2914func (*awsRestjson1_serializeOpListGateways) ID() string { 2915 return "OperationSerializer" 2916} 2917 2918func (m *awsRestjson1_serializeOpListGateways) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2919 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2920) { 2921 request, ok := in.Request.(*smithyhttp.Request) 2922 if !ok { 2923 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2924 } 2925 2926 input, ok := in.Parameters.(*ListGatewaysInput) 2927 _ = input 2928 if !ok { 2929 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2930 } 2931 2932 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways") 2933 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2934 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2935 request.Method = "GET" 2936 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2937 if err != nil { 2938 return out, metadata, &smithy.SerializationError{Err: err} 2939 } 2940 2941 if err := awsRestjson1_serializeOpHttpBindingsListGatewaysInput(input, restEncoder); err != nil { 2942 return out, metadata, &smithy.SerializationError{Err: err} 2943 } 2944 2945 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2946 return out, metadata, &smithy.SerializationError{Err: err} 2947 } 2948 in.Request = request 2949 2950 return next.HandleSerialize(ctx, in) 2951} 2952func awsRestjson1_serializeOpHttpBindingsListGatewaysInput(v *ListGatewaysInput, encoder *httpbinding.Encoder) error { 2953 if v == nil { 2954 return fmt.Errorf("unsupported serialization of nil %T", v) 2955 } 2956 2957 if v.MaxResults != nil { 2958 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 2959 } 2960 2961 if v.NextToken != nil { 2962 encoder.SetQuery("nextToken").String(*v.NextToken) 2963 } 2964 2965 return nil 2966} 2967 2968type awsRestjson1_serializeOpListPortals struct { 2969} 2970 2971func (*awsRestjson1_serializeOpListPortals) ID() string { 2972 return "OperationSerializer" 2973} 2974 2975func (m *awsRestjson1_serializeOpListPortals) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2976 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2977) { 2978 request, ok := in.Request.(*smithyhttp.Request) 2979 if !ok { 2980 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2981 } 2982 2983 input, ok := in.Parameters.(*ListPortalsInput) 2984 _ = input 2985 if !ok { 2986 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2987 } 2988 2989 opPath, opQuery := httpbinding.SplitURI("/portals") 2990 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 2991 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 2992 request.Method = "GET" 2993 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2994 if err != nil { 2995 return out, metadata, &smithy.SerializationError{Err: err} 2996 } 2997 2998 if err := awsRestjson1_serializeOpHttpBindingsListPortalsInput(input, restEncoder); err != nil { 2999 return out, metadata, &smithy.SerializationError{Err: err} 3000 } 3001 3002 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3003 return out, metadata, &smithy.SerializationError{Err: err} 3004 } 3005 in.Request = request 3006 3007 return next.HandleSerialize(ctx, in) 3008} 3009func awsRestjson1_serializeOpHttpBindingsListPortalsInput(v *ListPortalsInput, encoder *httpbinding.Encoder) error { 3010 if v == nil { 3011 return fmt.Errorf("unsupported serialization of nil %T", v) 3012 } 3013 3014 if v.MaxResults != nil { 3015 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 3016 } 3017 3018 if v.NextToken != nil { 3019 encoder.SetQuery("nextToken").String(*v.NextToken) 3020 } 3021 3022 return nil 3023} 3024 3025type awsRestjson1_serializeOpListProjectAssets struct { 3026} 3027 3028func (*awsRestjson1_serializeOpListProjectAssets) ID() string { 3029 return "OperationSerializer" 3030} 3031 3032func (m *awsRestjson1_serializeOpListProjectAssets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3033 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3034) { 3035 request, ok := in.Request.(*smithyhttp.Request) 3036 if !ok { 3037 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3038 } 3039 3040 input, ok := in.Parameters.(*ListProjectAssetsInput) 3041 _ = input 3042 if !ok { 3043 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3044 } 3045 3046 opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}/assets") 3047 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3048 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3049 request.Method = "GET" 3050 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3051 if err != nil { 3052 return out, metadata, &smithy.SerializationError{Err: err} 3053 } 3054 3055 if err := awsRestjson1_serializeOpHttpBindingsListProjectAssetsInput(input, restEncoder); err != nil { 3056 return out, metadata, &smithy.SerializationError{Err: err} 3057 } 3058 3059 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3060 return out, metadata, &smithy.SerializationError{Err: err} 3061 } 3062 in.Request = request 3063 3064 return next.HandleSerialize(ctx, in) 3065} 3066func awsRestjson1_serializeOpHttpBindingsListProjectAssetsInput(v *ListProjectAssetsInput, encoder *httpbinding.Encoder) error { 3067 if v == nil { 3068 return fmt.Errorf("unsupported serialization of nil %T", v) 3069 } 3070 3071 if v.MaxResults != nil { 3072 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 3073 } 3074 3075 if v.NextToken != nil { 3076 encoder.SetQuery("nextToken").String(*v.NextToken) 3077 } 3078 3079 if v.ProjectId == nil || len(*v.ProjectId) == 0 { 3080 return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} 3081 } 3082 if v.ProjectId != nil { 3083 if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { 3084 return err 3085 } 3086 } 3087 3088 return nil 3089} 3090 3091type awsRestjson1_serializeOpListProjects struct { 3092} 3093 3094func (*awsRestjson1_serializeOpListProjects) ID() string { 3095 return "OperationSerializer" 3096} 3097 3098func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3099 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3100) { 3101 request, ok := in.Request.(*smithyhttp.Request) 3102 if !ok { 3103 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3104 } 3105 3106 input, ok := in.Parameters.(*ListProjectsInput) 3107 _ = input 3108 if !ok { 3109 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3110 } 3111 3112 opPath, opQuery := httpbinding.SplitURI("/projects") 3113 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3114 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3115 request.Method = "GET" 3116 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3117 if err != nil { 3118 return out, metadata, &smithy.SerializationError{Err: err} 3119 } 3120 3121 if err := awsRestjson1_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil { 3122 return out, metadata, &smithy.SerializationError{Err: err} 3123 } 3124 3125 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3126 return out, metadata, &smithy.SerializationError{Err: err} 3127 } 3128 in.Request = request 3129 3130 return next.HandleSerialize(ctx, in) 3131} 3132func awsRestjson1_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error { 3133 if v == nil { 3134 return fmt.Errorf("unsupported serialization of nil %T", v) 3135 } 3136 3137 if v.MaxResults != nil { 3138 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 3139 } 3140 3141 if v.NextToken != nil { 3142 encoder.SetQuery("nextToken").String(*v.NextToken) 3143 } 3144 3145 if v.PortalId != nil { 3146 encoder.SetQuery("portalId").String(*v.PortalId) 3147 } 3148 3149 return nil 3150} 3151 3152type awsRestjson1_serializeOpListTagsForResource struct { 3153} 3154 3155func (*awsRestjson1_serializeOpListTagsForResource) ID() string { 3156 return "OperationSerializer" 3157} 3158 3159func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3160 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3161) { 3162 request, ok := in.Request.(*smithyhttp.Request) 3163 if !ok { 3164 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3165 } 3166 3167 input, ok := in.Parameters.(*ListTagsForResourceInput) 3168 _ = input 3169 if !ok { 3170 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3171 } 3172 3173 opPath, opQuery := httpbinding.SplitURI("/tags") 3174 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3175 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3176 request.Method = "GET" 3177 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3178 if err != nil { 3179 return out, metadata, &smithy.SerializationError{Err: err} 3180 } 3181 3182 if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { 3183 return out, metadata, &smithy.SerializationError{Err: err} 3184 } 3185 3186 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3187 return out, metadata, &smithy.SerializationError{Err: err} 3188 } 3189 in.Request = request 3190 3191 return next.HandleSerialize(ctx, in) 3192} 3193func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { 3194 if v == nil { 3195 return fmt.Errorf("unsupported serialization of nil %T", v) 3196 } 3197 3198 if v.ResourceArn != nil { 3199 encoder.SetQuery("resourceArn").String(*v.ResourceArn) 3200 } 3201 3202 return nil 3203} 3204 3205type awsRestjson1_serializeOpPutDefaultEncryptionConfiguration struct { 3206} 3207 3208func (*awsRestjson1_serializeOpPutDefaultEncryptionConfiguration) ID() string { 3209 return "OperationSerializer" 3210} 3211 3212func (m *awsRestjson1_serializeOpPutDefaultEncryptionConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3213 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3214) { 3215 request, ok := in.Request.(*smithyhttp.Request) 3216 if !ok { 3217 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3218 } 3219 3220 input, ok := in.Parameters.(*PutDefaultEncryptionConfigurationInput) 3221 _ = input 3222 if !ok { 3223 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3224 } 3225 3226 opPath, opQuery := httpbinding.SplitURI("/configuration/account/encryption") 3227 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3228 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3229 request.Method = "POST" 3230 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3231 if err != nil { 3232 return out, metadata, &smithy.SerializationError{Err: err} 3233 } 3234 3235 restEncoder.SetHeader("Content-Type").String("application/json") 3236 3237 jsonEncoder := smithyjson.NewEncoder() 3238 if err := awsRestjson1_serializeOpDocumentPutDefaultEncryptionConfigurationInput(input, jsonEncoder.Value); err != nil { 3239 return out, metadata, &smithy.SerializationError{Err: err} 3240 } 3241 3242 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3243 return out, metadata, &smithy.SerializationError{Err: err} 3244 } 3245 3246 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3247 return out, metadata, &smithy.SerializationError{Err: err} 3248 } 3249 in.Request = request 3250 3251 return next.HandleSerialize(ctx, in) 3252} 3253func awsRestjson1_serializeOpHttpBindingsPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput, encoder *httpbinding.Encoder) error { 3254 if v == nil { 3255 return fmt.Errorf("unsupported serialization of nil %T", v) 3256 } 3257 3258 return nil 3259} 3260 3261func awsRestjson1_serializeOpDocumentPutDefaultEncryptionConfigurationInput(v *PutDefaultEncryptionConfigurationInput, value smithyjson.Value) error { 3262 object := value.Object() 3263 defer object.Close() 3264 3265 if len(v.EncryptionType) > 0 { 3266 ok := object.Key("encryptionType") 3267 ok.String(string(v.EncryptionType)) 3268 } 3269 3270 if v.KmsKeyId != nil { 3271 ok := object.Key("kmsKeyId") 3272 ok.String(*v.KmsKeyId) 3273 } 3274 3275 return nil 3276} 3277 3278type awsRestjson1_serializeOpPutLoggingOptions struct { 3279} 3280 3281func (*awsRestjson1_serializeOpPutLoggingOptions) ID() string { 3282 return "OperationSerializer" 3283} 3284 3285func (m *awsRestjson1_serializeOpPutLoggingOptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3286 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3287) { 3288 request, ok := in.Request.(*smithyhttp.Request) 3289 if !ok { 3290 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3291 } 3292 3293 input, ok := in.Parameters.(*PutLoggingOptionsInput) 3294 _ = input 3295 if !ok { 3296 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3297 } 3298 3299 opPath, opQuery := httpbinding.SplitURI("/logging") 3300 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3301 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3302 request.Method = "PUT" 3303 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3304 if err != nil { 3305 return out, metadata, &smithy.SerializationError{Err: err} 3306 } 3307 3308 restEncoder.SetHeader("Content-Type").String("application/json") 3309 3310 jsonEncoder := smithyjson.NewEncoder() 3311 if err := awsRestjson1_serializeOpDocumentPutLoggingOptionsInput(input, jsonEncoder.Value); err != nil { 3312 return out, metadata, &smithy.SerializationError{Err: err} 3313 } 3314 3315 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3316 return out, metadata, &smithy.SerializationError{Err: err} 3317 } 3318 3319 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3320 return out, metadata, &smithy.SerializationError{Err: err} 3321 } 3322 in.Request = request 3323 3324 return next.HandleSerialize(ctx, in) 3325} 3326func awsRestjson1_serializeOpHttpBindingsPutLoggingOptionsInput(v *PutLoggingOptionsInput, encoder *httpbinding.Encoder) error { 3327 if v == nil { 3328 return fmt.Errorf("unsupported serialization of nil %T", v) 3329 } 3330 3331 return nil 3332} 3333 3334func awsRestjson1_serializeOpDocumentPutLoggingOptionsInput(v *PutLoggingOptionsInput, value smithyjson.Value) error { 3335 object := value.Object() 3336 defer object.Close() 3337 3338 if v.LoggingOptions != nil { 3339 ok := object.Key("loggingOptions") 3340 if err := awsRestjson1_serializeDocumentLoggingOptions(v.LoggingOptions, ok); err != nil { 3341 return err 3342 } 3343 } 3344 3345 return nil 3346} 3347 3348type awsRestjson1_serializeOpTagResource struct { 3349} 3350 3351func (*awsRestjson1_serializeOpTagResource) ID() string { 3352 return "OperationSerializer" 3353} 3354 3355func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3356 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3357) { 3358 request, ok := in.Request.(*smithyhttp.Request) 3359 if !ok { 3360 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3361 } 3362 3363 input, ok := in.Parameters.(*TagResourceInput) 3364 _ = input 3365 if !ok { 3366 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3367 } 3368 3369 opPath, opQuery := httpbinding.SplitURI("/tags") 3370 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3371 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3372 request.Method = "POST" 3373 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3374 if err != nil { 3375 return out, metadata, &smithy.SerializationError{Err: err} 3376 } 3377 3378 if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { 3379 return out, metadata, &smithy.SerializationError{Err: err} 3380 } 3381 3382 restEncoder.SetHeader("Content-Type").String("application/json") 3383 3384 jsonEncoder := smithyjson.NewEncoder() 3385 if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { 3386 return out, metadata, &smithy.SerializationError{Err: err} 3387 } 3388 3389 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3390 return out, metadata, &smithy.SerializationError{Err: err} 3391 } 3392 3393 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3394 return out, metadata, &smithy.SerializationError{Err: err} 3395 } 3396 in.Request = request 3397 3398 return next.HandleSerialize(ctx, in) 3399} 3400func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { 3401 if v == nil { 3402 return fmt.Errorf("unsupported serialization of nil %T", v) 3403 } 3404 3405 if v.ResourceArn != nil { 3406 encoder.SetQuery("resourceArn").String(*v.ResourceArn) 3407 } 3408 3409 return nil 3410} 3411 3412func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { 3413 object := value.Object() 3414 defer object.Close() 3415 3416 if v.Tags != nil { 3417 ok := object.Key("tags") 3418 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 3419 return err 3420 } 3421 } 3422 3423 return nil 3424} 3425 3426type awsRestjson1_serializeOpUntagResource struct { 3427} 3428 3429func (*awsRestjson1_serializeOpUntagResource) ID() string { 3430 return "OperationSerializer" 3431} 3432 3433func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3434 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3435) { 3436 request, ok := in.Request.(*smithyhttp.Request) 3437 if !ok { 3438 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3439 } 3440 3441 input, ok := in.Parameters.(*UntagResourceInput) 3442 _ = input 3443 if !ok { 3444 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3445 } 3446 3447 opPath, opQuery := httpbinding.SplitURI("/tags") 3448 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3449 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3450 request.Method = "DELETE" 3451 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3452 if err != nil { 3453 return out, metadata, &smithy.SerializationError{Err: err} 3454 } 3455 3456 if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { 3457 return out, metadata, &smithy.SerializationError{Err: err} 3458 } 3459 3460 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3461 return out, metadata, &smithy.SerializationError{Err: err} 3462 } 3463 in.Request = request 3464 3465 return next.HandleSerialize(ctx, in) 3466} 3467func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { 3468 if v == nil { 3469 return fmt.Errorf("unsupported serialization of nil %T", v) 3470 } 3471 3472 if v.ResourceArn != nil { 3473 encoder.SetQuery("resourceArn").String(*v.ResourceArn) 3474 } 3475 3476 if v.TagKeys != nil { 3477 for i := range v.TagKeys { 3478 encoder.AddQuery("tagKeys").String(v.TagKeys[i]) 3479 } 3480 } 3481 3482 return nil 3483} 3484 3485type awsRestjson1_serializeOpUpdateAccessPolicy struct { 3486} 3487 3488func (*awsRestjson1_serializeOpUpdateAccessPolicy) ID() string { 3489 return "OperationSerializer" 3490} 3491 3492func (m *awsRestjson1_serializeOpUpdateAccessPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3493 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3494) { 3495 request, ok := in.Request.(*smithyhttp.Request) 3496 if !ok { 3497 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3498 } 3499 3500 input, ok := in.Parameters.(*UpdateAccessPolicyInput) 3501 _ = input 3502 if !ok { 3503 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3504 } 3505 3506 opPath, opQuery := httpbinding.SplitURI("/access-policies/{accessPolicyId}") 3507 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3508 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3509 request.Method = "PUT" 3510 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3511 if err != nil { 3512 return out, metadata, &smithy.SerializationError{Err: err} 3513 } 3514 3515 if err := awsRestjson1_serializeOpHttpBindingsUpdateAccessPolicyInput(input, restEncoder); err != nil { 3516 return out, metadata, &smithy.SerializationError{Err: err} 3517 } 3518 3519 restEncoder.SetHeader("Content-Type").String("application/json") 3520 3521 jsonEncoder := smithyjson.NewEncoder() 3522 if err := awsRestjson1_serializeOpDocumentUpdateAccessPolicyInput(input, jsonEncoder.Value); err != nil { 3523 return out, metadata, &smithy.SerializationError{Err: err} 3524 } 3525 3526 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3527 return out, metadata, &smithy.SerializationError{Err: err} 3528 } 3529 3530 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3531 return out, metadata, &smithy.SerializationError{Err: err} 3532 } 3533 in.Request = request 3534 3535 return next.HandleSerialize(ctx, in) 3536} 3537func awsRestjson1_serializeOpHttpBindingsUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, encoder *httpbinding.Encoder) error { 3538 if v == nil { 3539 return fmt.Errorf("unsupported serialization of nil %T", v) 3540 } 3541 3542 if v.AccessPolicyId == nil || len(*v.AccessPolicyId) == 0 { 3543 return &smithy.SerializationError{Err: fmt.Errorf("input member accessPolicyId must not be empty")} 3544 } 3545 if v.AccessPolicyId != nil { 3546 if err := encoder.SetURI("accessPolicyId").String(*v.AccessPolicyId); err != nil { 3547 return err 3548 } 3549 } 3550 3551 return nil 3552} 3553 3554func awsRestjson1_serializeOpDocumentUpdateAccessPolicyInput(v *UpdateAccessPolicyInput, value smithyjson.Value) error { 3555 object := value.Object() 3556 defer object.Close() 3557 3558 if v.AccessPolicyIdentity != nil { 3559 ok := object.Key("accessPolicyIdentity") 3560 if err := awsRestjson1_serializeDocumentIdentity(v.AccessPolicyIdentity, ok); err != nil { 3561 return err 3562 } 3563 } 3564 3565 if len(v.AccessPolicyPermission) > 0 { 3566 ok := object.Key("accessPolicyPermission") 3567 ok.String(string(v.AccessPolicyPermission)) 3568 } 3569 3570 if v.AccessPolicyResource != nil { 3571 ok := object.Key("accessPolicyResource") 3572 if err := awsRestjson1_serializeDocumentResource(v.AccessPolicyResource, ok); err != nil { 3573 return err 3574 } 3575 } 3576 3577 if v.ClientToken != nil { 3578 ok := object.Key("clientToken") 3579 ok.String(*v.ClientToken) 3580 } 3581 3582 return nil 3583} 3584 3585type awsRestjson1_serializeOpUpdateAsset struct { 3586} 3587 3588func (*awsRestjson1_serializeOpUpdateAsset) ID() string { 3589 return "OperationSerializer" 3590} 3591 3592func (m *awsRestjson1_serializeOpUpdateAsset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3593 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3594) { 3595 request, ok := in.Request.(*smithyhttp.Request) 3596 if !ok { 3597 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3598 } 3599 3600 input, ok := in.Parameters.(*UpdateAssetInput) 3601 _ = input 3602 if !ok { 3603 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3604 } 3605 3606 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}") 3607 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3608 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3609 request.Method = "PUT" 3610 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3611 if err != nil { 3612 return out, metadata, &smithy.SerializationError{Err: err} 3613 } 3614 3615 if err := awsRestjson1_serializeOpHttpBindingsUpdateAssetInput(input, restEncoder); err != nil { 3616 return out, metadata, &smithy.SerializationError{Err: err} 3617 } 3618 3619 restEncoder.SetHeader("Content-Type").String("application/json") 3620 3621 jsonEncoder := smithyjson.NewEncoder() 3622 if err := awsRestjson1_serializeOpDocumentUpdateAssetInput(input, jsonEncoder.Value); err != nil { 3623 return out, metadata, &smithy.SerializationError{Err: err} 3624 } 3625 3626 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3627 return out, metadata, &smithy.SerializationError{Err: err} 3628 } 3629 3630 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3631 return out, metadata, &smithy.SerializationError{Err: err} 3632 } 3633 in.Request = request 3634 3635 return next.HandleSerialize(ctx, in) 3636} 3637func awsRestjson1_serializeOpHttpBindingsUpdateAssetInput(v *UpdateAssetInput, encoder *httpbinding.Encoder) error { 3638 if v == nil { 3639 return fmt.Errorf("unsupported serialization of nil %T", v) 3640 } 3641 3642 if v.AssetId == nil || len(*v.AssetId) == 0 { 3643 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 3644 } 3645 if v.AssetId != nil { 3646 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 3647 return err 3648 } 3649 } 3650 3651 return nil 3652} 3653 3654func awsRestjson1_serializeOpDocumentUpdateAssetInput(v *UpdateAssetInput, value smithyjson.Value) error { 3655 object := value.Object() 3656 defer object.Close() 3657 3658 if v.AssetName != nil { 3659 ok := object.Key("assetName") 3660 ok.String(*v.AssetName) 3661 } 3662 3663 if v.ClientToken != nil { 3664 ok := object.Key("clientToken") 3665 ok.String(*v.ClientToken) 3666 } 3667 3668 return nil 3669} 3670 3671type awsRestjson1_serializeOpUpdateAssetModel struct { 3672} 3673 3674func (*awsRestjson1_serializeOpUpdateAssetModel) ID() string { 3675 return "OperationSerializer" 3676} 3677 3678func (m *awsRestjson1_serializeOpUpdateAssetModel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3679 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3680) { 3681 request, ok := in.Request.(*smithyhttp.Request) 3682 if !ok { 3683 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3684 } 3685 3686 input, ok := in.Parameters.(*UpdateAssetModelInput) 3687 _ = input 3688 if !ok { 3689 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3690 } 3691 3692 opPath, opQuery := httpbinding.SplitURI("/asset-models/{assetModelId}") 3693 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3694 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3695 request.Method = "PUT" 3696 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3697 if err != nil { 3698 return out, metadata, &smithy.SerializationError{Err: err} 3699 } 3700 3701 if err := awsRestjson1_serializeOpHttpBindingsUpdateAssetModelInput(input, restEncoder); err != nil { 3702 return out, metadata, &smithy.SerializationError{Err: err} 3703 } 3704 3705 restEncoder.SetHeader("Content-Type").String("application/json") 3706 3707 jsonEncoder := smithyjson.NewEncoder() 3708 if err := awsRestjson1_serializeOpDocumentUpdateAssetModelInput(input, jsonEncoder.Value); err != nil { 3709 return out, metadata, &smithy.SerializationError{Err: err} 3710 } 3711 3712 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3713 return out, metadata, &smithy.SerializationError{Err: err} 3714 } 3715 3716 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3717 return out, metadata, &smithy.SerializationError{Err: err} 3718 } 3719 in.Request = request 3720 3721 return next.HandleSerialize(ctx, in) 3722} 3723func awsRestjson1_serializeOpHttpBindingsUpdateAssetModelInput(v *UpdateAssetModelInput, encoder *httpbinding.Encoder) error { 3724 if v == nil { 3725 return fmt.Errorf("unsupported serialization of nil %T", v) 3726 } 3727 3728 if v.AssetModelId == nil || len(*v.AssetModelId) == 0 { 3729 return &smithy.SerializationError{Err: fmt.Errorf("input member assetModelId must not be empty")} 3730 } 3731 if v.AssetModelId != nil { 3732 if err := encoder.SetURI("assetModelId").String(*v.AssetModelId); err != nil { 3733 return err 3734 } 3735 } 3736 3737 return nil 3738} 3739 3740func awsRestjson1_serializeOpDocumentUpdateAssetModelInput(v *UpdateAssetModelInput, value smithyjson.Value) error { 3741 object := value.Object() 3742 defer object.Close() 3743 3744 if v.AssetModelCompositeModels != nil { 3745 ok := object.Key("assetModelCompositeModels") 3746 if err := awsRestjson1_serializeDocumentAssetModelCompositeModels(v.AssetModelCompositeModels, ok); err != nil { 3747 return err 3748 } 3749 } 3750 3751 if v.AssetModelDescription != nil { 3752 ok := object.Key("assetModelDescription") 3753 ok.String(*v.AssetModelDescription) 3754 } 3755 3756 if v.AssetModelHierarchies != nil { 3757 ok := object.Key("assetModelHierarchies") 3758 if err := awsRestjson1_serializeDocumentAssetModelHierarchies(v.AssetModelHierarchies, ok); err != nil { 3759 return err 3760 } 3761 } 3762 3763 if v.AssetModelName != nil { 3764 ok := object.Key("assetModelName") 3765 ok.String(*v.AssetModelName) 3766 } 3767 3768 if v.AssetModelProperties != nil { 3769 ok := object.Key("assetModelProperties") 3770 if err := awsRestjson1_serializeDocumentAssetModelProperties(v.AssetModelProperties, ok); err != nil { 3771 return err 3772 } 3773 } 3774 3775 if v.ClientToken != nil { 3776 ok := object.Key("clientToken") 3777 ok.String(*v.ClientToken) 3778 } 3779 3780 return nil 3781} 3782 3783type awsRestjson1_serializeOpUpdateAssetProperty struct { 3784} 3785 3786func (*awsRestjson1_serializeOpUpdateAssetProperty) ID() string { 3787 return "OperationSerializer" 3788} 3789 3790func (m *awsRestjson1_serializeOpUpdateAssetProperty) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3791 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3792) { 3793 request, ok := in.Request.(*smithyhttp.Request) 3794 if !ok { 3795 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3796 } 3797 3798 input, ok := in.Parameters.(*UpdateAssetPropertyInput) 3799 _ = input 3800 if !ok { 3801 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3802 } 3803 3804 opPath, opQuery := httpbinding.SplitURI("/assets/{assetId}/properties/{propertyId}") 3805 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3806 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3807 request.Method = "PUT" 3808 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3809 if err != nil { 3810 return out, metadata, &smithy.SerializationError{Err: err} 3811 } 3812 3813 if err := awsRestjson1_serializeOpHttpBindingsUpdateAssetPropertyInput(input, restEncoder); err != nil { 3814 return out, metadata, &smithy.SerializationError{Err: err} 3815 } 3816 3817 restEncoder.SetHeader("Content-Type").String("application/json") 3818 3819 jsonEncoder := smithyjson.NewEncoder() 3820 if err := awsRestjson1_serializeOpDocumentUpdateAssetPropertyInput(input, jsonEncoder.Value); err != nil { 3821 return out, metadata, &smithy.SerializationError{Err: err} 3822 } 3823 3824 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3825 return out, metadata, &smithy.SerializationError{Err: err} 3826 } 3827 3828 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3829 return out, metadata, &smithy.SerializationError{Err: err} 3830 } 3831 in.Request = request 3832 3833 return next.HandleSerialize(ctx, in) 3834} 3835func awsRestjson1_serializeOpHttpBindingsUpdateAssetPropertyInput(v *UpdateAssetPropertyInput, encoder *httpbinding.Encoder) error { 3836 if v == nil { 3837 return fmt.Errorf("unsupported serialization of nil %T", v) 3838 } 3839 3840 if v.AssetId == nil || len(*v.AssetId) == 0 { 3841 return &smithy.SerializationError{Err: fmt.Errorf("input member assetId must not be empty")} 3842 } 3843 if v.AssetId != nil { 3844 if err := encoder.SetURI("assetId").String(*v.AssetId); err != nil { 3845 return err 3846 } 3847 } 3848 3849 if v.PropertyId == nil || len(*v.PropertyId) == 0 { 3850 return &smithy.SerializationError{Err: fmt.Errorf("input member propertyId must not be empty")} 3851 } 3852 if v.PropertyId != nil { 3853 if err := encoder.SetURI("propertyId").String(*v.PropertyId); err != nil { 3854 return err 3855 } 3856 } 3857 3858 return nil 3859} 3860 3861func awsRestjson1_serializeOpDocumentUpdateAssetPropertyInput(v *UpdateAssetPropertyInput, value smithyjson.Value) error { 3862 object := value.Object() 3863 defer object.Close() 3864 3865 if v.ClientToken != nil { 3866 ok := object.Key("clientToken") 3867 ok.String(*v.ClientToken) 3868 } 3869 3870 if v.PropertyAlias != nil { 3871 ok := object.Key("propertyAlias") 3872 ok.String(*v.PropertyAlias) 3873 } 3874 3875 if len(v.PropertyNotificationState) > 0 { 3876 ok := object.Key("propertyNotificationState") 3877 ok.String(string(v.PropertyNotificationState)) 3878 } 3879 3880 return nil 3881} 3882 3883type awsRestjson1_serializeOpUpdateDashboard struct { 3884} 3885 3886func (*awsRestjson1_serializeOpUpdateDashboard) ID() string { 3887 return "OperationSerializer" 3888} 3889 3890func (m *awsRestjson1_serializeOpUpdateDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3891 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3892) { 3893 request, ok := in.Request.(*smithyhttp.Request) 3894 if !ok { 3895 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3896 } 3897 3898 input, ok := in.Parameters.(*UpdateDashboardInput) 3899 _ = input 3900 if !ok { 3901 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3902 } 3903 3904 opPath, opQuery := httpbinding.SplitURI("/dashboards/{dashboardId}") 3905 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 3906 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 3907 request.Method = "PUT" 3908 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3909 if err != nil { 3910 return out, metadata, &smithy.SerializationError{Err: err} 3911 } 3912 3913 if err := awsRestjson1_serializeOpHttpBindingsUpdateDashboardInput(input, restEncoder); err != nil { 3914 return out, metadata, &smithy.SerializationError{Err: err} 3915 } 3916 3917 restEncoder.SetHeader("Content-Type").String("application/json") 3918 3919 jsonEncoder := smithyjson.NewEncoder() 3920 if err := awsRestjson1_serializeOpDocumentUpdateDashboardInput(input, jsonEncoder.Value); err != nil { 3921 return out, metadata, &smithy.SerializationError{Err: err} 3922 } 3923 3924 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 3925 return out, metadata, &smithy.SerializationError{Err: err} 3926 } 3927 3928 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3929 return out, metadata, &smithy.SerializationError{Err: err} 3930 } 3931 in.Request = request 3932 3933 return next.HandleSerialize(ctx, in) 3934} 3935func awsRestjson1_serializeOpHttpBindingsUpdateDashboardInput(v *UpdateDashboardInput, encoder *httpbinding.Encoder) error { 3936 if v == nil { 3937 return fmt.Errorf("unsupported serialization of nil %T", v) 3938 } 3939 3940 if v.DashboardId == nil || len(*v.DashboardId) == 0 { 3941 return &smithy.SerializationError{Err: fmt.Errorf("input member dashboardId must not be empty")} 3942 } 3943 if v.DashboardId != nil { 3944 if err := encoder.SetURI("dashboardId").String(*v.DashboardId); err != nil { 3945 return err 3946 } 3947 } 3948 3949 return nil 3950} 3951 3952func awsRestjson1_serializeOpDocumentUpdateDashboardInput(v *UpdateDashboardInput, value smithyjson.Value) error { 3953 object := value.Object() 3954 defer object.Close() 3955 3956 if v.ClientToken != nil { 3957 ok := object.Key("clientToken") 3958 ok.String(*v.ClientToken) 3959 } 3960 3961 if v.DashboardDefinition != nil { 3962 ok := object.Key("dashboardDefinition") 3963 ok.String(*v.DashboardDefinition) 3964 } 3965 3966 if v.DashboardDescription != nil { 3967 ok := object.Key("dashboardDescription") 3968 ok.String(*v.DashboardDescription) 3969 } 3970 3971 if v.DashboardName != nil { 3972 ok := object.Key("dashboardName") 3973 ok.String(*v.DashboardName) 3974 } 3975 3976 return nil 3977} 3978 3979type awsRestjson1_serializeOpUpdateGateway struct { 3980} 3981 3982func (*awsRestjson1_serializeOpUpdateGateway) ID() string { 3983 return "OperationSerializer" 3984} 3985 3986func (m *awsRestjson1_serializeOpUpdateGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3987 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3988) { 3989 request, ok := in.Request.(*smithyhttp.Request) 3990 if !ok { 3991 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3992 } 3993 3994 input, ok := in.Parameters.(*UpdateGatewayInput) 3995 _ = input 3996 if !ok { 3997 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3998 } 3999 4000 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}") 4001 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 4002 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 4003 request.Method = "PUT" 4004 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4005 if err != nil { 4006 return out, metadata, &smithy.SerializationError{Err: err} 4007 } 4008 4009 if err := awsRestjson1_serializeOpHttpBindingsUpdateGatewayInput(input, restEncoder); err != nil { 4010 return out, metadata, &smithy.SerializationError{Err: err} 4011 } 4012 4013 restEncoder.SetHeader("Content-Type").String("application/json") 4014 4015 jsonEncoder := smithyjson.NewEncoder() 4016 if err := awsRestjson1_serializeOpDocumentUpdateGatewayInput(input, jsonEncoder.Value); err != nil { 4017 return out, metadata, &smithy.SerializationError{Err: err} 4018 } 4019 4020 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 4021 return out, metadata, &smithy.SerializationError{Err: err} 4022 } 4023 4024 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4025 return out, metadata, &smithy.SerializationError{Err: err} 4026 } 4027 in.Request = request 4028 4029 return next.HandleSerialize(ctx, in) 4030} 4031func awsRestjson1_serializeOpHttpBindingsUpdateGatewayInput(v *UpdateGatewayInput, encoder *httpbinding.Encoder) error { 4032 if v == nil { 4033 return fmt.Errorf("unsupported serialization of nil %T", v) 4034 } 4035 4036 if v.GatewayId == nil || len(*v.GatewayId) == 0 { 4037 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")} 4038 } 4039 if v.GatewayId != nil { 4040 if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil { 4041 return err 4042 } 4043 } 4044 4045 return nil 4046} 4047 4048func awsRestjson1_serializeOpDocumentUpdateGatewayInput(v *UpdateGatewayInput, value smithyjson.Value) error { 4049 object := value.Object() 4050 defer object.Close() 4051 4052 if v.GatewayName != nil { 4053 ok := object.Key("gatewayName") 4054 ok.String(*v.GatewayName) 4055 } 4056 4057 return nil 4058} 4059 4060type awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration struct { 4061} 4062 4063func (*awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration) ID() string { 4064 return "OperationSerializer" 4065} 4066 4067func (m *awsRestjson1_serializeOpUpdateGatewayCapabilityConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4068 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4069) { 4070 request, ok := in.Request.(*smithyhttp.Request) 4071 if !ok { 4072 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4073 } 4074 4075 input, ok := in.Parameters.(*UpdateGatewayCapabilityConfigurationInput) 4076 _ = input 4077 if !ok { 4078 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4079 } 4080 4081 opPath, opQuery := httpbinding.SplitURI("/20200301/gateways/{gatewayId}/capability") 4082 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 4083 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 4084 request.Method = "POST" 4085 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4086 if err != nil { 4087 return out, metadata, &smithy.SerializationError{Err: err} 4088 } 4089 4090 if err := awsRestjson1_serializeOpHttpBindingsUpdateGatewayCapabilityConfigurationInput(input, restEncoder); err != nil { 4091 return out, metadata, &smithy.SerializationError{Err: err} 4092 } 4093 4094 restEncoder.SetHeader("Content-Type").String("application/json") 4095 4096 jsonEncoder := smithyjson.NewEncoder() 4097 if err := awsRestjson1_serializeOpDocumentUpdateGatewayCapabilityConfigurationInput(input, jsonEncoder.Value); err != nil { 4098 return out, metadata, &smithy.SerializationError{Err: err} 4099 } 4100 4101 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 4102 return out, metadata, &smithy.SerializationError{Err: err} 4103 } 4104 4105 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4106 return out, metadata, &smithy.SerializationError{Err: err} 4107 } 4108 in.Request = request 4109 4110 return next.HandleSerialize(ctx, in) 4111} 4112func awsRestjson1_serializeOpHttpBindingsUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput, encoder *httpbinding.Encoder) error { 4113 if v == nil { 4114 return fmt.Errorf("unsupported serialization of nil %T", v) 4115 } 4116 4117 if v.GatewayId == nil || len(*v.GatewayId) == 0 { 4118 return &smithy.SerializationError{Err: fmt.Errorf("input member gatewayId must not be empty")} 4119 } 4120 if v.GatewayId != nil { 4121 if err := encoder.SetURI("gatewayId").String(*v.GatewayId); err != nil { 4122 return err 4123 } 4124 } 4125 4126 return nil 4127} 4128 4129func awsRestjson1_serializeOpDocumentUpdateGatewayCapabilityConfigurationInput(v *UpdateGatewayCapabilityConfigurationInput, value smithyjson.Value) error { 4130 object := value.Object() 4131 defer object.Close() 4132 4133 if v.CapabilityConfiguration != nil { 4134 ok := object.Key("capabilityConfiguration") 4135 ok.String(*v.CapabilityConfiguration) 4136 } 4137 4138 if v.CapabilityNamespace != nil { 4139 ok := object.Key("capabilityNamespace") 4140 ok.String(*v.CapabilityNamespace) 4141 } 4142 4143 return nil 4144} 4145 4146type awsRestjson1_serializeOpUpdatePortal struct { 4147} 4148 4149func (*awsRestjson1_serializeOpUpdatePortal) ID() string { 4150 return "OperationSerializer" 4151} 4152 4153func (m *awsRestjson1_serializeOpUpdatePortal) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4154 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4155) { 4156 request, ok := in.Request.(*smithyhttp.Request) 4157 if !ok { 4158 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4159 } 4160 4161 input, ok := in.Parameters.(*UpdatePortalInput) 4162 _ = input 4163 if !ok { 4164 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4165 } 4166 4167 opPath, opQuery := httpbinding.SplitURI("/portals/{portalId}") 4168 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 4169 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 4170 request.Method = "PUT" 4171 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4172 if err != nil { 4173 return out, metadata, &smithy.SerializationError{Err: err} 4174 } 4175 4176 if err := awsRestjson1_serializeOpHttpBindingsUpdatePortalInput(input, restEncoder); err != nil { 4177 return out, metadata, &smithy.SerializationError{Err: err} 4178 } 4179 4180 restEncoder.SetHeader("Content-Type").String("application/json") 4181 4182 jsonEncoder := smithyjson.NewEncoder() 4183 if err := awsRestjson1_serializeOpDocumentUpdatePortalInput(input, jsonEncoder.Value); err != nil { 4184 return out, metadata, &smithy.SerializationError{Err: err} 4185 } 4186 4187 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 4188 return out, metadata, &smithy.SerializationError{Err: err} 4189 } 4190 4191 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4192 return out, metadata, &smithy.SerializationError{Err: err} 4193 } 4194 in.Request = request 4195 4196 return next.HandleSerialize(ctx, in) 4197} 4198func awsRestjson1_serializeOpHttpBindingsUpdatePortalInput(v *UpdatePortalInput, encoder *httpbinding.Encoder) error { 4199 if v == nil { 4200 return fmt.Errorf("unsupported serialization of nil %T", v) 4201 } 4202 4203 if v.PortalId == nil || len(*v.PortalId) == 0 { 4204 return &smithy.SerializationError{Err: fmt.Errorf("input member portalId must not be empty")} 4205 } 4206 if v.PortalId != nil { 4207 if err := encoder.SetURI("portalId").String(*v.PortalId); err != nil { 4208 return err 4209 } 4210 } 4211 4212 return nil 4213} 4214 4215func awsRestjson1_serializeOpDocumentUpdatePortalInput(v *UpdatePortalInput, value smithyjson.Value) error { 4216 object := value.Object() 4217 defer object.Close() 4218 4219 if v.ClientToken != nil { 4220 ok := object.Key("clientToken") 4221 ok.String(*v.ClientToken) 4222 } 4223 4224 if v.PortalContactEmail != nil { 4225 ok := object.Key("portalContactEmail") 4226 ok.String(*v.PortalContactEmail) 4227 } 4228 4229 if v.PortalDescription != nil { 4230 ok := object.Key("portalDescription") 4231 ok.String(*v.PortalDescription) 4232 } 4233 4234 if v.PortalLogoImage != nil { 4235 ok := object.Key("portalLogoImage") 4236 if err := awsRestjson1_serializeDocumentImage(v.PortalLogoImage, ok); err != nil { 4237 return err 4238 } 4239 } 4240 4241 if v.PortalName != nil { 4242 ok := object.Key("portalName") 4243 ok.String(*v.PortalName) 4244 } 4245 4246 if v.RoleArn != nil { 4247 ok := object.Key("roleArn") 4248 ok.String(*v.RoleArn) 4249 } 4250 4251 return nil 4252} 4253 4254type awsRestjson1_serializeOpUpdateProject struct { 4255} 4256 4257func (*awsRestjson1_serializeOpUpdateProject) ID() string { 4258 return "OperationSerializer" 4259} 4260 4261func (m *awsRestjson1_serializeOpUpdateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4262 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4263) { 4264 request, ok := in.Request.(*smithyhttp.Request) 4265 if !ok { 4266 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4267 } 4268 4269 input, ok := in.Parameters.(*UpdateProjectInput) 4270 _ = input 4271 if !ok { 4272 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4273 } 4274 4275 opPath, opQuery := httpbinding.SplitURI("/projects/{projectId}") 4276 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 4277 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 4278 request.Method = "PUT" 4279 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4280 if err != nil { 4281 return out, metadata, &smithy.SerializationError{Err: err} 4282 } 4283 4284 if err := awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(input, restEncoder); err != nil { 4285 return out, metadata, &smithy.SerializationError{Err: err} 4286 } 4287 4288 restEncoder.SetHeader("Content-Type").String("application/json") 4289 4290 jsonEncoder := smithyjson.NewEncoder() 4291 if err := awsRestjson1_serializeOpDocumentUpdateProjectInput(input, jsonEncoder.Value); err != nil { 4292 return out, metadata, &smithy.SerializationError{Err: err} 4293 } 4294 4295 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 4296 return out, metadata, &smithy.SerializationError{Err: err} 4297 } 4298 4299 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4300 return out, metadata, &smithy.SerializationError{Err: err} 4301 } 4302 in.Request = request 4303 4304 return next.HandleSerialize(ctx, in) 4305} 4306func awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(v *UpdateProjectInput, encoder *httpbinding.Encoder) error { 4307 if v == nil { 4308 return fmt.Errorf("unsupported serialization of nil %T", v) 4309 } 4310 4311 if v.ProjectId == nil || len(*v.ProjectId) == 0 { 4312 return &smithy.SerializationError{Err: fmt.Errorf("input member projectId must not be empty")} 4313 } 4314 if v.ProjectId != nil { 4315 if err := encoder.SetURI("projectId").String(*v.ProjectId); err != nil { 4316 return err 4317 } 4318 } 4319 4320 return nil 4321} 4322 4323func awsRestjson1_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, value smithyjson.Value) error { 4324 object := value.Object() 4325 defer object.Close() 4326 4327 if v.ClientToken != nil { 4328 ok := object.Key("clientToken") 4329 ok.String(*v.ClientToken) 4330 } 4331 4332 if v.ProjectDescription != nil { 4333 ok := object.Key("projectDescription") 4334 ok.String(*v.ProjectDescription) 4335 } 4336 4337 if v.ProjectName != nil { 4338 ok := object.Key("projectName") 4339 ok.String(*v.ProjectName) 4340 } 4341 4342 return nil 4343} 4344 4345func awsRestjson1_serializeDocumentAssetModelCompositeModel(v *types.AssetModelCompositeModel, value smithyjson.Value) error { 4346 object := value.Object() 4347 defer object.Close() 4348 4349 if v.Description != nil { 4350 ok := object.Key("description") 4351 ok.String(*v.Description) 4352 } 4353 4354 if v.Name != nil { 4355 ok := object.Key("name") 4356 ok.String(*v.Name) 4357 } 4358 4359 if v.Properties != nil { 4360 ok := object.Key("properties") 4361 if err := awsRestjson1_serializeDocumentAssetModelProperties(v.Properties, ok); err != nil { 4362 return err 4363 } 4364 } 4365 4366 if v.Type != nil { 4367 ok := object.Key("type") 4368 ok.String(*v.Type) 4369 } 4370 4371 return nil 4372} 4373 4374func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(v *types.AssetModelCompositeModelDefinition, value smithyjson.Value) error { 4375 object := value.Object() 4376 defer object.Close() 4377 4378 if v.Description != nil { 4379 ok := object.Key("description") 4380 ok.String(*v.Description) 4381 } 4382 4383 if v.Name != nil { 4384 ok := object.Key("name") 4385 ok.String(*v.Name) 4386 } 4387 4388 if v.Properties != nil { 4389 ok := object.Key("properties") 4390 if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v.Properties, ok); err != nil { 4391 return err 4392 } 4393 } 4394 4395 if v.Type != nil { 4396 ok := object.Key("type") 4397 ok.String(*v.Type) 4398 } 4399 4400 return nil 4401} 4402 4403func awsRestjson1_serializeDocumentAssetModelCompositeModelDefinitions(v []types.AssetModelCompositeModelDefinition, value smithyjson.Value) error { 4404 array := value.Array() 4405 defer array.Close() 4406 4407 for i := range v { 4408 av := array.Value() 4409 if err := awsRestjson1_serializeDocumentAssetModelCompositeModelDefinition(&v[i], av); err != nil { 4410 return err 4411 } 4412 } 4413 return nil 4414} 4415 4416func awsRestjson1_serializeDocumentAssetModelCompositeModels(v []types.AssetModelCompositeModel, value smithyjson.Value) error { 4417 array := value.Array() 4418 defer array.Close() 4419 4420 for i := range v { 4421 av := array.Value() 4422 if err := awsRestjson1_serializeDocumentAssetModelCompositeModel(&v[i], av); err != nil { 4423 return err 4424 } 4425 } 4426 return nil 4427} 4428 4429func awsRestjson1_serializeDocumentAssetModelHierarchies(v []types.AssetModelHierarchy, value smithyjson.Value) error { 4430 array := value.Array() 4431 defer array.Close() 4432 4433 for i := range v { 4434 av := array.Value() 4435 if err := awsRestjson1_serializeDocumentAssetModelHierarchy(&v[i], av); err != nil { 4436 return err 4437 } 4438 } 4439 return nil 4440} 4441 4442func awsRestjson1_serializeDocumentAssetModelHierarchy(v *types.AssetModelHierarchy, value smithyjson.Value) error { 4443 object := value.Object() 4444 defer object.Close() 4445 4446 if v.ChildAssetModelId != nil { 4447 ok := object.Key("childAssetModelId") 4448 ok.String(*v.ChildAssetModelId) 4449 } 4450 4451 if v.Id != nil { 4452 ok := object.Key("id") 4453 ok.String(*v.Id) 4454 } 4455 4456 if v.Name != nil { 4457 ok := object.Key("name") 4458 ok.String(*v.Name) 4459 } 4460 4461 return nil 4462} 4463 4464func awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(v *types.AssetModelHierarchyDefinition, value smithyjson.Value) error { 4465 object := value.Object() 4466 defer object.Close() 4467 4468 if v.ChildAssetModelId != nil { 4469 ok := object.Key("childAssetModelId") 4470 ok.String(*v.ChildAssetModelId) 4471 } 4472 4473 if v.Name != nil { 4474 ok := object.Key("name") 4475 ok.String(*v.Name) 4476 } 4477 4478 return nil 4479} 4480 4481func awsRestjson1_serializeDocumentAssetModelHierarchyDefinitions(v []types.AssetModelHierarchyDefinition, value smithyjson.Value) error { 4482 array := value.Array() 4483 defer array.Close() 4484 4485 for i := range v { 4486 av := array.Value() 4487 if err := awsRestjson1_serializeDocumentAssetModelHierarchyDefinition(&v[i], av); err != nil { 4488 return err 4489 } 4490 } 4491 return nil 4492} 4493 4494func awsRestjson1_serializeDocumentAssetModelProperties(v []types.AssetModelProperty, value smithyjson.Value) error { 4495 array := value.Array() 4496 defer array.Close() 4497 4498 for i := range v { 4499 av := array.Value() 4500 if err := awsRestjson1_serializeDocumentAssetModelProperty(&v[i], av); err != nil { 4501 return err 4502 } 4503 } 4504 return nil 4505} 4506 4507func awsRestjson1_serializeDocumentAssetModelProperty(v *types.AssetModelProperty, value smithyjson.Value) error { 4508 object := value.Object() 4509 defer object.Close() 4510 4511 if len(v.DataType) > 0 { 4512 ok := object.Key("dataType") 4513 ok.String(string(v.DataType)) 4514 } 4515 4516 if v.DataTypeSpec != nil { 4517 ok := object.Key("dataTypeSpec") 4518 ok.String(*v.DataTypeSpec) 4519 } 4520 4521 if v.Id != nil { 4522 ok := object.Key("id") 4523 ok.String(*v.Id) 4524 } 4525 4526 if v.Name != nil { 4527 ok := object.Key("name") 4528 ok.String(*v.Name) 4529 } 4530 4531 if v.Type != nil { 4532 ok := object.Key("type") 4533 if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil { 4534 return err 4535 } 4536 } 4537 4538 if v.Unit != nil { 4539 ok := object.Key("unit") 4540 ok.String(*v.Unit) 4541 } 4542 4543 return nil 4544} 4545 4546func awsRestjson1_serializeDocumentAssetModelPropertyDefinition(v *types.AssetModelPropertyDefinition, value smithyjson.Value) error { 4547 object := value.Object() 4548 defer object.Close() 4549 4550 if len(v.DataType) > 0 { 4551 ok := object.Key("dataType") 4552 ok.String(string(v.DataType)) 4553 } 4554 4555 if v.DataTypeSpec != nil { 4556 ok := object.Key("dataTypeSpec") 4557 ok.String(*v.DataTypeSpec) 4558 } 4559 4560 if v.Name != nil { 4561 ok := object.Key("name") 4562 ok.String(*v.Name) 4563 } 4564 4565 if v.Type != nil { 4566 ok := object.Key("type") 4567 if err := awsRestjson1_serializeDocumentPropertyType(v.Type, ok); err != nil { 4568 return err 4569 } 4570 } 4571 4572 if v.Unit != nil { 4573 ok := object.Key("unit") 4574 ok.String(*v.Unit) 4575 } 4576 4577 return nil 4578} 4579 4580func awsRestjson1_serializeDocumentAssetModelPropertyDefinitions(v []types.AssetModelPropertyDefinition, value smithyjson.Value) error { 4581 array := value.Array() 4582 defer array.Close() 4583 4584 for i := range v { 4585 av := array.Value() 4586 if err := awsRestjson1_serializeDocumentAssetModelPropertyDefinition(&v[i], av); err != nil { 4587 return err 4588 } 4589 } 4590 return nil 4591} 4592 4593func awsRestjson1_serializeDocumentAssetPropertyValue(v *types.AssetPropertyValue, value smithyjson.Value) error { 4594 object := value.Object() 4595 defer object.Close() 4596 4597 if len(v.Quality) > 0 { 4598 ok := object.Key("quality") 4599 ok.String(string(v.Quality)) 4600 } 4601 4602 if v.Timestamp != nil { 4603 ok := object.Key("timestamp") 4604 if err := awsRestjson1_serializeDocumentTimeInNanos(v.Timestamp, ok); err != nil { 4605 return err 4606 } 4607 } 4608 4609 if v.Value != nil { 4610 ok := object.Key("value") 4611 if err := awsRestjson1_serializeDocumentVariant(v.Value, ok); err != nil { 4612 return err 4613 } 4614 } 4615 4616 return nil 4617} 4618 4619func awsRestjson1_serializeDocumentAssetPropertyValues(v []types.AssetPropertyValue, value smithyjson.Value) error { 4620 array := value.Array() 4621 defer array.Close() 4622 4623 for i := range v { 4624 av := array.Value() 4625 if err := awsRestjson1_serializeDocumentAssetPropertyValue(&v[i], av); err != nil { 4626 return err 4627 } 4628 } 4629 return nil 4630} 4631 4632func awsRestjson1_serializeDocumentAttribute(v *types.Attribute, value smithyjson.Value) error { 4633 object := value.Object() 4634 defer object.Close() 4635 4636 if v.DefaultValue != nil { 4637 ok := object.Key("defaultValue") 4638 ok.String(*v.DefaultValue) 4639 } 4640 4641 return nil 4642} 4643 4644func awsRestjson1_serializeDocumentExpressionVariable(v *types.ExpressionVariable, value smithyjson.Value) error { 4645 object := value.Object() 4646 defer object.Close() 4647 4648 if v.Name != nil { 4649 ok := object.Key("name") 4650 ok.String(*v.Name) 4651 } 4652 4653 if v.Value != nil { 4654 ok := object.Key("value") 4655 if err := awsRestjson1_serializeDocumentVariableValue(v.Value, ok); err != nil { 4656 return err 4657 } 4658 } 4659 4660 return nil 4661} 4662 4663func awsRestjson1_serializeDocumentExpressionVariables(v []types.ExpressionVariable, value smithyjson.Value) error { 4664 array := value.Array() 4665 defer array.Close() 4666 4667 for i := range v { 4668 av := array.Value() 4669 if err := awsRestjson1_serializeDocumentExpressionVariable(&v[i], av); err != nil { 4670 return err 4671 } 4672 } 4673 return nil 4674} 4675 4676func awsRestjson1_serializeDocumentGatewayPlatform(v *types.GatewayPlatform, value smithyjson.Value) error { 4677 object := value.Object() 4678 defer object.Close() 4679 4680 if v.Greengrass != nil { 4681 ok := object.Key("greengrass") 4682 if err := awsRestjson1_serializeDocumentGreengrass(v.Greengrass, ok); err != nil { 4683 return err 4684 } 4685 } 4686 4687 return nil 4688} 4689 4690func awsRestjson1_serializeDocumentGreengrass(v *types.Greengrass, value smithyjson.Value) error { 4691 object := value.Object() 4692 defer object.Close() 4693 4694 if v.GroupArn != nil { 4695 ok := object.Key("groupArn") 4696 ok.String(*v.GroupArn) 4697 } 4698 4699 return nil 4700} 4701 4702func awsRestjson1_serializeDocumentGroupIdentity(v *types.GroupIdentity, value smithyjson.Value) error { 4703 object := value.Object() 4704 defer object.Close() 4705 4706 if v.Id != nil { 4707 ok := object.Key("id") 4708 ok.String(*v.Id) 4709 } 4710 4711 return nil 4712} 4713 4714func awsRestjson1_serializeDocumentIAMRoleIdentity(v *types.IAMRoleIdentity, value smithyjson.Value) error { 4715 object := value.Object() 4716 defer object.Close() 4717 4718 if v.Arn != nil { 4719 ok := object.Key("arn") 4720 ok.String(*v.Arn) 4721 } 4722 4723 return nil 4724} 4725 4726func awsRestjson1_serializeDocumentIAMUserIdentity(v *types.IAMUserIdentity, value smithyjson.Value) error { 4727 object := value.Object() 4728 defer object.Close() 4729 4730 if v.Arn != nil { 4731 ok := object.Key("arn") 4732 ok.String(*v.Arn) 4733 } 4734 4735 return nil 4736} 4737 4738func awsRestjson1_serializeDocumentIdentity(v *types.Identity, value smithyjson.Value) error { 4739 object := value.Object() 4740 defer object.Close() 4741 4742 if v.Group != nil { 4743 ok := object.Key("group") 4744 if err := awsRestjson1_serializeDocumentGroupIdentity(v.Group, ok); err != nil { 4745 return err 4746 } 4747 } 4748 4749 if v.IamRole != nil { 4750 ok := object.Key("iamRole") 4751 if err := awsRestjson1_serializeDocumentIAMRoleIdentity(v.IamRole, ok); err != nil { 4752 return err 4753 } 4754 } 4755 4756 if v.IamUser != nil { 4757 ok := object.Key("iamUser") 4758 if err := awsRestjson1_serializeDocumentIAMUserIdentity(v.IamUser, ok); err != nil { 4759 return err 4760 } 4761 } 4762 4763 if v.User != nil { 4764 ok := object.Key("user") 4765 if err := awsRestjson1_serializeDocumentUserIdentity(v.User, ok); err != nil { 4766 return err 4767 } 4768 } 4769 4770 return nil 4771} 4772 4773func awsRestjson1_serializeDocumentIDs(v []string, value smithyjson.Value) error { 4774 array := value.Array() 4775 defer array.Close() 4776 4777 for i := range v { 4778 av := array.Value() 4779 av.String(v[i]) 4780 } 4781 return nil 4782} 4783 4784func awsRestjson1_serializeDocumentImage(v *types.Image, value smithyjson.Value) error { 4785 object := value.Object() 4786 defer object.Close() 4787 4788 if v.File != nil { 4789 ok := object.Key("file") 4790 if err := awsRestjson1_serializeDocumentImageFile(v.File, ok); err != nil { 4791 return err 4792 } 4793 } 4794 4795 if v.Id != nil { 4796 ok := object.Key("id") 4797 ok.String(*v.Id) 4798 } 4799 4800 return nil 4801} 4802 4803func awsRestjson1_serializeDocumentImageFile(v *types.ImageFile, value smithyjson.Value) error { 4804 object := value.Object() 4805 defer object.Close() 4806 4807 if v.Data != nil { 4808 ok := object.Key("data") 4809 ok.Base64EncodeBytes(v.Data) 4810 } 4811 4812 if len(v.Type) > 0 { 4813 ok := object.Key("type") 4814 ok.String(string(v.Type)) 4815 } 4816 4817 return nil 4818} 4819 4820func awsRestjson1_serializeDocumentLoggingOptions(v *types.LoggingOptions, value smithyjson.Value) error { 4821 object := value.Object() 4822 defer object.Close() 4823 4824 if len(v.Level) > 0 { 4825 ok := object.Key("level") 4826 ok.String(string(v.Level)) 4827 } 4828 4829 return nil 4830} 4831 4832func awsRestjson1_serializeDocumentMeasurement(v *types.Measurement, value smithyjson.Value) error { 4833 object := value.Object() 4834 defer object.Close() 4835 4836 return nil 4837} 4838 4839func awsRestjson1_serializeDocumentMetric(v *types.Metric, value smithyjson.Value) error { 4840 object := value.Object() 4841 defer object.Close() 4842 4843 if v.Expression != nil { 4844 ok := object.Key("expression") 4845 ok.String(*v.Expression) 4846 } 4847 4848 if v.Variables != nil { 4849 ok := object.Key("variables") 4850 if err := awsRestjson1_serializeDocumentExpressionVariables(v.Variables, ok); err != nil { 4851 return err 4852 } 4853 } 4854 4855 if v.Window != nil { 4856 ok := object.Key("window") 4857 if err := awsRestjson1_serializeDocumentMetricWindow(v.Window, ok); err != nil { 4858 return err 4859 } 4860 } 4861 4862 return nil 4863} 4864 4865func awsRestjson1_serializeDocumentMetricWindow(v *types.MetricWindow, value smithyjson.Value) error { 4866 object := value.Object() 4867 defer object.Close() 4868 4869 if v.Tumbling != nil { 4870 ok := object.Key("tumbling") 4871 if err := awsRestjson1_serializeDocumentTumblingWindow(v.Tumbling, ok); err != nil { 4872 return err 4873 } 4874 } 4875 4876 return nil 4877} 4878 4879func awsRestjson1_serializeDocumentPortalResource(v *types.PortalResource, value smithyjson.Value) error { 4880 object := value.Object() 4881 defer object.Close() 4882 4883 if v.Id != nil { 4884 ok := object.Key("id") 4885 ok.String(*v.Id) 4886 } 4887 4888 return nil 4889} 4890 4891func awsRestjson1_serializeDocumentProjectResource(v *types.ProjectResource, value smithyjson.Value) error { 4892 object := value.Object() 4893 defer object.Close() 4894 4895 if v.Id != nil { 4896 ok := object.Key("id") 4897 ok.String(*v.Id) 4898 } 4899 4900 return nil 4901} 4902 4903func awsRestjson1_serializeDocumentPropertyType(v *types.PropertyType, value smithyjson.Value) error { 4904 object := value.Object() 4905 defer object.Close() 4906 4907 if v.Attribute != nil { 4908 ok := object.Key("attribute") 4909 if err := awsRestjson1_serializeDocumentAttribute(v.Attribute, ok); err != nil { 4910 return err 4911 } 4912 } 4913 4914 if v.Measurement != nil { 4915 ok := object.Key("measurement") 4916 if err := awsRestjson1_serializeDocumentMeasurement(v.Measurement, ok); err != nil { 4917 return err 4918 } 4919 } 4920 4921 if v.Metric != nil { 4922 ok := object.Key("metric") 4923 if err := awsRestjson1_serializeDocumentMetric(v.Metric, ok); err != nil { 4924 return err 4925 } 4926 } 4927 4928 if v.Transform != nil { 4929 ok := object.Key("transform") 4930 if err := awsRestjson1_serializeDocumentTransform(v.Transform, ok); err != nil { 4931 return err 4932 } 4933 } 4934 4935 return nil 4936} 4937 4938func awsRestjson1_serializeDocumentPutAssetPropertyValueEntries(v []types.PutAssetPropertyValueEntry, value smithyjson.Value) error { 4939 array := value.Array() 4940 defer array.Close() 4941 4942 for i := range v { 4943 av := array.Value() 4944 if err := awsRestjson1_serializeDocumentPutAssetPropertyValueEntry(&v[i], av); err != nil { 4945 return err 4946 } 4947 } 4948 return nil 4949} 4950 4951func awsRestjson1_serializeDocumentPutAssetPropertyValueEntry(v *types.PutAssetPropertyValueEntry, value smithyjson.Value) error { 4952 object := value.Object() 4953 defer object.Close() 4954 4955 if v.AssetId != nil { 4956 ok := object.Key("assetId") 4957 ok.String(*v.AssetId) 4958 } 4959 4960 if v.EntryId != nil { 4961 ok := object.Key("entryId") 4962 ok.String(*v.EntryId) 4963 } 4964 4965 if v.PropertyAlias != nil { 4966 ok := object.Key("propertyAlias") 4967 ok.String(*v.PropertyAlias) 4968 } 4969 4970 if v.PropertyId != nil { 4971 ok := object.Key("propertyId") 4972 ok.String(*v.PropertyId) 4973 } 4974 4975 if v.PropertyValues != nil { 4976 ok := object.Key("propertyValues") 4977 if err := awsRestjson1_serializeDocumentAssetPropertyValues(v.PropertyValues, ok); err != nil { 4978 return err 4979 } 4980 } 4981 4982 return nil 4983} 4984 4985func awsRestjson1_serializeDocumentResource(v *types.Resource, value smithyjson.Value) error { 4986 object := value.Object() 4987 defer object.Close() 4988 4989 if v.Portal != nil { 4990 ok := object.Key("portal") 4991 if err := awsRestjson1_serializeDocumentPortalResource(v.Portal, ok); err != nil { 4992 return err 4993 } 4994 } 4995 4996 if v.Project != nil { 4997 ok := object.Key("project") 4998 if err := awsRestjson1_serializeDocumentProjectResource(v.Project, ok); err != nil { 4999 return err 5000 } 5001 } 5002 5003 return nil 5004} 5005 5006func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { 5007 object := value.Object() 5008 defer object.Close() 5009 5010 for key := range v { 5011 om := object.Key(key) 5012 om.String(v[key]) 5013 } 5014 return nil 5015} 5016 5017func awsRestjson1_serializeDocumentTimeInNanos(v *types.TimeInNanos, value smithyjson.Value) error { 5018 object := value.Object() 5019 defer object.Close() 5020 5021 if v.OffsetInNanos != nil { 5022 ok := object.Key("offsetInNanos") 5023 ok.Integer(*v.OffsetInNanos) 5024 } 5025 5026 if v.TimeInSeconds != nil { 5027 ok := object.Key("timeInSeconds") 5028 ok.Long(*v.TimeInSeconds) 5029 } 5030 5031 return nil 5032} 5033 5034func awsRestjson1_serializeDocumentTransform(v *types.Transform, value smithyjson.Value) error { 5035 object := value.Object() 5036 defer object.Close() 5037 5038 if v.Expression != nil { 5039 ok := object.Key("expression") 5040 ok.String(*v.Expression) 5041 } 5042 5043 if v.Variables != nil { 5044 ok := object.Key("variables") 5045 if err := awsRestjson1_serializeDocumentExpressionVariables(v.Variables, ok); err != nil { 5046 return err 5047 } 5048 } 5049 5050 return nil 5051} 5052 5053func awsRestjson1_serializeDocumentTumblingWindow(v *types.TumblingWindow, value smithyjson.Value) error { 5054 object := value.Object() 5055 defer object.Close() 5056 5057 if v.Interval != nil { 5058 ok := object.Key("interval") 5059 ok.String(*v.Interval) 5060 } 5061 5062 return nil 5063} 5064 5065func awsRestjson1_serializeDocumentUserIdentity(v *types.UserIdentity, value smithyjson.Value) error { 5066 object := value.Object() 5067 defer object.Close() 5068 5069 if v.Id != nil { 5070 ok := object.Key("id") 5071 ok.String(*v.Id) 5072 } 5073 5074 return nil 5075} 5076 5077func awsRestjson1_serializeDocumentVariableValue(v *types.VariableValue, value smithyjson.Value) error { 5078 object := value.Object() 5079 defer object.Close() 5080 5081 if v.HierarchyId != nil { 5082 ok := object.Key("hierarchyId") 5083 ok.String(*v.HierarchyId) 5084 } 5085 5086 if v.PropertyId != nil { 5087 ok := object.Key("propertyId") 5088 ok.String(*v.PropertyId) 5089 } 5090 5091 return nil 5092} 5093 5094func awsRestjson1_serializeDocumentVariant(v *types.Variant, value smithyjson.Value) error { 5095 object := value.Object() 5096 defer object.Close() 5097 5098 if v.BooleanValue != nil { 5099 ok := object.Key("booleanValue") 5100 ok.Boolean(*v.BooleanValue) 5101 } 5102 5103 if v.DoubleValue != nil { 5104 ok := object.Key("doubleValue") 5105 ok.Double(*v.DoubleValue) 5106 } 5107 5108 if v.IntegerValue != nil { 5109 ok := object.Key("integerValue") 5110 ok.Integer(*v.IntegerValue) 5111 } 5112 5113 if v.StringValue != nil { 5114 ok := object.Key("stringValue") 5115 ok.String(*v.StringValue) 5116 } 5117 5118 return nil 5119} 5120