1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package signer 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/signer/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_serializeOpAddProfilePermission struct { 19} 20 21func (*awsRestjson1_serializeOpAddProfilePermission) ID() string { 22 return "OperationSerializer" 23} 24 25func (m *awsRestjson1_serializeOpAddProfilePermission) 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.(*AddProfilePermissionInput) 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("/signing-profiles/{profileName}/permissions") 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_serializeOpHttpBindingsAddProfilePermissionInput(input, restEncoder); err != nil { 49 return out, metadata, &smithy.SerializationError{Err: err} 50 } 51 52 restEncoder.SetHeader("Content-Type").String("application/json") 53 54 jsonEncoder := smithyjson.NewEncoder() 55 if err := awsRestjson1_serializeOpDocumentAddProfilePermissionInput(input, jsonEncoder.Value); err != nil { 56 return out, metadata, &smithy.SerializationError{Err: err} 57 } 58 59 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 60 return out, metadata, &smithy.SerializationError{Err: err} 61 } 62 63 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 64 return out, metadata, &smithy.SerializationError{Err: err} 65 } 66 in.Request = request 67 68 return next.HandleSerialize(ctx, in) 69} 70func awsRestjson1_serializeOpHttpBindingsAddProfilePermissionInput(v *AddProfilePermissionInput, encoder *httpbinding.Encoder) error { 71 if v == nil { 72 return fmt.Errorf("unsupported serialization of nil %T", v) 73 } 74 75 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 76 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 77 } 78 if v.ProfileName != nil { 79 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 80 return err 81 } 82 } 83 84 return nil 85} 86 87func awsRestjson1_serializeOpDocumentAddProfilePermissionInput(v *AddProfilePermissionInput, value smithyjson.Value) error { 88 object := value.Object() 89 defer object.Close() 90 91 if v.Action != nil { 92 ok := object.Key("action") 93 ok.String(*v.Action) 94 } 95 96 if v.Principal != nil { 97 ok := object.Key("principal") 98 ok.String(*v.Principal) 99 } 100 101 if v.ProfileVersion != nil { 102 ok := object.Key("profileVersion") 103 ok.String(*v.ProfileVersion) 104 } 105 106 if v.RevisionId != nil { 107 ok := object.Key("revisionId") 108 ok.String(*v.RevisionId) 109 } 110 111 if v.StatementId != nil { 112 ok := object.Key("statementId") 113 ok.String(*v.StatementId) 114 } 115 116 return nil 117} 118 119type awsRestjson1_serializeOpCancelSigningProfile struct { 120} 121 122func (*awsRestjson1_serializeOpCancelSigningProfile) ID() string { 123 return "OperationSerializer" 124} 125 126func (m *awsRestjson1_serializeOpCancelSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 127 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 128) { 129 request, ok := in.Request.(*smithyhttp.Request) 130 if !ok { 131 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 132 } 133 134 input, ok := in.Parameters.(*CancelSigningProfileInput) 135 _ = input 136 if !ok { 137 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 138 } 139 140 opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}") 141 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 142 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 143 request.Method = "DELETE" 144 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 145 if err != nil { 146 return out, metadata, &smithy.SerializationError{Err: err} 147 } 148 149 if err := awsRestjson1_serializeOpHttpBindingsCancelSigningProfileInput(input, restEncoder); err != nil { 150 return out, metadata, &smithy.SerializationError{Err: err} 151 } 152 153 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 154 return out, metadata, &smithy.SerializationError{Err: err} 155 } 156 in.Request = request 157 158 return next.HandleSerialize(ctx, in) 159} 160func awsRestjson1_serializeOpHttpBindingsCancelSigningProfileInput(v *CancelSigningProfileInput, encoder *httpbinding.Encoder) error { 161 if v == nil { 162 return fmt.Errorf("unsupported serialization of nil %T", v) 163 } 164 165 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 166 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 167 } 168 if v.ProfileName != nil { 169 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 170 return err 171 } 172 } 173 174 return nil 175} 176 177type awsRestjson1_serializeOpDescribeSigningJob struct { 178} 179 180func (*awsRestjson1_serializeOpDescribeSigningJob) ID() string { 181 return "OperationSerializer" 182} 183 184func (m *awsRestjson1_serializeOpDescribeSigningJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 185 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 186) { 187 request, ok := in.Request.(*smithyhttp.Request) 188 if !ok { 189 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 190 } 191 192 input, ok := in.Parameters.(*DescribeSigningJobInput) 193 _ = input 194 if !ok { 195 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 196 } 197 198 opPath, opQuery := httpbinding.SplitURI("/signing-jobs/{jobId}") 199 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 200 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 201 request.Method = "GET" 202 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 203 if err != nil { 204 return out, metadata, &smithy.SerializationError{Err: err} 205 } 206 207 if err := awsRestjson1_serializeOpHttpBindingsDescribeSigningJobInput(input, restEncoder); err != nil { 208 return out, metadata, &smithy.SerializationError{Err: err} 209 } 210 211 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 212 return out, metadata, &smithy.SerializationError{Err: err} 213 } 214 in.Request = request 215 216 return next.HandleSerialize(ctx, in) 217} 218func awsRestjson1_serializeOpHttpBindingsDescribeSigningJobInput(v *DescribeSigningJobInput, encoder *httpbinding.Encoder) error { 219 if v == nil { 220 return fmt.Errorf("unsupported serialization of nil %T", v) 221 } 222 223 if v.JobId == nil || len(*v.JobId) == 0 { 224 return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} 225 } 226 if v.JobId != nil { 227 if err := encoder.SetURI("jobId").String(*v.JobId); err != nil { 228 return err 229 } 230 } 231 232 return nil 233} 234 235type awsRestjson1_serializeOpGetSigningPlatform struct { 236} 237 238func (*awsRestjson1_serializeOpGetSigningPlatform) ID() string { 239 return "OperationSerializer" 240} 241 242func (m *awsRestjson1_serializeOpGetSigningPlatform) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 243 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 244) { 245 request, ok := in.Request.(*smithyhttp.Request) 246 if !ok { 247 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 248 } 249 250 input, ok := in.Parameters.(*GetSigningPlatformInput) 251 _ = input 252 if !ok { 253 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 254 } 255 256 opPath, opQuery := httpbinding.SplitURI("/signing-platforms/{platformId}") 257 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 258 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 259 request.Method = "GET" 260 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 261 if err != nil { 262 return out, metadata, &smithy.SerializationError{Err: err} 263 } 264 265 if err := awsRestjson1_serializeOpHttpBindingsGetSigningPlatformInput(input, restEncoder); err != nil { 266 return out, metadata, &smithy.SerializationError{Err: err} 267 } 268 269 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 270 return out, metadata, &smithy.SerializationError{Err: err} 271 } 272 in.Request = request 273 274 return next.HandleSerialize(ctx, in) 275} 276func awsRestjson1_serializeOpHttpBindingsGetSigningPlatformInput(v *GetSigningPlatformInput, encoder *httpbinding.Encoder) error { 277 if v == nil { 278 return fmt.Errorf("unsupported serialization of nil %T", v) 279 } 280 281 if v.PlatformId == nil || len(*v.PlatformId) == 0 { 282 return &smithy.SerializationError{Err: fmt.Errorf("input member platformId must not be empty")} 283 } 284 if v.PlatformId != nil { 285 if err := encoder.SetURI("platformId").String(*v.PlatformId); err != nil { 286 return err 287 } 288 } 289 290 return nil 291} 292 293type awsRestjson1_serializeOpGetSigningProfile struct { 294} 295 296func (*awsRestjson1_serializeOpGetSigningProfile) ID() string { 297 return "OperationSerializer" 298} 299 300func (m *awsRestjson1_serializeOpGetSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 301 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 302) { 303 request, ok := in.Request.(*smithyhttp.Request) 304 if !ok { 305 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 306 } 307 308 input, ok := in.Parameters.(*GetSigningProfileInput) 309 _ = input 310 if !ok { 311 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 312 } 313 314 opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}") 315 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 316 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 317 request.Method = "GET" 318 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 319 if err != nil { 320 return out, metadata, &smithy.SerializationError{Err: err} 321 } 322 323 if err := awsRestjson1_serializeOpHttpBindingsGetSigningProfileInput(input, restEncoder); 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_serializeOpHttpBindingsGetSigningProfileInput(v *GetSigningProfileInput, encoder *httpbinding.Encoder) error { 335 if v == nil { 336 return fmt.Errorf("unsupported serialization of nil %T", v) 337 } 338 339 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 340 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 341 } 342 if v.ProfileName != nil { 343 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 344 return err 345 } 346 } 347 348 if v.ProfileOwner != nil { 349 encoder.SetQuery("profileOwner").String(*v.ProfileOwner) 350 } 351 352 return nil 353} 354 355type awsRestjson1_serializeOpListProfilePermissions struct { 356} 357 358func (*awsRestjson1_serializeOpListProfilePermissions) ID() string { 359 return "OperationSerializer" 360} 361 362func (m *awsRestjson1_serializeOpListProfilePermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 363 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 364) { 365 request, ok := in.Request.(*smithyhttp.Request) 366 if !ok { 367 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 368 } 369 370 input, ok := in.Parameters.(*ListProfilePermissionsInput) 371 _ = input 372 if !ok { 373 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 374 } 375 376 opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/permissions") 377 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 378 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 379 request.Method = "GET" 380 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 381 if err != nil { 382 return out, metadata, &smithy.SerializationError{Err: err} 383 } 384 385 if err := awsRestjson1_serializeOpHttpBindingsListProfilePermissionsInput(input, restEncoder); err != nil { 386 return out, metadata, &smithy.SerializationError{Err: err} 387 } 388 389 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 390 return out, metadata, &smithy.SerializationError{Err: err} 391 } 392 in.Request = request 393 394 return next.HandleSerialize(ctx, in) 395} 396func awsRestjson1_serializeOpHttpBindingsListProfilePermissionsInput(v *ListProfilePermissionsInput, encoder *httpbinding.Encoder) error { 397 if v == nil { 398 return fmt.Errorf("unsupported serialization of nil %T", v) 399 } 400 401 if v.NextToken != nil { 402 encoder.SetQuery("nextToken").String(*v.NextToken) 403 } 404 405 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 406 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 407 } 408 if v.ProfileName != nil { 409 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 410 return err 411 } 412 } 413 414 return nil 415} 416 417type awsRestjson1_serializeOpListSigningJobs struct { 418} 419 420func (*awsRestjson1_serializeOpListSigningJobs) ID() string { 421 return "OperationSerializer" 422} 423 424func (m *awsRestjson1_serializeOpListSigningJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 425 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 426) { 427 request, ok := in.Request.(*smithyhttp.Request) 428 if !ok { 429 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 430 } 431 432 input, ok := in.Parameters.(*ListSigningJobsInput) 433 _ = input 434 if !ok { 435 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 436 } 437 438 opPath, opQuery := httpbinding.SplitURI("/signing-jobs") 439 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 440 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 441 request.Method = "GET" 442 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 443 if err != nil { 444 return out, metadata, &smithy.SerializationError{Err: err} 445 } 446 447 if err := awsRestjson1_serializeOpHttpBindingsListSigningJobsInput(input, restEncoder); err != nil { 448 return out, metadata, &smithy.SerializationError{Err: err} 449 } 450 451 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 452 return out, metadata, &smithy.SerializationError{Err: err} 453 } 454 in.Request = request 455 456 return next.HandleSerialize(ctx, in) 457} 458func awsRestjson1_serializeOpHttpBindingsListSigningJobsInput(v *ListSigningJobsInput, encoder *httpbinding.Encoder) error { 459 if v == nil { 460 return fmt.Errorf("unsupported serialization of nil %T", v) 461 } 462 463 if v.IsRevoked { 464 encoder.SetQuery("isRevoked").Boolean(v.IsRevoked) 465 } 466 467 if v.JobInvoker != nil { 468 encoder.SetQuery("jobInvoker").String(*v.JobInvoker) 469 } 470 471 if v.MaxResults != nil { 472 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 473 } 474 475 if v.NextToken != nil { 476 encoder.SetQuery("nextToken").String(*v.NextToken) 477 } 478 479 if v.PlatformId != nil { 480 encoder.SetQuery("platformId").String(*v.PlatformId) 481 } 482 483 if v.RequestedBy != nil { 484 encoder.SetQuery("requestedBy").String(*v.RequestedBy) 485 } 486 487 if v.SignatureExpiresAfter != nil { 488 encoder.SetQuery("signatureExpiresAfter").String(smithytime.FormatDateTime(*v.SignatureExpiresAfter)) 489 } 490 491 if v.SignatureExpiresBefore != nil { 492 encoder.SetQuery("signatureExpiresBefore").String(smithytime.FormatDateTime(*v.SignatureExpiresBefore)) 493 } 494 495 if len(v.Status) > 0 { 496 encoder.SetQuery("status").String(string(v.Status)) 497 } 498 499 return nil 500} 501 502type awsRestjson1_serializeOpListSigningPlatforms struct { 503} 504 505func (*awsRestjson1_serializeOpListSigningPlatforms) ID() string { 506 return "OperationSerializer" 507} 508 509func (m *awsRestjson1_serializeOpListSigningPlatforms) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 510 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 511) { 512 request, ok := in.Request.(*smithyhttp.Request) 513 if !ok { 514 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 515 } 516 517 input, ok := in.Parameters.(*ListSigningPlatformsInput) 518 _ = input 519 if !ok { 520 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 521 } 522 523 opPath, opQuery := httpbinding.SplitURI("/signing-platforms") 524 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 525 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 526 request.Method = "GET" 527 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 528 if err != nil { 529 return out, metadata, &smithy.SerializationError{Err: err} 530 } 531 532 if err := awsRestjson1_serializeOpHttpBindingsListSigningPlatformsInput(input, restEncoder); err != nil { 533 return out, metadata, &smithy.SerializationError{Err: err} 534 } 535 536 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 537 return out, metadata, &smithy.SerializationError{Err: err} 538 } 539 in.Request = request 540 541 return next.HandleSerialize(ctx, in) 542} 543func awsRestjson1_serializeOpHttpBindingsListSigningPlatformsInput(v *ListSigningPlatformsInput, encoder *httpbinding.Encoder) error { 544 if v == nil { 545 return fmt.Errorf("unsupported serialization of nil %T", v) 546 } 547 548 if v.Category != nil { 549 encoder.SetQuery("category").String(*v.Category) 550 } 551 552 if v.MaxResults != nil { 553 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 554 } 555 556 if v.NextToken != nil { 557 encoder.SetQuery("nextToken").String(*v.NextToken) 558 } 559 560 if v.Partner != nil { 561 encoder.SetQuery("partner").String(*v.Partner) 562 } 563 564 if v.Target != nil { 565 encoder.SetQuery("target").String(*v.Target) 566 } 567 568 return nil 569} 570 571type awsRestjson1_serializeOpListSigningProfiles struct { 572} 573 574func (*awsRestjson1_serializeOpListSigningProfiles) ID() string { 575 return "OperationSerializer" 576} 577 578func (m *awsRestjson1_serializeOpListSigningProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 579 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 580) { 581 request, ok := in.Request.(*smithyhttp.Request) 582 if !ok { 583 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 584 } 585 586 input, ok := in.Parameters.(*ListSigningProfilesInput) 587 _ = input 588 if !ok { 589 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 590 } 591 592 opPath, opQuery := httpbinding.SplitURI("/signing-profiles") 593 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 594 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 595 request.Method = "GET" 596 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 597 if err != nil { 598 return out, metadata, &smithy.SerializationError{Err: err} 599 } 600 601 if err := awsRestjson1_serializeOpHttpBindingsListSigningProfilesInput(input, restEncoder); err != nil { 602 return out, metadata, &smithy.SerializationError{Err: err} 603 } 604 605 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 606 return out, metadata, &smithy.SerializationError{Err: err} 607 } 608 in.Request = request 609 610 return next.HandleSerialize(ctx, in) 611} 612func awsRestjson1_serializeOpHttpBindingsListSigningProfilesInput(v *ListSigningProfilesInput, encoder *httpbinding.Encoder) error { 613 if v == nil { 614 return fmt.Errorf("unsupported serialization of nil %T", v) 615 } 616 617 if v.IncludeCanceled { 618 encoder.SetQuery("includeCanceled").Boolean(v.IncludeCanceled) 619 } 620 621 if v.MaxResults != nil { 622 encoder.SetQuery("maxResults").Integer(*v.MaxResults) 623 } 624 625 if v.NextToken != nil { 626 encoder.SetQuery("nextToken").String(*v.NextToken) 627 } 628 629 if v.PlatformId != nil { 630 encoder.SetQuery("platformId").String(*v.PlatformId) 631 } 632 633 if v.Statuses != nil { 634 for i := range v.Statuses { 635 encoder.AddQuery("statuses").String(string(v.Statuses[i])) 636 } 637 } 638 639 return nil 640} 641 642type awsRestjson1_serializeOpListTagsForResource struct { 643} 644 645func (*awsRestjson1_serializeOpListTagsForResource) ID() string { 646 return "OperationSerializer" 647} 648 649func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 650 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 651) { 652 request, ok := in.Request.(*smithyhttp.Request) 653 if !ok { 654 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 655 } 656 657 input, ok := in.Parameters.(*ListTagsForResourceInput) 658 _ = input 659 if !ok { 660 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 661 } 662 663 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 664 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 665 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 666 request.Method = "GET" 667 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 668 if err != nil { 669 return out, metadata, &smithy.SerializationError{Err: err} 670 } 671 672 if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { 673 return out, metadata, &smithy.SerializationError{Err: err} 674 } 675 676 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 677 return out, metadata, &smithy.SerializationError{Err: err} 678 } 679 in.Request = request 680 681 return next.HandleSerialize(ctx, in) 682} 683func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { 684 if v == nil { 685 return fmt.Errorf("unsupported serialization of nil %T", v) 686 } 687 688 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 689 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 690 } 691 if v.ResourceArn != nil { 692 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 693 return err 694 } 695 } 696 697 return nil 698} 699 700type awsRestjson1_serializeOpPutSigningProfile struct { 701} 702 703func (*awsRestjson1_serializeOpPutSigningProfile) ID() string { 704 return "OperationSerializer" 705} 706 707func (m *awsRestjson1_serializeOpPutSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 708 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 709) { 710 request, ok := in.Request.(*smithyhttp.Request) 711 if !ok { 712 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 713 } 714 715 input, ok := in.Parameters.(*PutSigningProfileInput) 716 _ = input 717 if !ok { 718 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 719 } 720 721 opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}") 722 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 723 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 724 request.Method = "PUT" 725 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 726 if err != nil { 727 return out, metadata, &smithy.SerializationError{Err: err} 728 } 729 730 if err := awsRestjson1_serializeOpHttpBindingsPutSigningProfileInput(input, restEncoder); err != nil { 731 return out, metadata, &smithy.SerializationError{Err: err} 732 } 733 734 restEncoder.SetHeader("Content-Type").String("application/json") 735 736 jsonEncoder := smithyjson.NewEncoder() 737 if err := awsRestjson1_serializeOpDocumentPutSigningProfileInput(input, jsonEncoder.Value); err != nil { 738 return out, metadata, &smithy.SerializationError{Err: err} 739 } 740 741 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 742 return out, metadata, &smithy.SerializationError{Err: err} 743 } 744 745 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 746 return out, metadata, &smithy.SerializationError{Err: err} 747 } 748 in.Request = request 749 750 return next.HandleSerialize(ctx, in) 751} 752func awsRestjson1_serializeOpHttpBindingsPutSigningProfileInput(v *PutSigningProfileInput, encoder *httpbinding.Encoder) error { 753 if v == nil { 754 return fmt.Errorf("unsupported serialization of nil %T", v) 755 } 756 757 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 758 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 759 } 760 if v.ProfileName != nil { 761 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 762 return err 763 } 764 } 765 766 return nil 767} 768 769func awsRestjson1_serializeOpDocumentPutSigningProfileInput(v *PutSigningProfileInput, value smithyjson.Value) error { 770 object := value.Object() 771 defer object.Close() 772 773 if v.Overrides != nil { 774 ok := object.Key("overrides") 775 if err := awsRestjson1_serializeDocumentSigningPlatformOverrides(v.Overrides, ok); err != nil { 776 return err 777 } 778 } 779 780 if v.PlatformId != nil { 781 ok := object.Key("platformId") 782 ok.String(*v.PlatformId) 783 } 784 785 if v.SignatureValidityPeriod != nil { 786 ok := object.Key("signatureValidityPeriod") 787 if err := awsRestjson1_serializeDocumentSignatureValidityPeriod(v.SignatureValidityPeriod, ok); err != nil { 788 return err 789 } 790 } 791 792 if v.SigningMaterial != nil { 793 ok := object.Key("signingMaterial") 794 if err := awsRestjson1_serializeDocumentSigningMaterial(v.SigningMaterial, ok); err != nil { 795 return err 796 } 797 } 798 799 if v.SigningParameters != nil { 800 ok := object.Key("signingParameters") 801 if err := awsRestjson1_serializeDocumentSigningParameters(v.SigningParameters, ok); err != nil { 802 return err 803 } 804 } 805 806 if v.Tags != nil { 807 ok := object.Key("tags") 808 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 809 return err 810 } 811 } 812 813 return nil 814} 815 816type awsRestjson1_serializeOpRemoveProfilePermission struct { 817} 818 819func (*awsRestjson1_serializeOpRemoveProfilePermission) ID() string { 820 return "OperationSerializer" 821} 822 823func (m *awsRestjson1_serializeOpRemoveProfilePermission) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 824 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 825) { 826 request, ok := in.Request.(*smithyhttp.Request) 827 if !ok { 828 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 829 } 830 831 input, ok := in.Parameters.(*RemoveProfilePermissionInput) 832 _ = input 833 if !ok { 834 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 835 } 836 837 opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/permissions/{statementId}") 838 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 839 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 840 request.Method = "DELETE" 841 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 842 if err != nil { 843 return out, metadata, &smithy.SerializationError{Err: err} 844 } 845 846 if err := awsRestjson1_serializeOpHttpBindingsRemoveProfilePermissionInput(input, restEncoder); err != nil { 847 return out, metadata, &smithy.SerializationError{Err: err} 848 } 849 850 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 851 return out, metadata, &smithy.SerializationError{Err: err} 852 } 853 in.Request = request 854 855 return next.HandleSerialize(ctx, in) 856} 857func awsRestjson1_serializeOpHttpBindingsRemoveProfilePermissionInput(v *RemoveProfilePermissionInput, encoder *httpbinding.Encoder) error { 858 if v == nil { 859 return fmt.Errorf("unsupported serialization of nil %T", v) 860 } 861 862 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 863 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 864 } 865 if v.ProfileName != nil { 866 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 867 return err 868 } 869 } 870 871 if v.RevisionId != nil { 872 encoder.SetQuery("revisionId").String(*v.RevisionId) 873 } 874 875 if v.StatementId == nil || len(*v.StatementId) == 0 { 876 return &smithy.SerializationError{Err: fmt.Errorf("input member statementId must not be empty")} 877 } 878 if v.StatementId != nil { 879 if err := encoder.SetURI("statementId").String(*v.StatementId); err != nil { 880 return err 881 } 882 } 883 884 return nil 885} 886 887type awsRestjson1_serializeOpRevokeSignature struct { 888} 889 890func (*awsRestjson1_serializeOpRevokeSignature) ID() string { 891 return "OperationSerializer" 892} 893 894func (m *awsRestjson1_serializeOpRevokeSignature) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 895 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 896) { 897 request, ok := in.Request.(*smithyhttp.Request) 898 if !ok { 899 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 900 } 901 902 input, ok := in.Parameters.(*RevokeSignatureInput) 903 _ = input 904 if !ok { 905 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 906 } 907 908 opPath, opQuery := httpbinding.SplitURI("/signing-jobs/{jobId}/revoke") 909 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 910 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 911 request.Method = "PUT" 912 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 913 if err != nil { 914 return out, metadata, &smithy.SerializationError{Err: err} 915 } 916 917 if err := awsRestjson1_serializeOpHttpBindingsRevokeSignatureInput(input, restEncoder); err != nil { 918 return out, metadata, &smithy.SerializationError{Err: err} 919 } 920 921 restEncoder.SetHeader("Content-Type").String("application/json") 922 923 jsonEncoder := smithyjson.NewEncoder() 924 if err := awsRestjson1_serializeOpDocumentRevokeSignatureInput(input, jsonEncoder.Value); err != nil { 925 return out, metadata, &smithy.SerializationError{Err: err} 926 } 927 928 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 929 return out, metadata, &smithy.SerializationError{Err: err} 930 } 931 932 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 933 return out, metadata, &smithy.SerializationError{Err: err} 934 } 935 in.Request = request 936 937 return next.HandleSerialize(ctx, in) 938} 939func awsRestjson1_serializeOpHttpBindingsRevokeSignatureInput(v *RevokeSignatureInput, encoder *httpbinding.Encoder) error { 940 if v == nil { 941 return fmt.Errorf("unsupported serialization of nil %T", v) 942 } 943 944 if v.JobId == nil || len(*v.JobId) == 0 { 945 return &smithy.SerializationError{Err: fmt.Errorf("input member jobId must not be empty")} 946 } 947 if v.JobId != nil { 948 if err := encoder.SetURI("jobId").String(*v.JobId); err != nil { 949 return err 950 } 951 } 952 953 return nil 954} 955 956func awsRestjson1_serializeOpDocumentRevokeSignatureInput(v *RevokeSignatureInput, value smithyjson.Value) error { 957 object := value.Object() 958 defer object.Close() 959 960 if v.JobOwner != nil { 961 ok := object.Key("jobOwner") 962 ok.String(*v.JobOwner) 963 } 964 965 if v.Reason != nil { 966 ok := object.Key("reason") 967 ok.String(*v.Reason) 968 } 969 970 return nil 971} 972 973type awsRestjson1_serializeOpRevokeSigningProfile struct { 974} 975 976func (*awsRestjson1_serializeOpRevokeSigningProfile) ID() string { 977 return "OperationSerializer" 978} 979 980func (m *awsRestjson1_serializeOpRevokeSigningProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 981 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 982) { 983 request, ok := in.Request.(*smithyhttp.Request) 984 if !ok { 985 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 986 } 987 988 input, ok := in.Parameters.(*RevokeSigningProfileInput) 989 _ = input 990 if !ok { 991 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 992 } 993 994 opPath, opQuery := httpbinding.SplitURI("/signing-profiles/{profileName}/revoke") 995 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 996 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 997 request.Method = "PUT" 998 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 999 if err != nil { 1000 return out, metadata, &smithy.SerializationError{Err: err} 1001 } 1002 1003 if err := awsRestjson1_serializeOpHttpBindingsRevokeSigningProfileInput(input, restEncoder); err != nil { 1004 return out, metadata, &smithy.SerializationError{Err: err} 1005 } 1006 1007 restEncoder.SetHeader("Content-Type").String("application/json") 1008 1009 jsonEncoder := smithyjson.NewEncoder() 1010 if err := awsRestjson1_serializeOpDocumentRevokeSigningProfileInput(input, jsonEncoder.Value); err != nil { 1011 return out, metadata, &smithy.SerializationError{Err: err} 1012 } 1013 1014 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1015 return out, metadata, &smithy.SerializationError{Err: err} 1016 } 1017 1018 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1019 return out, metadata, &smithy.SerializationError{Err: err} 1020 } 1021 in.Request = request 1022 1023 return next.HandleSerialize(ctx, in) 1024} 1025func awsRestjson1_serializeOpHttpBindingsRevokeSigningProfileInput(v *RevokeSigningProfileInput, encoder *httpbinding.Encoder) error { 1026 if v == nil { 1027 return fmt.Errorf("unsupported serialization of nil %T", v) 1028 } 1029 1030 if v.ProfileName == nil || len(*v.ProfileName) == 0 { 1031 return &smithy.SerializationError{Err: fmt.Errorf("input member profileName must not be empty")} 1032 } 1033 if v.ProfileName != nil { 1034 if err := encoder.SetURI("profileName").String(*v.ProfileName); err != nil { 1035 return err 1036 } 1037 } 1038 1039 return nil 1040} 1041 1042func awsRestjson1_serializeOpDocumentRevokeSigningProfileInput(v *RevokeSigningProfileInput, value smithyjson.Value) error { 1043 object := value.Object() 1044 defer object.Close() 1045 1046 if v.EffectiveTime != nil { 1047 ok := object.Key("effectiveTime") 1048 ok.Double(smithytime.FormatEpochSeconds(*v.EffectiveTime)) 1049 } 1050 1051 if v.ProfileVersion != nil { 1052 ok := object.Key("profileVersion") 1053 ok.String(*v.ProfileVersion) 1054 } 1055 1056 if v.Reason != nil { 1057 ok := object.Key("reason") 1058 ok.String(*v.Reason) 1059 } 1060 1061 return nil 1062} 1063 1064type awsRestjson1_serializeOpStartSigningJob struct { 1065} 1066 1067func (*awsRestjson1_serializeOpStartSigningJob) ID() string { 1068 return "OperationSerializer" 1069} 1070 1071func (m *awsRestjson1_serializeOpStartSigningJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1072 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1073) { 1074 request, ok := in.Request.(*smithyhttp.Request) 1075 if !ok { 1076 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1077 } 1078 1079 input, ok := in.Parameters.(*StartSigningJobInput) 1080 _ = input 1081 if !ok { 1082 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1083 } 1084 1085 opPath, opQuery := httpbinding.SplitURI("/signing-jobs") 1086 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1087 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1088 request.Method = "POST" 1089 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1090 if err != nil { 1091 return out, metadata, &smithy.SerializationError{Err: err} 1092 } 1093 1094 restEncoder.SetHeader("Content-Type").String("application/json") 1095 1096 jsonEncoder := smithyjson.NewEncoder() 1097 if err := awsRestjson1_serializeOpDocumentStartSigningJobInput(input, jsonEncoder.Value); err != nil { 1098 return out, metadata, &smithy.SerializationError{Err: err} 1099 } 1100 1101 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1102 return out, metadata, &smithy.SerializationError{Err: err} 1103 } 1104 1105 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1106 return out, metadata, &smithy.SerializationError{Err: err} 1107 } 1108 in.Request = request 1109 1110 return next.HandleSerialize(ctx, in) 1111} 1112func awsRestjson1_serializeOpHttpBindingsStartSigningJobInput(v *StartSigningJobInput, encoder *httpbinding.Encoder) error { 1113 if v == nil { 1114 return fmt.Errorf("unsupported serialization of nil %T", v) 1115 } 1116 1117 return nil 1118} 1119 1120func awsRestjson1_serializeOpDocumentStartSigningJobInput(v *StartSigningJobInput, value smithyjson.Value) error { 1121 object := value.Object() 1122 defer object.Close() 1123 1124 if v.ClientRequestToken != nil { 1125 ok := object.Key("clientRequestToken") 1126 ok.String(*v.ClientRequestToken) 1127 } 1128 1129 if v.Destination != nil { 1130 ok := object.Key("destination") 1131 if err := awsRestjson1_serializeDocumentDestination(v.Destination, ok); err != nil { 1132 return err 1133 } 1134 } 1135 1136 if v.ProfileName != nil { 1137 ok := object.Key("profileName") 1138 ok.String(*v.ProfileName) 1139 } 1140 1141 if v.ProfileOwner != nil { 1142 ok := object.Key("profileOwner") 1143 ok.String(*v.ProfileOwner) 1144 } 1145 1146 if v.Source != nil { 1147 ok := object.Key("source") 1148 if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { 1149 return err 1150 } 1151 } 1152 1153 return nil 1154} 1155 1156type awsRestjson1_serializeOpTagResource struct { 1157} 1158 1159func (*awsRestjson1_serializeOpTagResource) ID() string { 1160 return "OperationSerializer" 1161} 1162 1163func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1164 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1165) { 1166 request, ok := in.Request.(*smithyhttp.Request) 1167 if !ok { 1168 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1169 } 1170 1171 input, ok := in.Parameters.(*TagResourceInput) 1172 _ = input 1173 if !ok { 1174 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1175 } 1176 1177 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 1178 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1179 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1180 request.Method = "POST" 1181 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1182 if err != nil { 1183 return out, metadata, &smithy.SerializationError{Err: err} 1184 } 1185 1186 if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { 1187 return out, metadata, &smithy.SerializationError{Err: err} 1188 } 1189 1190 restEncoder.SetHeader("Content-Type").String("application/json") 1191 1192 jsonEncoder := smithyjson.NewEncoder() 1193 if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { 1194 return out, metadata, &smithy.SerializationError{Err: err} 1195 } 1196 1197 if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { 1198 return out, metadata, &smithy.SerializationError{Err: err} 1199 } 1200 1201 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1202 return out, metadata, &smithy.SerializationError{Err: err} 1203 } 1204 in.Request = request 1205 1206 return next.HandleSerialize(ctx, in) 1207} 1208func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { 1209 if v == nil { 1210 return fmt.Errorf("unsupported serialization of nil %T", v) 1211 } 1212 1213 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 1214 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 1215 } 1216 if v.ResourceArn != nil { 1217 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 1218 return err 1219 } 1220 } 1221 1222 return nil 1223} 1224 1225func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { 1226 object := value.Object() 1227 defer object.Close() 1228 1229 if v.Tags != nil { 1230 ok := object.Key("tags") 1231 if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { 1232 return err 1233 } 1234 } 1235 1236 return nil 1237} 1238 1239type awsRestjson1_serializeOpUntagResource struct { 1240} 1241 1242func (*awsRestjson1_serializeOpUntagResource) ID() string { 1243 return "OperationSerializer" 1244} 1245 1246func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1247 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1248) { 1249 request, ok := in.Request.(*smithyhttp.Request) 1250 if !ok { 1251 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1252 } 1253 1254 input, ok := in.Parameters.(*UntagResourceInput) 1255 _ = input 1256 if !ok { 1257 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1258 } 1259 1260 opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") 1261 request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) 1262 request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) 1263 request.Method = "DELETE" 1264 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1265 if err != nil { 1266 return out, metadata, &smithy.SerializationError{Err: err} 1267 } 1268 1269 if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { 1270 return out, metadata, &smithy.SerializationError{Err: err} 1271 } 1272 1273 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1274 return out, metadata, &smithy.SerializationError{Err: err} 1275 } 1276 in.Request = request 1277 1278 return next.HandleSerialize(ctx, in) 1279} 1280func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { 1281 if v == nil { 1282 return fmt.Errorf("unsupported serialization of nil %T", v) 1283 } 1284 1285 if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { 1286 return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} 1287 } 1288 if v.ResourceArn != nil { 1289 if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { 1290 return err 1291 } 1292 } 1293 1294 if v.TagKeys != nil { 1295 for i := range v.TagKeys { 1296 encoder.AddQuery("tagKeys").String(v.TagKeys[i]) 1297 } 1298 } 1299 1300 return nil 1301} 1302 1303func awsRestjson1_serializeDocumentDestination(v *types.Destination, value smithyjson.Value) error { 1304 object := value.Object() 1305 defer object.Close() 1306 1307 if v.S3 != nil { 1308 ok := object.Key("s3") 1309 if err := awsRestjson1_serializeDocumentS3Destination(v.S3, ok); err != nil { 1310 return err 1311 } 1312 } 1313 1314 return nil 1315} 1316 1317func awsRestjson1_serializeDocumentS3Destination(v *types.S3Destination, value smithyjson.Value) error { 1318 object := value.Object() 1319 defer object.Close() 1320 1321 if v.BucketName != nil { 1322 ok := object.Key("bucketName") 1323 ok.String(*v.BucketName) 1324 } 1325 1326 if v.Prefix != nil { 1327 ok := object.Key("prefix") 1328 ok.String(*v.Prefix) 1329 } 1330 1331 return nil 1332} 1333 1334func awsRestjson1_serializeDocumentS3Source(v *types.S3Source, value smithyjson.Value) error { 1335 object := value.Object() 1336 defer object.Close() 1337 1338 if v.BucketName != nil { 1339 ok := object.Key("bucketName") 1340 ok.String(*v.BucketName) 1341 } 1342 1343 if v.Key != nil { 1344 ok := object.Key("key") 1345 ok.String(*v.Key) 1346 } 1347 1348 if v.Version != nil { 1349 ok := object.Key("version") 1350 ok.String(*v.Version) 1351 } 1352 1353 return nil 1354} 1355 1356func awsRestjson1_serializeDocumentSignatureValidityPeriod(v *types.SignatureValidityPeriod, value smithyjson.Value) error { 1357 object := value.Object() 1358 defer object.Close() 1359 1360 if len(v.Type) > 0 { 1361 ok := object.Key("type") 1362 ok.String(string(v.Type)) 1363 } 1364 1365 if v.Value != 0 { 1366 ok := object.Key("value") 1367 ok.Integer(v.Value) 1368 } 1369 1370 return nil 1371} 1372 1373func awsRestjson1_serializeDocumentSigningConfigurationOverrides(v *types.SigningConfigurationOverrides, value smithyjson.Value) error { 1374 object := value.Object() 1375 defer object.Close() 1376 1377 if len(v.EncryptionAlgorithm) > 0 { 1378 ok := object.Key("encryptionAlgorithm") 1379 ok.String(string(v.EncryptionAlgorithm)) 1380 } 1381 1382 if len(v.HashAlgorithm) > 0 { 1383 ok := object.Key("hashAlgorithm") 1384 ok.String(string(v.HashAlgorithm)) 1385 } 1386 1387 return nil 1388} 1389 1390func awsRestjson1_serializeDocumentSigningMaterial(v *types.SigningMaterial, value smithyjson.Value) error { 1391 object := value.Object() 1392 defer object.Close() 1393 1394 if v.CertificateArn != nil { 1395 ok := object.Key("certificateArn") 1396 ok.String(*v.CertificateArn) 1397 } 1398 1399 return nil 1400} 1401 1402func awsRestjson1_serializeDocumentSigningParameters(v map[string]string, value smithyjson.Value) error { 1403 object := value.Object() 1404 defer object.Close() 1405 1406 for key := range v { 1407 om := object.Key(key) 1408 om.String(v[key]) 1409 } 1410 return nil 1411} 1412 1413func awsRestjson1_serializeDocumentSigningPlatformOverrides(v *types.SigningPlatformOverrides, value smithyjson.Value) error { 1414 object := value.Object() 1415 defer object.Close() 1416 1417 if v.SigningConfiguration != nil { 1418 ok := object.Key("signingConfiguration") 1419 if err := awsRestjson1_serializeDocumentSigningConfigurationOverrides(v.SigningConfiguration, ok); err != nil { 1420 return err 1421 } 1422 } 1423 1424 if len(v.SigningImageFormat) > 0 { 1425 ok := object.Key("signingImageFormat") 1426 ok.String(string(v.SigningImageFormat)) 1427 } 1428 1429 return nil 1430} 1431 1432func awsRestjson1_serializeDocumentSource(v *types.Source, value smithyjson.Value) error { 1433 object := value.Object() 1434 defer object.Close() 1435 1436 if v.S3 != nil { 1437 ok := object.Key("s3") 1438 if err := awsRestjson1_serializeDocumentS3Source(v.S3, ok); err != nil { 1439 return err 1440 } 1441 } 1442 1443 return nil 1444} 1445 1446func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { 1447 object := value.Object() 1448 defer object.Close() 1449 1450 for key := range v { 1451 om := object.Key(key) 1452 om.String(v[key]) 1453 } 1454 return nil 1455} 1456