1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package cognitosync 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/cognitosync/types" 10 smithy "github.com/aws/smithy-go" 11 "github.com/aws/smithy-go/encoding/httpbinding" 12 smithyjson "github.com/aws/smithy-go/encoding/json" 13 "github.com/aws/smithy-go/middleware" 14 smithytime "github.com/aws/smithy-go/time" 15 smithyhttp "github.com/aws/smithy-go/transport/http" 16) 17 18type awsRestjson1_serializeOpBulkPublish struct { 19} 20 21func (*awsRestjson1_serializeOpBulkPublish) ID() string { 22 return "OperationSerializer" 23} 24 25func (m *awsRestjson1_serializeOpBulkPublish) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 26 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 27) { 28 request, ok := in.Request.(*smithyhttp.Request) 29 if !ok { 30 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 31 } 32 33 input, ok := in.Parameters.(*BulkPublishInput) 34 _ = input 35 if !ok { 36 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 37 } 38 39 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/bulkpublish") 40 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 41 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 42 request.Method = "POST" 43 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 44 if err != nil { 45 return out, metadata, &smithy.SerializationError{Err: err} 46 } 47 48 if err := awsRestjson1_serializeOpHttpBindingsBulkPublishInput(input, restEncoder); err != nil { 49 return out, metadata, &smithy.SerializationError{Err: err} 50 } 51 52 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 53 return out, metadata, &smithy.SerializationError{Err: err} 54 } 55 in.Request = request 56 57 return next.HandleSerialize(ctx, in) 58} 59func awsRestjson1_serializeOpHttpBindingsBulkPublishInput(v *BulkPublishInput, encoder *httpbinding.Encoder) error { 60 if v == nil { 61 return fmt.Errorf("unsupported serialization of nil %T", v) 62 } 63 64 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 65 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 66 } 67 if v.IdentityPoolId != nil { 68 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 69 return err 70 } 71 } 72 73 return nil 74} 75 76type awsRestjson1_serializeOpDeleteDataset struct { 77} 78 79func (*awsRestjson1_serializeOpDeleteDataset) ID() string { 80 return "OperationSerializer" 81} 82 83func (m *awsRestjson1_serializeOpDeleteDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 84 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 85) { 86 request, ok := in.Request.(*smithyhttp.Request) 87 if !ok { 88 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 89 } 90 91 input, ok := in.Parameters.(*DeleteDatasetInput) 92 _ = input 93 if !ok { 94 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 95 } 96 97 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}") 98 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 99 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 100 request.Method = "DELETE" 101 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 102 if err != nil { 103 return out, metadata, &smithy.SerializationError{Err: err} 104 } 105 106 if err := awsRestjson1_serializeOpHttpBindingsDeleteDatasetInput(input, restEncoder); err != nil { 107 return out, metadata, &smithy.SerializationError{Err: err} 108 } 109 110 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 111 return out, metadata, &smithy.SerializationError{Err: err} 112 } 113 in.Request = request 114 115 return next.HandleSerialize(ctx, in) 116} 117func awsRestjson1_serializeOpHttpBindingsDeleteDatasetInput(v *DeleteDatasetInput, encoder *httpbinding.Encoder) error { 118 if v == nil { 119 return fmt.Errorf("unsupported serialization of nil %T", v) 120 } 121 122 if v.DatasetName == nil || len(*v.DatasetName) == 0 { 123 return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetName must not be empty")} 124 } 125 if v.DatasetName != nil { 126 if err := encoder.SetURI("DatasetName").String(*v.DatasetName); err != nil { 127 return err 128 } 129 } 130 131 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 132 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 133 } 134 if v.IdentityId != nil { 135 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 136 return err 137 } 138 } 139 140 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 141 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 142 } 143 if v.IdentityPoolId != nil { 144 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 145 return err 146 } 147 } 148 149 return nil 150} 151 152type awsRestjson1_serializeOpDescribeDataset struct { 153} 154 155func (*awsRestjson1_serializeOpDescribeDataset) ID() string { 156 return "OperationSerializer" 157} 158 159func (m *awsRestjson1_serializeOpDescribeDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 160 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 161) { 162 request, ok := in.Request.(*smithyhttp.Request) 163 if !ok { 164 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 165 } 166 167 input, ok := in.Parameters.(*DescribeDatasetInput) 168 _ = input 169 if !ok { 170 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 171 } 172 173 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}") 174 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 175 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 176 request.Method = "GET" 177 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 178 if err != nil { 179 return out, metadata, &smithy.SerializationError{Err: err} 180 } 181 182 if err := awsRestjson1_serializeOpHttpBindingsDescribeDatasetInput(input, restEncoder); err != nil { 183 return out, metadata, &smithy.SerializationError{Err: err} 184 } 185 186 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 187 return out, metadata, &smithy.SerializationError{Err: err} 188 } 189 in.Request = request 190 191 return next.HandleSerialize(ctx, in) 192} 193func awsRestjson1_serializeOpHttpBindingsDescribeDatasetInput(v *DescribeDatasetInput, encoder *httpbinding.Encoder) error { 194 if v == nil { 195 return fmt.Errorf("unsupported serialization of nil %T", v) 196 } 197 198 if v.DatasetName == nil || len(*v.DatasetName) == 0 { 199 return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetName must not be empty")} 200 } 201 if v.DatasetName != nil { 202 if err := encoder.SetURI("DatasetName").String(*v.DatasetName); err != nil { 203 return err 204 } 205 } 206 207 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 208 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 209 } 210 if v.IdentityId != nil { 211 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 212 return err 213 } 214 } 215 216 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 217 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 218 } 219 if v.IdentityPoolId != nil { 220 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 221 return err 222 } 223 } 224 225 return nil 226} 227 228type awsRestjson1_serializeOpDescribeIdentityPoolUsage struct { 229} 230 231func (*awsRestjson1_serializeOpDescribeIdentityPoolUsage) ID() string { 232 return "OperationSerializer" 233} 234 235func (m *awsRestjson1_serializeOpDescribeIdentityPoolUsage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 236 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 237) { 238 request, ok := in.Request.(*smithyhttp.Request) 239 if !ok { 240 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 241 } 242 243 input, ok := in.Parameters.(*DescribeIdentityPoolUsageInput) 244 _ = input 245 if !ok { 246 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 247 } 248 249 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}") 250 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 251 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 252 request.Method = "GET" 253 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 254 if err != nil { 255 return out, metadata, &smithy.SerializationError{Err: err} 256 } 257 258 if err := awsRestjson1_serializeOpHttpBindingsDescribeIdentityPoolUsageInput(input, restEncoder); err != nil { 259 return out, metadata, &smithy.SerializationError{Err: err} 260 } 261 262 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 263 return out, metadata, &smithy.SerializationError{Err: err} 264 } 265 in.Request = request 266 267 return next.HandleSerialize(ctx, in) 268} 269func awsRestjson1_serializeOpHttpBindingsDescribeIdentityPoolUsageInput(v *DescribeIdentityPoolUsageInput, encoder *httpbinding.Encoder) error { 270 if v == nil { 271 return fmt.Errorf("unsupported serialization of nil %T", v) 272 } 273 274 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 275 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 276 } 277 if v.IdentityPoolId != nil { 278 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 279 return err 280 } 281 } 282 283 return nil 284} 285 286type awsRestjson1_serializeOpDescribeIdentityUsage struct { 287} 288 289func (*awsRestjson1_serializeOpDescribeIdentityUsage) ID() string { 290 return "OperationSerializer" 291} 292 293func (m *awsRestjson1_serializeOpDescribeIdentityUsage) 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.(*DescribeIdentityUsageInput) 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("/identitypools/{IdentityPoolId}/identities/{IdentityId}") 308 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 309 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 310 request.Method = "GET" 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 if err := awsRestjson1_serializeOpHttpBindingsDescribeIdentityUsageInput(input, restEncoder); err != nil { 317 return out, metadata, &smithy.SerializationError{Err: err} 318 } 319 320 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 321 return out, metadata, &smithy.SerializationError{Err: err} 322 } 323 in.Request = request 324 325 return next.HandleSerialize(ctx, in) 326} 327func awsRestjson1_serializeOpHttpBindingsDescribeIdentityUsageInput(v *DescribeIdentityUsageInput, encoder *httpbinding.Encoder) error { 328 if v == nil { 329 return fmt.Errorf("unsupported serialization of nil %T", v) 330 } 331 332 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 333 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 334 } 335 if v.IdentityId != nil { 336 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 337 return err 338 } 339 } 340 341 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 342 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 343 } 344 if v.IdentityPoolId != nil { 345 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 346 return err 347 } 348 } 349 350 return nil 351} 352 353type awsRestjson1_serializeOpGetBulkPublishDetails struct { 354} 355 356func (*awsRestjson1_serializeOpGetBulkPublishDetails) ID() string { 357 return "OperationSerializer" 358} 359 360func (m *awsRestjson1_serializeOpGetBulkPublishDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 361 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 362) { 363 request, ok := in.Request.(*smithyhttp.Request) 364 if !ok { 365 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 366 } 367 368 input, ok := in.Parameters.(*GetBulkPublishDetailsInput) 369 _ = input 370 if !ok { 371 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 372 } 373 374 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/getBulkPublishDetails") 375 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 376 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 377 request.Method = "POST" 378 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 379 if err != nil { 380 return out, metadata, &smithy.SerializationError{Err: err} 381 } 382 383 if err := awsRestjson1_serializeOpHttpBindingsGetBulkPublishDetailsInput(input, restEncoder); err != nil { 384 return out, metadata, &smithy.SerializationError{Err: err} 385 } 386 387 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 388 return out, metadata, &smithy.SerializationError{Err: err} 389 } 390 in.Request = request 391 392 return next.HandleSerialize(ctx, in) 393} 394func awsRestjson1_serializeOpHttpBindingsGetBulkPublishDetailsInput(v *GetBulkPublishDetailsInput, encoder *httpbinding.Encoder) error { 395 if v == nil { 396 return fmt.Errorf("unsupported serialization of nil %T", v) 397 } 398 399 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 400 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 401 } 402 if v.IdentityPoolId != nil { 403 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 404 return err 405 } 406 } 407 408 return nil 409} 410 411type awsRestjson1_serializeOpGetCognitoEvents struct { 412} 413 414func (*awsRestjson1_serializeOpGetCognitoEvents) ID() string { 415 return "OperationSerializer" 416} 417 418func (m *awsRestjson1_serializeOpGetCognitoEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 419 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 420) { 421 request, ok := in.Request.(*smithyhttp.Request) 422 if !ok { 423 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 424 } 425 426 input, ok := in.Parameters.(*GetCognitoEventsInput) 427 _ = input 428 if !ok { 429 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 430 } 431 432 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/events") 433 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 434 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 435 request.Method = "GET" 436 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 437 if err != nil { 438 return out, metadata, &smithy.SerializationError{Err: err} 439 } 440 441 if err := awsRestjson1_serializeOpHttpBindingsGetCognitoEventsInput(input, restEncoder); err != nil { 442 return out, metadata, &smithy.SerializationError{Err: err} 443 } 444 445 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 446 return out, metadata, &smithy.SerializationError{Err: err} 447 } 448 in.Request = request 449 450 return next.HandleSerialize(ctx, in) 451} 452func awsRestjson1_serializeOpHttpBindingsGetCognitoEventsInput(v *GetCognitoEventsInput, encoder *httpbinding.Encoder) error { 453 if v == nil { 454 return fmt.Errorf("unsupported serialization of nil %T", v) 455 } 456 457 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 458 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 459 } 460 if v.IdentityPoolId != nil { 461 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 462 return err 463 } 464 } 465 466 return nil 467} 468 469type awsRestjson1_serializeOpGetIdentityPoolConfiguration struct { 470} 471 472func (*awsRestjson1_serializeOpGetIdentityPoolConfiguration) ID() string { 473 return "OperationSerializer" 474} 475 476func (m *awsRestjson1_serializeOpGetIdentityPoolConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 477 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 478) { 479 request, ok := in.Request.(*smithyhttp.Request) 480 if !ok { 481 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 482 } 483 484 input, ok := in.Parameters.(*GetIdentityPoolConfigurationInput) 485 _ = input 486 if !ok { 487 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 488 } 489 490 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/configuration") 491 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 492 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 493 request.Method = "GET" 494 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 495 if err != nil { 496 return out, metadata, &smithy.SerializationError{Err: err} 497 } 498 499 if err := awsRestjson1_serializeOpHttpBindingsGetIdentityPoolConfigurationInput(input, restEncoder); err != nil { 500 return out, metadata, &smithy.SerializationError{Err: err} 501 } 502 503 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 504 return out, metadata, &smithy.SerializationError{Err: err} 505 } 506 in.Request = request 507 508 return next.HandleSerialize(ctx, in) 509} 510func awsRestjson1_serializeOpHttpBindingsGetIdentityPoolConfigurationInput(v *GetIdentityPoolConfigurationInput, encoder *httpbinding.Encoder) error { 511 if v == nil { 512 return fmt.Errorf("unsupported serialization of nil %T", v) 513 } 514 515 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 516 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 517 } 518 if v.IdentityPoolId != nil { 519 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 520 return err 521 } 522 } 523 524 return nil 525} 526 527type awsRestjson1_serializeOpListDatasets struct { 528} 529 530func (*awsRestjson1_serializeOpListDatasets) ID() string { 531 return "OperationSerializer" 532} 533 534func (m *awsRestjson1_serializeOpListDatasets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 535 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 536) { 537 request, ok := in.Request.(*smithyhttp.Request) 538 if !ok { 539 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 540 } 541 542 input, ok := in.Parameters.(*ListDatasetsInput) 543 _ = input 544 if !ok { 545 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 546 } 547 548 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets") 549 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 550 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 551 request.Method = "GET" 552 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 553 if err != nil { 554 return out, metadata, &smithy.SerializationError{Err: err} 555 } 556 557 if err := awsRestjson1_serializeOpHttpBindingsListDatasetsInput(input, restEncoder); err != nil { 558 return out, metadata, &smithy.SerializationError{Err: err} 559 } 560 561 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 562 return out, metadata, &smithy.SerializationError{Err: err} 563 } 564 in.Request = request 565 566 return next.HandleSerialize(ctx, in) 567} 568func awsRestjson1_serializeOpHttpBindingsListDatasetsInput(v *ListDatasetsInput, encoder *httpbinding.Encoder) error { 569 if v == nil { 570 return fmt.Errorf("unsupported serialization of nil %T", v) 571 } 572 573 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 574 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 575 } 576 if v.IdentityId != nil { 577 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 578 return err 579 } 580 } 581 582 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 583 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 584 } 585 if v.IdentityPoolId != nil { 586 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 587 return err 588 } 589 } 590 591 if v.MaxResults != 0 { 592 encoder.SetQuery("maxResults").Integer(v.MaxResults) 593 } 594 595 if v.NextToken != nil { 596 encoder.SetQuery("nextToken").String(*v.NextToken) 597 } 598 599 return nil 600} 601 602type awsRestjson1_serializeOpListIdentityPoolUsage struct { 603} 604 605func (*awsRestjson1_serializeOpListIdentityPoolUsage) ID() string { 606 return "OperationSerializer" 607} 608 609func (m *awsRestjson1_serializeOpListIdentityPoolUsage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 610 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 611) { 612 request, ok := in.Request.(*smithyhttp.Request) 613 if !ok { 614 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 615 } 616 617 input, ok := in.Parameters.(*ListIdentityPoolUsageInput) 618 _ = input 619 if !ok { 620 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 621 } 622 623 opPath, opQuery := httpbinding.SplitURI("/identitypools") 624 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 625 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 626 request.Method = "GET" 627 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 628 if err != nil { 629 return out, metadata, &smithy.SerializationError{Err: err} 630 } 631 632 if err := awsRestjson1_serializeOpHttpBindingsListIdentityPoolUsageInput(input, restEncoder); err != nil { 633 return out, metadata, &smithy.SerializationError{Err: err} 634 } 635 636 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 637 return out, metadata, &smithy.SerializationError{Err: err} 638 } 639 in.Request = request 640 641 return next.HandleSerialize(ctx, in) 642} 643func awsRestjson1_serializeOpHttpBindingsListIdentityPoolUsageInput(v *ListIdentityPoolUsageInput, encoder *httpbinding.Encoder) error { 644 if v == nil { 645 return fmt.Errorf("unsupported serialization of nil %T", v) 646 } 647 648 if v.MaxResults != 0 { 649 encoder.SetQuery("maxResults").Integer(v.MaxResults) 650 } 651 652 if v.NextToken != nil { 653 encoder.SetQuery("nextToken").String(*v.NextToken) 654 } 655 656 return nil 657} 658 659type awsRestjson1_serializeOpListRecords struct { 660} 661 662func (*awsRestjson1_serializeOpListRecords) ID() string { 663 return "OperationSerializer" 664} 665 666func (m *awsRestjson1_serializeOpListRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 667 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 668) { 669 request, ok := in.Request.(*smithyhttp.Request) 670 if !ok { 671 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 672 } 673 674 input, ok := in.Parameters.(*ListRecordsInput) 675 _ = input 676 if !ok { 677 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 678 } 679 680 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/records") 681 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 682 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 683 request.Method = "GET" 684 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 685 if err != nil { 686 return out, metadata, &smithy.SerializationError{Err: err} 687 } 688 689 if err := awsRestjson1_serializeOpHttpBindingsListRecordsInput(input, restEncoder); err != nil { 690 return out, metadata, &smithy.SerializationError{Err: err} 691 } 692 693 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 694 return out, metadata, &smithy.SerializationError{Err: err} 695 } 696 in.Request = request 697 698 return next.HandleSerialize(ctx, in) 699} 700func awsRestjson1_serializeOpHttpBindingsListRecordsInput(v *ListRecordsInput, encoder *httpbinding.Encoder) error { 701 if v == nil { 702 return fmt.Errorf("unsupported serialization of nil %T", v) 703 } 704 705 if v.DatasetName == nil || len(*v.DatasetName) == 0 { 706 return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetName must not be empty")} 707 } 708 if v.DatasetName != nil { 709 if err := encoder.SetURI("DatasetName").String(*v.DatasetName); err != nil { 710 return err 711 } 712 } 713 714 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 715 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 716 } 717 if v.IdentityId != nil { 718 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 719 return err 720 } 721 } 722 723 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 724 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 725 } 726 if v.IdentityPoolId != nil { 727 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 728 return err 729 } 730 } 731 732 if v.LastSyncCount != nil { 733 encoder.SetQuery("lastSyncCount").Long(*v.LastSyncCount) 734 } 735 736 if v.MaxResults != 0 { 737 encoder.SetQuery("maxResults").Integer(v.MaxResults) 738 } 739 740 if v.NextToken != nil { 741 encoder.SetQuery("nextToken").String(*v.NextToken) 742 } 743 744 if v.SyncSessionToken != nil { 745 encoder.SetQuery("syncSessionToken").String(*v.SyncSessionToken) 746 } 747 748 return nil 749} 750 751type awsRestjson1_serializeOpRegisterDevice struct { 752} 753 754func (*awsRestjson1_serializeOpRegisterDevice) ID() string { 755 return "OperationSerializer" 756} 757 758func (m *awsRestjson1_serializeOpRegisterDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 759 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 760) { 761 request, ok := in.Request.(*smithyhttp.Request) 762 if !ok { 763 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 764 } 765 766 input, ok := in.Parameters.(*RegisterDeviceInput) 767 _ = input 768 if !ok { 769 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 770 } 771 772 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identity/{IdentityId}/device") 773 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 774 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 775 request.Method = "POST" 776 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 777 if err != nil { 778 return out, metadata, &smithy.SerializationError{Err: err} 779 } 780 781 if err := awsRestjson1_serializeOpHttpBindingsRegisterDeviceInput(input, restEncoder); err != nil { 782 return out, metadata, &smithy.SerializationError{Err: err} 783 } 784 785 restEncoder.SetHeader("Content-Type").String("application/json") 786 787 jsonEncoder := smithyjson.NewEncoder() 788 if err := awsRestjson1_serializeOpDocumentRegisterDeviceInput(input, jsonEncoder.Value); err != nil { 789 return out, metadata, &smithy.SerializationError{Err: err} 790 } 791 792 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 793 return out, metadata, &smithy.SerializationError{Err: err} 794 } 795 796 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 797 return out, metadata, &smithy.SerializationError{Err: err} 798 } 799 in.Request = request 800 801 return next.HandleSerialize(ctx, in) 802} 803func awsRestjson1_serializeOpHttpBindingsRegisterDeviceInput(v *RegisterDeviceInput, encoder *httpbinding.Encoder) error { 804 if v == nil { 805 return fmt.Errorf("unsupported serialization of nil %T", v) 806 } 807 808 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 809 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 810 } 811 if v.IdentityId != nil { 812 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 813 return err 814 } 815 } 816 817 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 818 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 819 } 820 if v.IdentityPoolId != nil { 821 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 822 return err 823 } 824 } 825 826 return nil 827} 828 829func awsRestjson1_serializeOpDocumentRegisterDeviceInput(v *RegisterDeviceInput, value smithyjson.Value) error { 830 object := value.Object() 831 defer object.Close() 832 833 if len(v.Platform) > 0 { 834 ok := object.Key("Platform") 835 ok.String(string(v.Platform)) 836 } 837 838 if v.Token != nil { 839 ok := object.Key("Token") 840 ok.String(*v.Token) 841 } 842 843 return nil 844} 845 846type awsRestjson1_serializeOpSetCognitoEvents struct { 847} 848 849func (*awsRestjson1_serializeOpSetCognitoEvents) ID() string { 850 return "OperationSerializer" 851} 852 853func (m *awsRestjson1_serializeOpSetCognitoEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 854 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 855) { 856 request, ok := in.Request.(*smithyhttp.Request) 857 if !ok { 858 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 859 } 860 861 input, ok := in.Parameters.(*SetCognitoEventsInput) 862 _ = input 863 if !ok { 864 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 865 } 866 867 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/events") 868 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 869 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 870 request.Method = "POST" 871 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 872 if err != nil { 873 return out, metadata, &smithy.SerializationError{Err: err} 874 } 875 876 if err := awsRestjson1_serializeOpHttpBindingsSetCognitoEventsInput(input, restEncoder); err != nil { 877 return out, metadata, &smithy.SerializationError{Err: err} 878 } 879 880 restEncoder.SetHeader("Content-Type").String("application/json") 881 882 jsonEncoder := smithyjson.NewEncoder() 883 if err := awsRestjson1_serializeOpDocumentSetCognitoEventsInput(input, jsonEncoder.Value); err != nil { 884 return out, metadata, &smithy.SerializationError{Err: err} 885 } 886 887 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 888 return out, metadata, &smithy.SerializationError{Err: err} 889 } 890 891 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 892 return out, metadata, &smithy.SerializationError{Err: err} 893 } 894 in.Request = request 895 896 return next.HandleSerialize(ctx, in) 897} 898func awsRestjson1_serializeOpHttpBindingsSetCognitoEventsInput(v *SetCognitoEventsInput, encoder *httpbinding.Encoder) error { 899 if v == nil { 900 return fmt.Errorf("unsupported serialization of nil %T", v) 901 } 902 903 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 904 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 905 } 906 if v.IdentityPoolId != nil { 907 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 908 return err 909 } 910 } 911 912 return nil 913} 914 915func awsRestjson1_serializeOpDocumentSetCognitoEventsInput(v *SetCognitoEventsInput, value smithyjson.Value) error { 916 object := value.Object() 917 defer object.Close() 918 919 if v.Events != nil { 920 ok := object.Key("Events") 921 if err := awsRestjson1_serializeDocumentEvents(v.Events, ok); err != nil { 922 return err 923 } 924 } 925 926 return nil 927} 928 929type awsRestjson1_serializeOpSetIdentityPoolConfiguration struct { 930} 931 932func (*awsRestjson1_serializeOpSetIdentityPoolConfiguration) ID() string { 933 return "OperationSerializer" 934} 935 936func (m *awsRestjson1_serializeOpSetIdentityPoolConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 937 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 938) { 939 request, ok := in.Request.(*smithyhttp.Request) 940 if !ok { 941 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 942 } 943 944 input, ok := in.Parameters.(*SetIdentityPoolConfigurationInput) 945 _ = input 946 if !ok { 947 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 948 } 949 950 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/configuration") 951 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 952 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 953 request.Method = "POST" 954 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 955 if err != nil { 956 return out, metadata, &smithy.SerializationError{Err: err} 957 } 958 959 if err := awsRestjson1_serializeOpHttpBindingsSetIdentityPoolConfigurationInput(input, restEncoder); err != nil { 960 return out, metadata, &smithy.SerializationError{Err: err} 961 } 962 963 restEncoder.SetHeader("Content-Type").String("application/json") 964 965 jsonEncoder := smithyjson.NewEncoder() 966 if err := awsRestjson1_serializeOpDocumentSetIdentityPoolConfigurationInput(input, jsonEncoder.Value); err != nil { 967 return out, metadata, &smithy.SerializationError{Err: err} 968 } 969 970 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 971 return out, metadata, &smithy.SerializationError{Err: err} 972 } 973 974 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 975 return out, metadata, &smithy.SerializationError{Err: err} 976 } 977 in.Request = request 978 979 return next.HandleSerialize(ctx, in) 980} 981func awsRestjson1_serializeOpHttpBindingsSetIdentityPoolConfigurationInput(v *SetIdentityPoolConfigurationInput, encoder *httpbinding.Encoder) error { 982 if v == nil { 983 return fmt.Errorf("unsupported serialization of nil %T", v) 984 } 985 986 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 987 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 988 } 989 if v.IdentityPoolId != nil { 990 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 991 return err 992 } 993 } 994 995 return nil 996} 997 998func awsRestjson1_serializeOpDocumentSetIdentityPoolConfigurationInput(v *SetIdentityPoolConfigurationInput, value smithyjson.Value) error { 999 object := value.Object() 1000 defer object.Close() 1001 1002 if v.CognitoStreams != nil { 1003 ok := object.Key("CognitoStreams") 1004 if err := awsRestjson1_serializeDocumentCognitoStreams(v.CognitoStreams, ok); err != nil { 1005 return err 1006 } 1007 } 1008 1009 if v.PushSync != nil { 1010 ok := object.Key("PushSync") 1011 if err := awsRestjson1_serializeDocumentPushSync(v.PushSync, ok); err != nil { 1012 return err 1013 } 1014 } 1015 1016 return nil 1017} 1018 1019type awsRestjson1_serializeOpSubscribeToDataset struct { 1020} 1021 1022func (*awsRestjson1_serializeOpSubscribeToDataset) ID() string { 1023 return "OperationSerializer" 1024} 1025 1026func (m *awsRestjson1_serializeOpSubscribeToDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1027 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1028) { 1029 request, ok := in.Request.(*smithyhttp.Request) 1030 if !ok { 1031 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1032 } 1033 1034 input, ok := in.Parameters.(*SubscribeToDatasetInput) 1035 _ = input 1036 if !ok { 1037 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1038 } 1039 1040 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}") 1041 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1042 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1043 request.Method = "POST" 1044 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1045 if err != nil { 1046 return out, metadata, &smithy.SerializationError{Err: err} 1047 } 1048 1049 if err := awsRestjson1_serializeOpHttpBindingsSubscribeToDatasetInput(input, restEncoder); err != nil { 1050 return out, metadata, &smithy.SerializationError{Err: err} 1051 } 1052 1053 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1054 return out, metadata, &smithy.SerializationError{Err: err} 1055 } 1056 in.Request = request 1057 1058 return next.HandleSerialize(ctx, in) 1059} 1060func awsRestjson1_serializeOpHttpBindingsSubscribeToDatasetInput(v *SubscribeToDatasetInput, encoder *httpbinding.Encoder) error { 1061 if v == nil { 1062 return fmt.Errorf("unsupported serialization of nil %T", v) 1063 } 1064 1065 if v.DatasetName == nil || len(*v.DatasetName) == 0 { 1066 return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetName must not be empty")} 1067 } 1068 if v.DatasetName != nil { 1069 if err := encoder.SetURI("DatasetName").String(*v.DatasetName); err != nil { 1070 return err 1071 } 1072 } 1073 1074 if v.DeviceId == nil || len(*v.DeviceId) == 0 { 1075 return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} 1076 } 1077 if v.DeviceId != nil { 1078 if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { 1079 return err 1080 } 1081 } 1082 1083 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 1084 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 1085 } 1086 if v.IdentityId != nil { 1087 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 1088 return err 1089 } 1090 } 1091 1092 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 1093 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 1094 } 1095 if v.IdentityPoolId != nil { 1096 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 1097 return err 1098 } 1099 } 1100 1101 return nil 1102} 1103 1104type awsRestjson1_serializeOpUnsubscribeFromDataset struct { 1105} 1106 1107func (*awsRestjson1_serializeOpUnsubscribeFromDataset) ID() string { 1108 return "OperationSerializer" 1109} 1110 1111func (m *awsRestjson1_serializeOpUnsubscribeFromDataset) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1112 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1113) { 1114 request, ok := in.Request.(*smithyhttp.Request) 1115 if !ok { 1116 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1117 } 1118 1119 input, ok := in.Parameters.(*UnsubscribeFromDatasetInput) 1120 _ = input 1121 if !ok { 1122 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1123 } 1124 1125 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}") 1126 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1127 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1128 request.Method = "DELETE" 1129 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1130 if err != nil { 1131 return out, metadata, &smithy.SerializationError{Err: err} 1132 } 1133 1134 if err := awsRestjson1_serializeOpHttpBindingsUnsubscribeFromDatasetInput(input, restEncoder); err != nil { 1135 return out, metadata, &smithy.SerializationError{Err: err} 1136 } 1137 1138 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1139 return out, metadata, &smithy.SerializationError{Err: err} 1140 } 1141 in.Request = request 1142 1143 return next.HandleSerialize(ctx, in) 1144} 1145func awsRestjson1_serializeOpHttpBindingsUnsubscribeFromDatasetInput(v *UnsubscribeFromDatasetInput, encoder *httpbinding.Encoder) error { 1146 if v == nil { 1147 return fmt.Errorf("unsupported serialization of nil %T", v) 1148 } 1149 1150 if v.DatasetName == nil || len(*v.DatasetName) == 0 { 1151 return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetName must not be empty")} 1152 } 1153 if v.DatasetName != nil { 1154 if err := encoder.SetURI("DatasetName").String(*v.DatasetName); err != nil { 1155 return err 1156 } 1157 } 1158 1159 if v.DeviceId == nil || len(*v.DeviceId) == 0 { 1160 return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} 1161 } 1162 if v.DeviceId != nil { 1163 if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { 1164 return err 1165 } 1166 } 1167 1168 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 1169 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 1170 } 1171 if v.IdentityId != nil { 1172 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 1173 return err 1174 } 1175 } 1176 1177 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 1178 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 1179 } 1180 if v.IdentityPoolId != nil { 1181 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 1182 return err 1183 } 1184 } 1185 1186 return nil 1187} 1188 1189type awsRestjson1_serializeOpUpdateRecords struct { 1190} 1191 1192func (*awsRestjson1_serializeOpUpdateRecords) ID() string { 1193 return "OperationSerializer" 1194} 1195 1196func (m *awsRestjson1_serializeOpUpdateRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1197 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1198) { 1199 request, ok := in.Request.(*smithyhttp.Request) 1200 if !ok { 1201 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1202 } 1203 1204 input, ok := in.Parameters.(*UpdateRecordsInput) 1205 _ = input 1206 if !ok { 1207 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1208 } 1209 1210 opPath, opQuery := httpbinding.SplitURI("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}") 1211 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1212 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1213 request.Method = "POST" 1214 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1215 if err != nil { 1216 return out, metadata, &smithy.SerializationError{Err: err} 1217 } 1218 1219 if err := awsRestjson1_serializeOpHttpBindingsUpdateRecordsInput(input, restEncoder); err != nil { 1220 return out, metadata, &smithy.SerializationError{Err: err} 1221 } 1222 1223 restEncoder.SetHeader("Content-Type").String("application/json") 1224 1225 jsonEncoder := smithyjson.NewEncoder() 1226 if err := awsRestjson1_serializeOpDocumentUpdateRecordsInput(input, jsonEncoder.Value); err != nil { 1227 return out, metadata, &smithy.SerializationError{Err: err} 1228 } 1229 1230 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1231 return out, metadata, &smithy.SerializationError{Err: err} 1232 } 1233 1234 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1235 return out, metadata, &smithy.SerializationError{Err: err} 1236 } 1237 in.Request = request 1238 1239 return next.HandleSerialize(ctx, in) 1240} 1241func awsRestjson1_serializeOpHttpBindingsUpdateRecordsInput(v *UpdateRecordsInput, encoder *httpbinding.Encoder) error { 1242 if v == nil { 1243 return fmt.Errorf("unsupported serialization of nil %T", v) 1244 } 1245 1246 if v.ClientContext != nil && len(*v.ClientContext) > 0 { 1247 locationName := "X-Amz-Client-Context" 1248 encoder.SetHeader(locationName).String(*v.ClientContext) 1249 } 1250 1251 if v.DatasetName == nil || len(*v.DatasetName) == 0 { 1252 return &smithy.SerializationError{Err: fmt.Errorf("input member DatasetName must not be empty")} 1253 } 1254 if v.DatasetName != nil { 1255 if err := encoder.SetURI("DatasetName").String(*v.DatasetName); err != nil { 1256 return err 1257 } 1258 } 1259 1260 if v.IdentityId == nil || len(*v.IdentityId) == 0 { 1261 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityId must not be empty")} 1262 } 1263 if v.IdentityId != nil { 1264 if err := encoder.SetURI("IdentityId").String(*v.IdentityId); err != nil { 1265 return err 1266 } 1267 } 1268 1269 if v.IdentityPoolId == nil || len(*v.IdentityPoolId) == 0 { 1270 return &smithy.SerializationError{Err: fmt.Errorf("input member IdentityPoolId must not be empty")} 1271 } 1272 if v.IdentityPoolId != nil { 1273 if err := encoder.SetURI("IdentityPoolId").String(*v.IdentityPoolId); err != nil { 1274 return err 1275 } 1276 } 1277 1278 return nil 1279} 1280 1281func awsRestjson1_serializeOpDocumentUpdateRecordsInput(v *UpdateRecordsInput, value smithyjson.Value) error { 1282 object := value.Object() 1283 defer object.Close() 1284 1285 if v.DeviceId != nil { 1286 ok := object.Key("DeviceId") 1287 ok.String(*v.DeviceId) 1288 } 1289 1290 if v.RecordPatches != nil { 1291 ok := object.Key("RecordPatches") 1292 if err := awsRestjson1_serializeDocumentRecordPatchList(v.RecordPatches, ok); err != nil { 1293 return err 1294 } 1295 } 1296 1297 if v.SyncSessionToken != nil { 1298 ok := object.Key("SyncSessionToken") 1299 ok.String(*v.SyncSessionToken) 1300 } 1301 1302 return nil 1303} 1304 1305func awsRestjson1_serializeDocumentApplicationArnList(v []string, value smithyjson.Value) error { 1306 array := value.Array() 1307 defer array.Close() 1308 1309 for i := range v { 1310 av := array.Value() 1311 av.String(v[i]) 1312 } 1313 return nil 1314} 1315 1316func awsRestjson1_serializeDocumentCognitoStreams(v *types.CognitoStreams, value smithyjson.Value) error { 1317 object := value.Object() 1318 defer object.Close() 1319 1320 if v.RoleArn != nil { 1321 ok := object.Key("RoleArn") 1322 ok.String(*v.RoleArn) 1323 } 1324 1325 if len(v.StreamingStatus) > 0 { 1326 ok := object.Key("StreamingStatus") 1327 ok.String(string(v.StreamingStatus)) 1328 } 1329 1330 if v.StreamName != nil { 1331 ok := object.Key("StreamName") 1332 ok.String(*v.StreamName) 1333 } 1334 1335 return nil 1336} 1337 1338func awsRestjson1_serializeDocumentEvents(v map[string]string, value smithyjson.Value) error { 1339 object := value.Object() 1340 defer object.Close() 1341 1342 for key := range v { 1343 om := object.Key(key) 1344 om.String(v[key]) 1345 } 1346 return nil 1347} 1348 1349func awsRestjson1_serializeDocumentPushSync(v *types.PushSync, value smithyjson.Value) error { 1350 object := value.Object() 1351 defer object.Close() 1352 1353 if v.ApplicationArns != nil { 1354 ok := object.Key("ApplicationArns") 1355 if err := awsRestjson1_serializeDocumentApplicationArnList(v.ApplicationArns, ok); err != nil { 1356 return err 1357 } 1358 } 1359 1360 if v.RoleArn != nil { 1361 ok := object.Key("RoleArn") 1362 ok.String(*v.RoleArn) 1363 } 1364 1365 return nil 1366} 1367 1368func awsRestjson1_serializeDocumentRecordPatch(v *types.RecordPatch, value smithyjson.Value) error { 1369 object := value.Object() 1370 defer object.Close() 1371 1372 if v.DeviceLastModifiedDate != nil { 1373 ok := object.Key("DeviceLastModifiedDate") 1374 ok.Double(smithytime.FormatEpochSeconds(*v.DeviceLastModifiedDate)) 1375 } 1376 1377 if v.Key != nil { 1378 ok := object.Key("Key") 1379 ok.String(*v.Key) 1380 } 1381 1382 if len(v.Op) > 0 { 1383 ok := object.Key("Op") 1384 ok.String(string(v.Op)) 1385 } 1386 1387 if v.SyncCount != nil { 1388 ok := object.Key("SyncCount") 1389 ok.Long(*v.SyncCount) 1390 } 1391 1392 if v.Value != nil { 1393 ok := object.Key("Value") 1394 ok.String(*v.Value) 1395 } 1396 1397 return nil 1398} 1399 1400func awsRestjson1_serializeDocumentRecordPatchList(v []types.RecordPatch, value smithyjson.Value) error { 1401 array := value.Array() 1402 defer array.Close() 1403 1404 for i := range v { 1405 av := array.Value() 1406 if err := awsRestjson1_serializeDocumentRecordPatch(&v[i], av); err != nil { 1407 return err 1408 } 1409 } 1410 return nil 1411} 1412