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