1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package s3 4 5import ( 6 "bytes" 7 "context" 8 "fmt" 9 "github.com/aws/aws-sdk-go-v2/service/s3/types" 10 smithy "github.com/aws/smithy-go" 11 "github.com/aws/smithy-go/encoding/httpbinding" 12 smithyxml "github.com/aws/smithy-go/encoding/xml" 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 "net/http" 17 "strings" 18) 19 20type awsRestxml_serializeOpAbortMultipartUpload struct { 21} 22 23func (*awsRestxml_serializeOpAbortMultipartUpload) ID() string { 24 return "OperationSerializer" 25} 26 27func (m *awsRestxml_serializeOpAbortMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 28 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 29) { 30 request, ok := in.Request.(*smithyhttp.Request) 31 if !ok { 32 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 33 } 34 35 input, ok := in.Parameters.(*AbortMultipartUploadInput) 36 _ = input 37 if !ok { 38 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 39 } 40 41 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=AbortMultipartUpload") 42 request.URL.Path = opPath 43 if len(request.URL.RawQuery) > 0 { 44 request.URL.RawQuery = "&" + opQuery 45 } else { 46 request.URL.RawQuery = opQuery 47 } 48 49 request.Method = "DELETE" 50 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 51 if err != nil { 52 return out, metadata, &smithy.SerializationError{Err: err} 53 } 54 55 if err := awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(input, restEncoder); err != nil { 56 return out, metadata, &smithy.SerializationError{Err: err} 57 } 58 59 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 60 return out, metadata, &smithy.SerializationError{Err: err} 61 } 62 in.Request = request 63 64 return next.HandleSerialize(ctx, in) 65} 66func awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(v *AbortMultipartUploadInput, encoder *httpbinding.Encoder) error { 67 if v == nil { 68 return fmt.Errorf("unsupported serialization of nil %T", v) 69 } 70 71 if v.Bucket == nil || len(*v.Bucket) == 0 { 72 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 73 } 74 if v.Bucket != nil { 75 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 76 return err 77 } 78 } 79 80 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 81 locationName := "X-Amz-Expected-Bucket-Owner" 82 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 83 } 84 85 if v.Key == nil || len(*v.Key) == 0 { 86 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 87 } 88 if v.Key != nil { 89 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 90 return err 91 } 92 } 93 94 if len(v.RequestPayer) > 0 { 95 locationName := "X-Amz-Request-Payer" 96 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 97 } 98 99 if v.UploadId != nil { 100 encoder.SetQuery("uploadId").String(*v.UploadId) 101 } 102 103 return nil 104} 105 106type awsRestxml_serializeOpCompleteMultipartUpload struct { 107} 108 109func (*awsRestxml_serializeOpCompleteMultipartUpload) ID() string { 110 return "OperationSerializer" 111} 112 113func (m *awsRestxml_serializeOpCompleteMultipartUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 114 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 115) { 116 request, ok := in.Request.(*smithyhttp.Request) 117 if !ok { 118 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 119 } 120 121 input, ok := in.Parameters.(*CompleteMultipartUploadInput) 122 _ = input 123 if !ok { 124 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 125 } 126 127 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}") 128 request.URL.Path = opPath 129 if len(request.URL.RawQuery) > 0 { 130 request.URL.RawQuery = "&" + opQuery 131 } else { 132 request.URL.RawQuery = opQuery 133 } 134 135 request.Method = "POST" 136 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 137 if err != nil { 138 return out, metadata, &smithy.SerializationError{Err: err} 139 } 140 141 if err := awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(input, restEncoder); err != nil { 142 return out, metadata, &smithy.SerializationError{Err: err} 143 } 144 145 if input.MultipartUpload != nil { 146 if !restEncoder.HasHeader("Content-Type") { 147 restEncoder.SetHeader("Content-Type").String("application/xml") 148 } 149 150 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 151 payloadRootAttr := []smithyxml.Attr{} 152 payloadRoot := smithyxml.StartElement{ 153 Name: smithyxml.Name{ 154 Local: "CompleteMultipartUpload", 155 }, 156 Attr: payloadRootAttr, 157 } 158 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 159 if err := awsRestxml_serializeDocumentCompletedMultipartUpload(input.MultipartUpload, xmlEncoder.RootElement(payloadRoot)); err != nil { 160 return out, metadata, &smithy.SerializationError{Err: err} 161 } 162 payload := bytes.NewReader(xmlEncoder.Bytes()) 163 if request, err = request.SetStream(payload); err != nil { 164 return out, metadata, &smithy.SerializationError{Err: err} 165 } 166 } 167 168 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 169 return out, metadata, &smithy.SerializationError{Err: err} 170 } 171 in.Request = request 172 173 return next.HandleSerialize(ctx, in) 174} 175func awsRestxml_serializeOpHttpBindingsCompleteMultipartUploadInput(v *CompleteMultipartUploadInput, encoder *httpbinding.Encoder) error { 176 if v == nil { 177 return fmt.Errorf("unsupported serialization of nil %T", v) 178 } 179 180 if v.Bucket == nil || len(*v.Bucket) == 0 { 181 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 182 } 183 if v.Bucket != nil { 184 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 185 return err 186 } 187 } 188 189 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 190 locationName := "X-Amz-Expected-Bucket-Owner" 191 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 192 } 193 194 if v.Key == nil || len(*v.Key) == 0 { 195 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 196 } 197 if v.Key != nil { 198 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 199 return err 200 } 201 } 202 203 if len(v.RequestPayer) > 0 { 204 locationName := "X-Amz-Request-Payer" 205 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 206 } 207 208 if v.UploadId != nil { 209 encoder.SetQuery("uploadId").String(*v.UploadId) 210 } 211 212 return nil 213} 214 215type awsRestxml_serializeOpCopyObject struct { 216} 217 218func (*awsRestxml_serializeOpCopyObject) ID() string { 219 return "OperationSerializer" 220} 221 222func (m *awsRestxml_serializeOpCopyObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 223 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 224) { 225 request, ok := in.Request.(*smithyhttp.Request) 226 if !ok { 227 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 228 } 229 230 input, ok := in.Parameters.(*CopyObjectInput) 231 _ = input 232 if !ok { 233 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 234 } 235 236 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=CopyObject") 237 request.URL.Path = opPath 238 if len(request.URL.RawQuery) > 0 { 239 request.URL.RawQuery = "&" + opQuery 240 } else { 241 request.URL.RawQuery = opQuery 242 } 243 244 request.Method = "PUT" 245 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 246 if err != nil { 247 return out, metadata, &smithy.SerializationError{Err: err} 248 } 249 250 if err := awsRestxml_serializeOpHttpBindingsCopyObjectInput(input, restEncoder); err != nil { 251 return out, metadata, &smithy.SerializationError{Err: err} 252 } 253 254 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 255 return out, metadata, &smithy.SerializationError{Err: err} 256 } 257 in.Request = request 258 259 return next.HandleSerialize(ctx, in) 260} 261func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encoder *httpbinding.Encoder) error { 262 if v == nil { 263 return fmt.Errorf("unsupported serialization of nil %T", v) 264 } 265 266 if len(v.ACL) > 0 { 267 locationName := "X-Amz-Acl" 268 encoder.SetHeader(locationName).String(string(v.ACL)) 269 } 270 271 if v.Bucket == nil || len(*v.Bucket) == 0 { 272 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 273 } 274 if v.Bucket != nil { 275 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 276 return err 277 } 278 } 279 280 if v.BucketKeyEnabled { 281 locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" 282 encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) 283 } 284 285 if v.CacheControl != nil && len(*v.CacheControl) > 0 { 286 locationName := "Cache-Control" 287 encoder.SetHeader(locationName).String(*v.CacheControl) 288 } 289 290 if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { 291 locationName := "Content-Disposition" 292 encoder.SetHeader(locationName).String(*v.ContentDisposition) 293 } 294 295 if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { 296 locationName := "Content-Encoding" 297 encoder.SetHeader(locationName).String(*v.ContentEncoding) 298 } 299 300 if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { 301 locationName := "Content-Language" 302 encoder.SetHeader(locationName).String(*v.ContentLanguage) 303 } 304 305 if v.ContentType != nil && len(*v.ContentType) > 0 { 306 locationName := "Content-Type" 307 encoder.SetHeader(locationName).String(*v.ContentType) 308 } 309 310 if v.CopySource != nil && len(*v.CopySource) > 0 { 311 locationName := "X-Amz-Copy-Source" 312 encoder.SetHeader(locationName).String(*v.CopySource) 313 } 314 315 if v.CopySourceIfMatch != nil && len(*v.CopySourceIfMatch) > 0 { 316 locationName := "X-Amz-Copy-Source-If-Match" 317 encoder.SetHeader(locationName).String(*v.CopySourceIfMatch) 318 } 319 320 if v.CopySourceIfModifiedSince != nil { 321 locationName := "X-Amz-Copy-Source-If-Modified-Since" 322 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfModifiedSince)) 323 } 324 325 if v.CopySourceIfNoneMatch != nil && len(*v.CopySourceIfNoneMatch) > 0 { 326 locationName := "X-Amz-Copy-Source-If-None-Match" 327 encoder.SetHeader(locationName).String(*v.CopySourceIfNoneMatch) 328 } 329 330 if v.CopySourceIfUnmodifiedSince != nil { 331 locationName := "X-Amz-Copy-Source-If-Unmodified-Since" 332 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfUnmodifiedSince)) 333 } 334 335 if v.CopySourceSSECustomerAlgorithm != nil && len(*v.CopySourceSSECustomerAlgorithm) > 0 { 336 locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm" 337 encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerAlgorithm) 338 } 339 340 if v.CopySourceSSECustomerKey != nil && len(*v.CopySourceSSECustomerKey) > 0 { 341 locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key" 342 encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKey) 343 } 344 345 if v.CopySourceSSECustomerKeyMD5 != nil && len(*v.CopySourceSSECustomerKeyMD5) > 0 { 346 locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5" 347 encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKeyMD5) 348 } 349 350 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 351 locationName := "X-Amz-Expected-Bucket-Owner" 352 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 353 } 354 355 if v.ExpectedSourceBucketOwner != nil && len(*v.ExpectedSourceBucketOwner) > 0 { 356 locationName := "X-Amz-Source-Expected-Bucket-Owner" 357 encoder.SetHeader(locationName).String(*v.ExpectedSourceBucketOwner) 358 } 359 360 if v.Expires != nil { 361 locationName := "Expires" 362 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires)) 363 } 364 365 if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { 366 locationName := "X-Amz-Grant-Full-Control" 367 encoder.SetHeader(locationName).String(*v.GrantFullControl) 368 } 369 370 if v.GrantRead != nil && len(*v.GrantRead) > 0 { 371 locationName := "X-Amz-Grant-Read" 372 encoder.SetHeader(locationName).String(*v.GrantRead) 373 } 374 375 if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { 376 locationName := "X-Amz-Grant-Read-Acp" 377 encoder.SetHeader(locationName).String(*v.GrantReadACP) 378 } 379 380 if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { 381 locationName := "X-Amz-Grant-Write-Acp" 382 encoder.SetHeader(locationName).String(*v.GrantWriteACP) 383 } 384 385 if v.Key == nil || len(*v.Key) == 0 { 386 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 387 } 388 if v.Key != nil { 389 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 390 return err 391 } 392 } 393 394 if v.Metadata != nil { 395 hv := encoder.Headers("X-Amz-Meta-") 396 for mapKey, mapVal := range v.Metadata { 397 if len(mapVal) > 0 { 398 hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) 399 } 400 } 401 } 402 403 if len(v.MetadataDirective) > 0 { 404 locationName := "X-Amz-Metadata-Directive" 405 encoder.SetHeader(locationName).String(string(v.MetadataDirective)) 406 } 407 408 if len(v.ObjectLockLegalHoldStatus) > 0 { 409 locationName := "X-Amz-Object-Lock-Legal-Hold" 410 encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus)) 411 } 412 413 if len(v.ObjectLockMode) > 0 { 414 locationName := "X-Amz-Object-Lock-Mode" 415 encoder.SetHeader(locationName).String(string(v.ObjectLockMode)) 416 } 417 418 if v.ObjectLockRetainUntilDate != nil { 419 locationName := "X-Amz-Object-Lock-Retain-Until-Date" 420 encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate)) 421 } 422 423 if len(v.RequestPayer) > 0 { 424 locationName := "X-Amz-Request-Payer" 425 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 426 } 427 428 if len(v.ServerSideEncryption) > 0 { 429 locationName := "X-Amz-Server-Side-Encryption" 430 encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) 431 } 432 433 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 434 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 435 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 436 } 437 438 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 439 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 440 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 441 } 442 443 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 444 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 445 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 446 } 447 448 if v.SSEKMSEncryptionContext != nil && len(*v.SSEKMSEncryptionContext) > 0 { 449 locationName := "X-Amz-Server-Side-Encryption-Context" 450 encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) 451 } 452 453 if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { 454 locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" 455 encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) 456 } 457 458 if len(v.StorageClass) > 0 { 459 locationName := "X-Amz-Storage-Class" 460 encoder.SetHeader(locationName).String(string(v.StorageClass)) 461 } 462 463 if v.Tagging != nil && len(*v.Tagging) > 0 { 464 locationName := "X-Amz-Tagging" 465 encoder.SetHeader(locationName).String(*v.Tagging) 466 } 467 468 if len(v.TaggingDirective) > 0 { 469 locationName := "X-Amz-Tagging-Directive" 470 encoder.SetHeader(locationName).String(string(v.TaggingDirective)) 471 } 472 473 if v.WebsiteRedirectLocation != nil && len(*v.WebsiteRedirectLocation) > 0 { 474 locationName := "X-Amz-Website-Redirect-Location" 475 encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) 476 } 477 478 return nil 479} 480 481type awsRestxml_serializeOpCreateBucket struct { 482} 483 484func (*awsRestxml_serializeOpCreateBucket) ID() string { 485 return "OperationSerializer" 486} 487 488func (m *awsRestxml_serializeOpCreateBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 489 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 490) { 491 request, ok := in.Request.(*smithyhttp.Request) 492 if !ok { 493 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 494 } 495 496 input, ok := in.Parameters.(*CreateBucketInput) 497 _ = input 498 if !ok { 499 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 500 } 501 502 opPath, opQuery := httpbinding.SplitURI("/{Bucket}") 503 request.URL.Path = opPath 504 if len(request.URL.RawQuery) > 0 { 505 request.URL.RawQuery = "&" + opQuery 506 } else { 507 request.URL.RawQuery = opQuery 508 } 509 510 request.Method = "PUT" 511 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 512 if err != nil { 513 return out, metadata, &smithy.SerializationError{Err: err} 514 } 515 516 if err := awsRestxml_serializeOpHttpBindingsCreateBucketInput(input, restEncoder); err != nil { 517 return out, metadata, &smithy.SerializationError{Err: err} 518 } 519 520 if input.CreateBucketConfiguration != nil { 521 if !restEncoder.HasHeader("Content-Type") { 522 restEncoder.SetHeader("Content-Type").String("application/xml") 523 } 524 525 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 526 payloadRootAttr := []smithyxml.Attr{} 527 payloadRoot := smithyxml.StartElement{ 528 Name: smithyxml.Name{ 529 Local: "CreateBucketConfiguration", 530 }, 531 Attr: payloadRootAttr, 532 } 533 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 534 if err := awsRestxml_serializeDocumentCreateBucketConfiguration(input.CreateBucketConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 535 return out, metadata, &smithy.SerializationError{Err: err} 536 } 537 payload := bytes.NewReader(xmlEncoder.Bytes()) 538 if request, err = request.SetStream(payload); err != nil { 539 return out, metadata, &smithy.SerializationError{Err: err} 540 } 541 } 542 543 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 544 return out, metadata, &smithy.SerializationError{Err: err} 545 } 546 in.Request = request 547 548 return next.HandleSerialize(ctx, in) 549} 550func awsRestxml_serializeOpHttpBindingsCreateBucketInput(v *CreateBucketInput, encoder *httpbinding.Encoder) error { 551 if v == nil { 552 return fmt.Errorf("unsupported serialization of nil %T", v) 553 } 554 555 if len(v.ACL) > 0 { 556 locationName := "X-Amz-Acl" 557 encoder.SetHeader(locationName).String(string(v.ACL)) 558 } 559 560 if v.Bucket == nil || len(*v.Bucket) == 0 { 561 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 562 } 563 if v.Bucket != nil { 564 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 565 return err 566 } 567 } 568 569 if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { 570 locationName := "X-Amz-Grant-Full-Control" 571 encoder.SetHeader(locationName).String(*v.GrantFullControl) 572 } 573 574 if v.GrantRead != nil && len(*v.GrantRead) > 0 { 575 locationName := "X-Amz-Grant-Read" 576 encoder.SetHeader(locationName).String(*v.GrantRead) 577 } 578 579 if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { 580 locationName := "X-Amz-Grant-Read-Acp" 581 encoder.SetHeader(locationName).String(*v.GrantReadACP) 582 } 583 584 if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { 585 locationName := "X-Amz-Grant-Write" 586 encoder.SetHeader(locationName).String(*v.GrantWrite) 587 } 588 589 if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { 590 locationName := "X-Amz-Grant-Write-Acp" 591 encoder.SetHeader(locationName).String(*v.GrantWriteACP) 592 } 593 594 if v.ObjectLockEnabledForBucket { 595 locationName := "X-Amz-Bucket-Object-Lock-Enabled" 596 encoder.SetHeader(locationName).Boolean(v.ObjectLockEnabledForBucket) 597 } 598 599 return nil 600} 601 602type awsRestxml_serializeOpCreateMultipartUpload struct { 603} 604 605func (*awsRestxml_serializeOpCreateMultipartUpload) ID() string { 606 return "OperationSerializer" 607} 608 609func (m *awsRestxml_serializeOpCreateMultipartUpload) 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.(*CreateMultipartUploadInput) 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("/{Bucket}/{Key+}?uploads") 624 request.URL.Path = opPath 625 if len(request.URL.RawQuery) > 0 { 626 request.URL.RawQuery = "&" + opQuery 627 } else { 628 request.URL.RawQuery = opQuery 629 } 630 631 request.Method = "POST" 632 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 633 if err != nil { 634 return out, metadata, &smithy.SerializationError{Err: err} 635 } 636 637 if err := awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(input, restEncoder); err != nil { 638 return out, metadata, &smithy.SerializationError{Err: err} 639 } 640 641 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 642 return out, metadata, &smithy.SerializationError{Err: err} 643 } 644 in.Request = request 645 646 return next.HandleSerialize(ctx, in) 647} 648func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMultipartUploadInput, encoder *httpbinding.Encoder) error { 649 if v == nil { 650 return fmt.Errorf("unsupported serialization of nil %T", v) 651 } 652 653 if len(v.ACL) > 0 { 654 locationName := "X-Amz-Acl" 655 encoder.SetHeader(locationName).String(string(v.ACL)) 656 } 657 658 if v.Bucket == nil || len(*v.Bucket) == 0 { 659 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 660 } 661 if v.Bucket != nil { 662 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 663 return err 664 } 665 } 666 667 if v.BucketKeyEnabled { 668 locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" 669 encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) 670 } 671 672 if v.CacheControl != nil && len(*v.CacheControl) > 0 { 673 locationName := "Cache-Control" 674 encoder.SetHeader(locationName).String(*v.CacheControl) 675 } 676 677 if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { 678 locationName := "Content-Disposition" 679 encoder.SetHeader(locationName).String(*v.ContentDisposition) 680 } 681 682 if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { 683 locationName := "Content-Encoding" 684 encoder.SetHeader(locationName).String(*v.ContentEncoding) 685 } 686 687 if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { 688 locationName := "Content-Language" 689 encoder.SetHeader(locationName).String(*v.ContentLanguage) 690 } 691 692 if v.ContentType != nil && len(*v.ContentType) > 0 { 693 locationName := "Content-Type" 694 encoder.SetHeader(locationName).String(*v.ContentType) 695 } 696 697 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 698 locationName := "X-Amz-Expected-Bucket-Owner" 699 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 700 } 701 702 if v.Expires != nil { 703 locationName := "Expires" 704 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires)) 705 } 706 707 if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { 708 locationName := "X-Amz-Grant-Full-Control" 709 encoder.SetHeader(locationName).String(*v.GrantFullControl) 710 } 711 712 if v.GrantRead != nil && len(*v.GrantRead) > 0 { 713 locationName := "X-Amz-Grant-Read" 714 encoder.SetHeader(locationName).String(*v.GrantRead) 715 } 716 717 if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { 718 locationName := "X-Amz-Grant-Read-Acp" 719 encoder.SetHeader(locationName).String(*v.GrantReadACP) 720 } 721 722 if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { 723 locationName := "X-Amz-Grant-Write-Acp" 724 encoder.SetHeader(locationName).String(*v.GrantWriteACP) 725 } 726 727 if v.Key == nil || len(*v.Key) == 0 { 728 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 729 } 730 if v.Key != nil { 731 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 732 return err 733 } 734 } 735 736 if v.Metadata != nil { 737 hv := encoder.Headers("X-Amz-Meta-") 738 for mapKey, mapVal := range v.Metadata { 739 if len(mapVal) > 0 { 740 hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) 741 } 742 } 743 } 744 745 if len(v.ObjectLockLegalHoldStatus) > 0 { 746 locationName := "X-Amz-Object-Lock-Legal-Hold" 747 encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus)) 748 } 749 750 if len(v.ObjectLockMode) > 0 { 751 locationName := "X-Amz-Object-Lock-Mode" 752 encoder.SetHeader(locationName).String(string(v.ObjectLockMode)) 753 } 754 755 if v.ObjectLockRetainUntilDate != nil { 756 locationName := "X-Amz-Object-Lock-Retain-Until-Date" 757 encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate)) 758 } 759 760 if len(v.RequestPayer) > 0 { 761 locationName := "X-Amz-Request-Payer" 762 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 763 } 764 765 if len(v.ServerSideEncryption) > 0 { 766 locationName := "X-Amz-Server-Side-Encryption" 767 encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) 768 } 769 770 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 771 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 772 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 773 } 774 775 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 776 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 777 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 778 } 779 780 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 781 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 782 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 783 } 784 785 if v.SSEKMSEncryptionContext != nil && len(*v.SSEKMSEncryptionContext) > 0 { 786 locationName := "X-Amz-Server-Side-Encryption-Context" 787 encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) 788 } 789 790 if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { 791 locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" 792 encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) 793 } 794 795 if len(v.StorageClass) > 0 { 796 locationName := "X-Amz-Storage-Class" 797 encoder.SetHeader(locationName).String(string(v.StorageClass)) 798 } 799 800 if v.Tagging != nil && len(*v.Tagging) > 0 { 801 locationName := "X-Amz-Tagging" 802 encoder.SetHeader(locationName).String(*v.Tagging) 803 } 804 805 if v.WebsiteRedirectLocation != nil && len(*v.WebsiteRedirectLocation) > 0 { 806 locationName := "X-Amz-Website-Redirect-Location" 807 encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) 808 } 809 810 return nil 811} 812 813type awsRestxml_serializeOpDeleteBucket struct { 814} 815 816func (*awsRestxml_serializeOpDeleteBucket) ID() string { 817 return "OperationSerializer" 818} 819 820func (m *awsRestxml_serializeOpDeleteBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 821 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 822) { 823 request, ok := in.Request.(*smithyhttp.Request) 824 if !ok { 825 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 826 } 827 828 input, ok := in.Parameters.(*DeleteBucketInput) 829 _ = input 830 if !ok { 831 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 832 } 833 834 opPath, opQuery := httpbinding.SplitURI("/{Bucket}") 835 request.URL.Path = opPath 836 if len(request.URL.RawQuery) > 0 { 837 request.URL.RawQuery = "&" + opQuery 838 } else { 839 request.URL.RawQuery = opQuery 840 } 841 842 request.Method = "DELETE" 843 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 844 if err != nil { 845 return out, metadata, &smithy.SerializationError{Err: err} 846 } 847 848 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketInput(input, restEncoder); err != nil { 849 return out, metadata, &smithy.SerializationError{Err: err} 850 } 851 852 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 853 return out, metadata, &smithy.SerializationError{Err: err} 854 } 855 in.Request = request 856 857 return next.HandleSerialize(ctx, in) 858} 859func awsRestxml_serializeOpHttpBindingsDeleteBucketInput(v *DeleteBucketInput, encoder *httpbinding.Encoder) error { 860 if v == nil { 861 return fmt.Errorf("unsupported serialization of nil %T", v) 862 } 863 864 if v.Bucket == nil || len(*v.Bucket) == 0 { 865 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 866 } 867 if v.Bucket != nil { 868 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 869 return err 870 } 871 } 872 873 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 874 locationName := "X-Amz-Expected-Bucket-Owner" 875 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 876 } 877 878 return nil 879} 880 881type awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration struct { 882} 883 884func (*awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) ID() string { 885 return "OperationSerializer" 886} 887 888func (m *awsRestxml_serializeOpDeleteBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 889 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 890) { 891 request, ok := in.Request.(*smithyhttp.Request) 892 if !ok { 893 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 894 } 895 896 input, ok := in.Parameters.(*DeleteBucketAnalyticsConfigurationInput) 897 _ = input 898 if !ok { 899 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 900 } 901 902 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?analytics") 903 request.URL.Path = opPath 904 if len(request.URL.RawQuery) > 0 { 905 request.URL.RawQuery = "&" + opQuery 906 } else { 907 request.URL.RawQuery = opQuery 908 } 909 910 request.Method = "DELETE" 911 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 912 if err != nil { 913 return out, metadata, &smithy.SerializationError{Err: err} 914 } 915 916 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketAnalyticsConfigurationInput(input, restEncoder); err != nil { 917 return out, metadata, &smithy.SerializationError{Err: err} 918 } 919 920 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 921 return out, metadata, &smithy.SerializationError{Err: err} 922 } 923 in.Request = request 924 925 return next.HandleSerialize(ctx, in) 926} 927func awsRestxml_serializeOpHttpBindingsDeleteBucketAnalyticsConfigurationInput(v *DeleteBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error { 928 if v == nil { 929 return fmt.Errorf("unsupported serialization of nil %T", v) 930 } 931 932 if v.Bucket == nil || len(*v.Bucket) == 0 { 933 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 934 } 935 if v.Bucket != nil { 936 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 937 return err 938 } 939 } 940 941 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 942 locationName := "X-Amz-Expected-Bucket-Owner" 943 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 944 } 945 946 if v.Id != nil { 947 encoder.SetQuery("id").String(*v.Id) 948 } 949 950 return nil 951} 952 953type awsRestxml_serializeOpDeleteBucketCors struct { 954} 955 956func (*awsRestxml_serializeOpDeleteBucketCors) ID() string { 957 return "OperationSerializer" 958} 959 960func (m *awsRestxml_serializeOpDeleteBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 961 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 962) { 963 request, ok := in.Request.(*smithyhttp.Request) 964 if !ok { 965 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 966 } 967 968 input, ok := in.Parameters.(*DeleteBucketCorsInput) 969 _ = input 970 if !ok { 971 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 972 } 973 974 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?cors") 975 request.URL.Path = opPath 976 if len(request.URL.RawQuery) > 0 { 977 request.URL.RawQuery = "&" + opQuery 978 } else { 979 request.URL.RawQuery = opQuery 980 } 981 982 request.Method = "DELETE" 983 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 984 if err != nil { 985 return out, metadata, &smithy.SerializationError{Err: err} 986 } 987 988 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketCorsInput(input, restEncoder); err != nil { 989 return out, metadata, &smithy.SerializationError{Err: err} 990 } 991 992 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 993 return out, metadata, &smithy.SerializationError{Err: err} 994 } 995 in.Request = request 996 997 return next.HandleSerialize(ctx, in) 998} 999func awsRestxml_serializeOpHttpBindingsDeleteBucketCorsInput(v *DeleteBucketCorsInput, encoder *httpbinding.Encoder) error { 1000 if v == nil { 1001 return fmt.Errorf("unsupported serialization of nil %T", v) 1002 } 1003 1004 if v.Bucket == nil || len(*v.Bucket) == 0 { 1005 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1006 } 1007 if v.Bucket != nil { 1008 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1009 return err 1010 } 1011 } 1012 1013 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1014 locationName := "X-Amz-Expected-Bucket-Owner" 1015 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1016 } 1017 1018 return nil 1019} 1020 1021type awsRestxml_serializeOpDeleteBucketEncryption struct { 1022} 1023 1024func (*awsRestxml_serializeOpDeleteBucketEncryption) ID() string { 1025 return "OperationSerializer" 1026} 1027 1028func (m *awsRestxml_serializeOpDeleteBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1029 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1030) { 1031 request, ok := in.Request.(*smithyhttp.Request) 1032 if !ok { 1033 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1034 } 1035 1036 input, ok := in.Parameters.(*DeleteBucketEncryptionInput) 1037 _ = input 1038 if !ok { 1039 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1040 } 1041 1042 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?encryption") 1043 request.URL.Path = opPath 1044 if len(request.URL.RawQuery) > 0 { 1045 request.URL.RawQuery = "&" + opQuery 1046 } else { 1047 request.URL.RawQuery = opQuery 1048 } 1049 1050 request.Method = "DELETE" 1051 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1052 if err != nil { 1053 return out, metadata, &smithy.SerializationError{Err: err} 1054 } 1055 1056 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketEncryptionInput(input, restEncoder); err != nil { 1057 return out, metadata, &smithy.SerializationError{Err: err} 1058 } 1059 1060 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1061 return out, metadata, &smithy.SerializationError{Err: err} 1062 } 1063 in.Request = request 1064 1065 return next.HandleSerialize(ctx, in) 1066} 1067func awsRestxml_serializeOpHttpBindingsDeleteBucketEncryptionInput(v *DeleteBucketEncryptionInput, encoder *httpbinding.Encoder) error { 1068 if v == nil { 1069 return fmt.Errorf("unsupported serialization of nil %T", v) 1070 } 1071 1072 if v.Bucket == nil || len(*v.Bucket) == 0 { 1073 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1074 } 1075 if v.Bucket != nil { 1076 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1077 return err 1078 } 1079 } 1080 1081 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1082 locationName := "X-Amz-Expected-Bucket-Owner" 1083 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1084 } 1085 1086 return nil 1087} 1088 1089type awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration struct { 1090} 1091 1092func (*awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) ID() string { 1093 return "OperationSerializer" 1094} 1095 1096func (m *awsRestxml_serializeOpDeleteBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1097 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1098) { 1099 request, ok := in.Request.(*smithyhttp.Request) 1100 if !ok { 1101 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1102 } 1103 1104 input, ok := in.Parameters.(*DeleteBucketIntelligentTieringConfigurationInput) 1105 _ = input 1106 if !ok { 1107 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1108 } 1109 1110 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?intelligent-tiering") 1111 request.URL.Path = opPath 1112 if len(request.URL.RawQuery) > 0 { 1113 request.URL.RawQuery = "&" + opQuery 1114 } else { 1115 request.URL.RawQuery = opQuery 1116 } 1117 1118 request.Method = "DELETE" 1119 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1120 if err != nil { 1121 return out, metadata, &smithy.SerializationError{Err: err} 1122 } 1123 1124 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketIntelligentTieringConfigurationInput(input, restEncoder); err != nil { 1125 return out, metadata, &smithy.SerializationError{Err: err} 1126 } 1127 1128 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1129 return out, metadata, &smithy.SerializationError{Err: err} 1130 } 1131 in.Request = request 1132 1133 return next.HandleSerialize(ctx, in) 1134} 1135func awsRestxml_serializeOpHttpBindingsDeleteBucketIntelligentTieringConfigurationInput(v *DeleteBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error { 1136 if v == nil { 1137 return fmt.Errorf("unsupported serialization of nil %T", v) 1138 } 1139 1140 if v.Bucket == nil || len(*v.Bucket) == 0 { 1141 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1142 } 1143 if v.Bucket != nil { 1144 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1145 return err 1146 } 1147 } 1148 1149 if v.Id != nil { 1150 encoder.SetQuery("id").String(*v.Id) 1151 } 1152 1153 return nil 1154} 1155 1156type awsRestxml_serializeOpDeleteBucketInventoryConfiguration struct { 1157} 1158 1159func (*awsRestxml_serializeOpDeleteBucketInventoryConfiguration) ID() string { 1160 return "OperationSerializer" 1161} 1162 1163func (m *awsRestxml_serializeOpDeleteBucketInventoryConfiguration) 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.(*DeleteBucketInventoryConfigurationInput) 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("/{Bucket}?inventory") 1178 request.URL.Path = opPath 1179 if len(request.URL.RawQuery) > 0 { 1180 request.URL.RawQuery = "&" + opQuery 1181 } else { 1182 request.URL.RawQuery = opQuery 1183 } 1184 1185 request.Method = "DELETE" 1186 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1187 if err != nil { 1188 return out, metadata, &smithy.SerializationError{Err: err} 1189 } 1190 1191 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketInventoryConfigurationInput(input, restEncoder); err != nil { 1192 return out, metadata, &smithy.SerializationError{Err: err} 1193 } 1194 1195 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1196 return out, metadata, &smithy.SerializationError{Err: err} 1197 } 1198 in.Request = request 1199 1200 return next.HandleSerialize(ctx, in) 1201} 1202func awsRestxml_serializeOpHttpBindingsDeleteBucketInventoryConfigurationInput(v *DeleteBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error { 1203 if v == nil { 1204 return fmt.Errorf("unsupported serialization of nil %T", v) 1205 } 1206 1207 if v.Bucket == nil || len(*v.Bucket) == 0 { 1208 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1209 } 1210 if v.Bucket != nil { 1211 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1212 return err 1213 } 1214 } 1215 1216 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1217 locationName := "X-Amz-Expected-Bucket-Owner" 1218 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1219 } 1220 1221 if v.Id != nil { 1222 encoder.SetQuery("id").String(*v.Id) 1223 } 1224 1225 return nil 1226} 1227 1228type awsRestxml_serializeOpDeleteBucketLifecycle struct { 1229} 1230 1231func (*awsRestxml_serializeOpDeleteBucketLifecycle) ID() string { 1232 return "OperationSerializer" 1233} 1234 1235func (m *awsRestxml_serializeOpDeleteBucketLifecycle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1236 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1237) { 1238 request, ok := in.Request.(*smithyhttp.Request) 1239 if !ok { 1240 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1241 } 1242 1243 input, ok := in.Parameters.(*DeleteBucketLifecycleInput) 1244 _ = input 1245 if !ok { 1246 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1247 } 1248 1249 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?lifecycle") 1250 request.URL.Path = opPath 1251 if len(request.URL.RawQuery) > 0 { 1252 request.URL.RawQuery = "&" + opQuery 1253 } else { 1254 request.URL.RawQuery = opQuery 1255 } 1256 1257 request.Method = "DELETE" 1258 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1259 if err != nil { 1260 return out, metadata, &smithy.SerializationError{Err: err} 1261 } 1262 1263 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleInput(input, restEncoder); err != nil { 1264 return out, metadata, &smithy.SerializationError{Err: err} 1265 } 1266 1267 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1268 return out, metadata, &smithy.SerializationError{Err: err} 1269 } 1270 in.Request = request 1271 1272 return next.HandleSerialize(ctx, in) 1273} 1274func awsRestxml_serializeOpHttpBindingsDeleteBucketLifecycleInput(v *DeleteBucketLifecycleInput, encoder *httpbinding.Encoder) error { 1275 if v == nil { 1276 return fmt.Errorf("unsupported serialization of nil %T", v) 1277 } 1278 1279 if v.Bucket == nil || len(*v.Bucket) == 0 { 1280 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1281 } 1282 if v.Bucket != nil { 1283 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1284 return err 1285 } 1286 } 1287 1288 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1289 locationName := "X-Amz-Expected-Bucket-Owner" 1290 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1291 } 1292 1293 return nil 1294} 1295 1296type awsRestxml_serializeOpDeleteBucketMetricsConfiguration struct { 1297} 1298 1299func (*awsRestxml_serializeOpDeleteBucketMetricsConfiguration) ID() string { 1300 return "OperationSerializer" 1301} 1302 1303func (m *awsRestxml_serializeOpDeleteBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1304 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1305) { 1306 request, ok := in.Request.(*smithyhttp.Request) 1307 if !ok { 1308 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1309 } 1310 1311 input, ok := in.Parameters.(*DeleteBucketMetricsConfigurationInput) 1312 _ = input 1313 if !ok { 1314 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1315 } 1316 1317 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?metrics") 1318 request.URL.Path = opPath 1319 if len(request.URL.RawQuery) > 0 { 1320 request.URL.RawQuery = "&" + opQuery 1321 } else { 1322 request.URL.RawQuery = opQuery 1323 } 1324 1325 request.Method = "DELETE" 1326 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1327 if err != nil { 1328 return out, metadata, &smithy.SerializationError{Err: err} 1329 } 1330 1331 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketMetricsConfigurationInput(input, restEncoder); err != nil { 1332 return out, metadata, &smithy.SerializationError{Err: err} 1333 } 1334 1335 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1336 return out, metadata, &smithy.SerializationError{Err: err} 1337 } 1338 in.Request = request 1339 1340 return next.HandleSerialize(ctx, in) 1341} 1342func awsRestxml_serializeOpHttpBindingsDeleteBucketMetricsConfigurationInput(v *DeleteBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error { 1343 if v == nil { 1344 return fmt.Errorf("unsupported serialization of nil %T", v) 1345 } 1346 1347 if v.Bucket == nil || len(*v.Bucket) == 0 { 1348 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1349 } 1350 if v.Bucket != nil { 1351 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1352 return err 1353 } 1354 } 1355 1356 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1357 locationName := "X-Amz-Expected-Bucket-Owner" 1358 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1359 } 1360 1361 if v.Id != nil { 1362 encoder.SetQuery("id").String(*v.Id) 1363 } 1364 1365 return nil 1366} 1367 1368type awsRestxml_serializeOpDeleteBucketOwnershipControls struct { 1369} 1370 1371func (*awsRestxml_serializeOpDeleteBucketOwnershipControls) ID() string { 1372 return "OperationSerializer" 1373} 1374 1375func (m *awsRestxml_serializeOpDeleteBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1376 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1377) { 1378 request, ok := in.Request.(*smithyhttp.Request) 1379 if !ok { 1380 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1381 } 1382 1383 input, ok := in.Parameters.(*DeleteBucketOwnershipControlsInput) 1384 _ = input 1385 if !ok { 1386 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1387 } 1388 1389 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?ownershipControls") 1390 request.URL.Path = opPath 1391 if len(request.URL.RawQuery) > 0 { 1392 request.URL.RawQuery = "&" + opQuery 1393 } else { 1394 request.URL.RawQuery = opQuery 1395 } 1396 1397 request.Method = "DELETE" 1398 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1399 if err != nil { 1400 return out, metadata, &smithy.SerializationError{Err: err} 1401 } 1402 1403 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketOwnershipControlsInput(input, restEncoder); err != nil { 1404 return out, metadata, &smithy.SerializationError{Err: err} 1405 } 1406 1407 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1408 return out, metadata, &smithy.SerializationError{Err: err} 1409 } 1410 in.Request = request 1411 1412 return next.HandleSerialize(ctx, in) 1413} 1414func awsRestxml_serializeOpHttpBindingsDeleteBucketOwnershipControlsInput(v *DeleteBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error { 1415 if v == nil { 1416 return fmt.Errorf("unsupported serialization of nil %T", v) 1417 } 1418 1419 if v.Bucket == nil || len(*v.Bucket) == 0 { 1420 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1421 } 1422 if v.Bucket != nil { 1423 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1424 return err 1425 } 1426 } 1427 1428 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1429 locationName := "X-Amz-Expected-Bucket-Owner" 1430 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1431 } 1432 1433 return nil 1434} 1435 1436type awsRestxml_serializeOpDeleteBucketPolicy struct { 1437} 1438 1439func (*awsRestxml_serializeOpDeleteBucketPolicy) ID() string { 1440 return "OperationSerializer" 1441} 1442 1443func (m *awsRestxml_serializeOpDeleteBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1444 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1445) { 1446 request, ok := in.Request.(*smithyhttp.Request) 1447 if !ok { 1448 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1449 } 1450 1451 input, ok := in.Parameters.(*DeleteBucketPolicyInput) 1452 _ = input 1453 if !ok { 1454 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1455 } 1456 1457 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?policy") 1458 request.URL.Path = opPath 1459 if len(request.URL.RawQuery) > 0 { 1460 request.URL.RawQuery = "&" + opQuery 1461 } else { 1462 request.URL.RawQuery = opQuery 1463 } 1464 1465 request.Method = "DELETE" 1466 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1467 if err != nil { 1468 return out, metadata, &smithy.SerializationError{Err: err} 1469 } 1470 1471 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(input, restEncoder); err != nil { 1472 return out, metadata, &smithy.SerializationError{Err: err} 1473 } 1474 1475 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1476 return out, metadata, &smithy.SerializationError{Err: err} 1477 } 1478 in.Request = request 1479 1480 return next.HandleSerialize(ctx, in) 1481} 1482func awsRestxml_serializeOpHttpBindingsDeleteBucketPolicyInput(v *DeleteBucketPolicyInput, encoder *httpbinding.Encoder) error { 1483 if v == nil { 1484 return fmt.Errorf("unsupported serialization of nil %T", v) 1485 } 1486 1487 if v.Bucket == nil || len(*v.Bucket) == 0 { 1488 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1489 } 1490 if v.Bucket != nil { 1491 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1492 return err 1493 } 1494 } 1495 1496 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1497 locationName := "X-Amz-Expected-Bucket-Owner" 1498 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1499 } 1500 1501 return nil 1502} 1503 1504type awsRestxml_serializeOpDeleteBucketReplication struct { 1505} 1506 1507func (*awsRestxml_serializeOpDeleteBucketReplication) ID() string { 1508 return "OperationSerializer" 1509} 1510 1511func (m *awsRestxml_serializeOpDeleteBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1512 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1513) { 1514 request, ok := in.Request.(*smithyhttp.Request) 1515 if !ok { 1516 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1517 } 1518 1519 input, ok := in.Parameters.(*DeleteBucketReplicationInput) 1520 _ = input 1521 if !ok { 1522 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1523 } 1524 1525 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?replication") 1526 request.URL.Path = opPath 1527 if len(request.URL.RawQuery) > 0 { 1528 request.URL.RawQuery = "&" + opQuery 1529 } else { 1530 request.URL.RawQuery = opQuery 1531 } 1532 1533 request.Method = "DELETE" 1534 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1535 if err != nil { 1536 return out, metadata, &smithy.SerializationError{Err: err} 1537 } 1538 1539 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(input, restEncoder); err != nil { 1540 return out, metadata, &smithy.SerializationError{Err: err} 1541 } 1542 1543 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1544 return out, metadata, &smithy.SerializationError{Err: err} 1545 } 1546 in.Request = request 1547 1548 return next.HandleSerialize(ctx, in) 1549} 1550func awsRestxml_serializeOpHttpBindingsDeleteBucketReplicationInput(v *DeleteBucketReplicationInput, encoder *httpbinding.Encoder) error { 1551 if v == nil { 1552 return fmt.Errorf("unsupported serialization of nil %T", v) 1553 } 1554 1555 if v.Bucket == nil || len(*v.Bucket) == 0 { 1556 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1557 } 1558 if v.Bucket != nil { 1559 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1560 return err 1561 } 1562 } 1563 1564 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1565 locationName := "X-Amz-Expected-Bucket-Owner" 1566 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1567 } 1568 1569 return nil 1570} 1571 1572type awsRestxml_serializeOpDeleteBucketTagging struct { 1573} 1574 1575func (*awsRestxml_serializeOpDeleteBucketTagging) ID() string { 1576 return "OperationSerializer" 1577} 1578 1579func (m *awsRestxml_serializeOpDeleteBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1580 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1581) { 1582 request, ok := in.Request.(*smithyhttp.Request) 1583 if !ok { 1584 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1585 } 1586 1587 input, ok := in.Parameters.(*DeleteBucketTaggingInput) 1588 _ = input 1589 if !ok { 1590 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1591 } 1592 1593 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?tagging") 1594 request.URL.Path = opPath 1595 if len(request.URL.RawQuery) > 0 { 1596 request.URL.RawQuery = "&" + opQuery 1597 } else { 1598 request.URL.RawQuery = opQuery 1599 } 1600 1601 request.Method = "DELETE" 1602 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1603 if err != nil { 1604 return out, metadata, &smithy.SerializationError{Err: err} 1605 } 1606 1607 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(input, restEncoder); err != nil { 1608 return out, metadata, &smithy.SerializationError{Err: err} 1609 } 1610 1611 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1612 return out, metadata, &smithy.SerializationError{Err: err} 1613 } 1614 in.Request = request 1615 1616 return next.HandleSerialize(ctx, in) 1617} 1618func awsRestxml_serializeOpHttpBindingsDeleteBucketTaggingInput(v *DeleteBucketTaggingInput, encoder *httpbinding.Encoder) error { 1619 if v == nil { 1620 return fmt.Errorf("unsupported serialization of nil %T", v) 1621 } 1622 1623 if v.Bucket == nil || len(*v.Bucket) == 0 { 1624 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1625 } 1626 if v.Bucket != nil { 1627 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1628 return err 1629 } 1630 } 1631 1632 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1633 locationName := "X-Amz-Expected-Bucket-Owner" 1634 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1635 } 1636 1637 return nil 1638} 1639 1640type awsRestxml_serializeOpDeleteBucketWebsite struct { 1641} 1642 1643func (*awsRestxml_serializeOpDeleteBucketWebsite) ID() string { 1644 return "OperationSerializer" 1645} 1646 1647func (m *awsRestxml_serializeOpDeleteBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1648 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1649) { 1650 request, ok := in.Request.(*smithyhttp.Request) 1651 if !ok { 1652 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1653 } 1654 1655 input, ok := in.Parameters.(*DeleteBucketWebsiteInput) 1656 _ = input 1657 if !ok { 1658 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1659 } 1660 1661 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?website") 1662 request.URL.Path = opPath 1663 if len(request.URL.RawQuery) > 0 { 1664 request.URL.RawQuery = "&" + opQuery 1665 } else { 1666 request.URL.RawQuery = opQuery 1667 } 1668 1669 request.Method = "DELETE" 1670 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1671 if err != nil { 1672 return out, metadata, &smithy.SerializationError{Err: err} 1673 } 1674 1675 if err := awsRestxml_serializeOpHttpBindingsDeleteBucketWebsiteInput(input, restEncoder); err != nil { 1676 return out, metadata, &smithy.SerializationError{Err: err} 1677 } 1678 1679 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1680 return out, metadata, &smithy.SerializationError{Err: err} 1681 } 1682 in.Request = request 1683 1684 return next.HandleSerialize(ctx, in) 1685} 1686func awsRestxml_serializeOpHttpBindingsDeleteBucketWebsiteInput(v *DeleteBucketWebsiteInput, encoder *httpbinding.Encoder) error { 1687 if v == nil { 1688 return fmt.Errorf("unsupported serialization of nil %T", v) 1689 } 1690 1691 if v.Bucket == nil || len(*v.Bucket) == 0 { 1692 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1693 } 1694 if v.Bucket != nil { 1695 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1696 return err 1697 } 1698 } 1699 1700 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1701 locationName := "X-Amz-Expected-Bucket-Owner" 1702 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1703 } 1704 1705 return nil 1706} 1707 1708type awsRestxml_serializeOpDeleteObject struct { 1709} 1710 1711func (*awsRestxml_serializeOpDeleteObject) ID() string { 1712 return "OperationSerializer" 1713} 1714 1715func (m *awsRestxml_serializeOpDeleteObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1716 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1717) { 1718 request, ok := in.Request.(*smithyhttp.Request) 1719 if !ok { 1720 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1721 } 1722 1723 input, ok := in.Parameters.(*DeleteObjectInput) 1724 _ = input 1725 if !ok { 1726 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1727 } 1728 1729 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=DeleteObject") 1730 request.URL.Path = opPath 1731 if len(request.URL.RawQuery) > 0 { 1732 request.URL.RawQuery = "&" + opQuery 1733 } else { 1734 request.URL.RawQuery = opQuery 1735 } 1736 1737 request.Method = "DELETE" 1738 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1739 if err != nil { 1740 return out, metadata, &smithy.SerializationError{Err: err} 1741 } 1742 1743 if err := awsRestxml_serializeOpHttpBindingsDeleteObjectInput(input, restEncoder); err != nil { 1744 return out, metadata, &smithy.SerializationError{Err: err} 1745 } 1746 1747 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1748 return out, metadata, &smithy.SerializationError{Err: err} 1749 } 1750 in.Request = request 1751 1752 return next.HandleSerialize(ctx, in) 1753} 1754func awsRestxml_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, encoder *httpbinding.Encoder) error { 1755 if v == nil { 1756 return fmt.Errorf("unsupported serialization of nil %T", v) 1757 } 1758 1759 if v.Bucket == nil || len(*v.Bucket) == 0 { 1760 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1761 } 1762 if v.Bucket != nil { 1763 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1764 return err 1765 } 1766 } 1767 1768 if v.BypassGovernanceRetention { 1769 locationName := "X-Amz-Bypass-Governance-Retention" 1770 encoder.SetHeader(locationName).Boolean(v.BypassGovernanceRetention) 1771 } 1772 1773 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1774 locationName := "X-Amz-Expected-Bucket-Owner" 1775 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1776 } 1777 1778 if v.Key == nil || len(*v.Key) == 0 { 1779 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 1780 } 1781 if v.Key != nil { 1782 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 1783 return err 1784 } 1785 } 1786 1787 if v.MFA != nil && len(*v.MFA) > 0 { 1788 locationName := "X-Amz-Mfa" 1789 encoder.SetHeader(locationName).String(*v.MFA) 1790 } 1791 1792 if len(v.RequestPayer) > 0 { 1793 locationName := "X-Amz-Request-Payer" 1794 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 1795 } 1796 1797 if v.VersionId != nil { 1798 encoder.SetQuery("versionId").String(*v.VersionId) 1799 } 1800 1801 return nil 1802} 1803 1804type awsRestxml_serializeOpDeleteObjects struct { 1805} 1806 1807func (*awsRestxml_serializeOpDeleteObjects) ID() string { 1808 return "OperationSerializer" 1809} 1810 1811func (m *awsRestxml_serializeOpDeleteObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1812 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1813) { 1814 request, ok := in.Request.(*smithyhttp.Request) 1815 if !ok { 1816 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1817 } 1818 1819 input, ok := in.Parameters.(*DeleteObjectsInput) 1820 _ = input 1821 if !ok { 1822 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1823 } 1824 1825 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?delete") 1826 request.URL.Path = opPath 1827 if len(request.URL.RawQuery) > 0 { 1828 request.URL.RawQuery = "&" + opQuery 1829 } else { 1830 request.URL.RawQuery = opQuery 1831 } 1832 1833 request.Method = "POST" 1834 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1835 if err != nil { 1836 return out, metadata, &smithy.SerializationError{Err: err} 1837 } 1838 1839 if err := awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(input, restEncoder); err != nil { 1840 return out, metadata, &smithy.SerializationError{Err: err} 1841 } 1842 1843 if input.Delete != nil { 1844 if !restEncoder.HasHeader("Content-Type") { 1845 restEncoder.SetHeader("Content-Type").String("application/xml") 1846 } 1847 1848 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 1849 payloadRootAttr := []smithyxml.Attr{} 1850 payloadRoot := smithyxml.StartElement{ 1851 Name: smithyxml.Name{ 1852 Local: "Delete", 1853 }, 1854 Attr: payloadRootAttr, 1855 } 1856 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 1857 if err := awsRestxml_serializeDocumentDelete(input.Delete, xmlEncoder.RootElement(payloadRoot)); err != nil { 1858 return out, metadata, &smithy.SerializationError{Err: err} 1859 } 1860 payload := bytes.NewReader(xmlEncoder.Bytes()) 1861 if request, err = request.SetStream(payload); err != nil { 1862 return out, metadata, &smithy.SerializationError{Err: err} 1863 } 1864 } 1865 1866 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1867 return out, metadata, &smithy.SerializationError{Err: err} 1868 } 1869 in.Request = request 1870 1871 return next.HandleSerialize(ctx, in) 1872} 1873func awsRestxml_serializeOpHttpBindingsDeleteObjectsInput(v *DeleteObjectsInput, encoder *httpbinding.Encoder) error { 1874 if v == nil { 1875 return fmt.Errorf("unsupported serialization of nil %T", v) 1876 } 1877 1878 if v.Bucket == nil || len(*v.Bucket) == 0 { 1879 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1880 } 1881 if v.Bucket != nil { 1882 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1883 return err 1884 } 1885 } 1886 1887 if v.BypassGovernanceRetention { 1888 locationName := "X-Amz-Bypass-Governance-Retention" 1889 encoder.SetHeader(locationName).Boolean(v.BypassGovernanceRetention) 1890 } 1891 1892 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1893 locationName := "X-Amz-Expected-Bucket-Owner" 1894 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1895 } 1896 1897 if v.MFA != nil && len(*v.MFA) > 0 { 1898 locationName := "X-Amz-Mfa" 1899 encoder.SetHeader(locationName).String(*v.MFA) 1900 } 1901 1902 if len(v.RequestPayer) > 0 { 1903 locationName := "X-Amz-Request-Payer" 1904 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 1905 } 1906 1907 return nil 1908} 1909 1910type awsRestxml_serializeOpDeleteObjectTagging struct { 1911} 1912 1913func (*awsRestxml_serializeOpDeleteObjectTagging) ID() string { 1914 return "OperationSerializer" 1915} 1916 1917func (m *awsRestxml_serializeOpDeleteObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1918 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 1919) { 1920 request, ok := in.Request.(*smithyhttp.Request) 1921 if !ok { 1922 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 1923 } 1924 1925 input, ok := in.Parameters.(*DeleteObjectTaggingInput) 1926 _ = input 1927 if !ok { 1928 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 1929 } 1930 1931 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?tagging") 1932 request.URL.Path = opPath 1933 if len(request.URL.RawQuery) > 0 { 1934 request.URL.RawQuery = "&" + opQuery 1935 } else { 1936 request.URL.RawQuery = opQuery 1937 } 1938 1939 request.Method = "DELETE" 1940 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 1941 if err != nil { 1942 return out, metadata, &smithy.SerializationError{Err: err} 1943 } 1944 1945 if err := awsRestxml_serializeOpHttpBindingsDeleteObjectTaggingInput(input, restEncoder); err != nil { 1946 return out, metadata, &smithy.SerializationError{Err: err} 1947 } 1948 1949 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 1950 return out, metadata, &smithy.SerializationError{Err: err} 1951 } 1952 in.Request = request 1953 1954 return next.HandleSerialize(ctx, in) 1955} 1956func awsRestxml_serializeOpHttpBindingsDeleteObjectTaggingInput(v *DeleteObjectTaggingInput, encoder *httpbinding.Encoder) error { 1957 if v == nil { 1958 return fmt.Errorf("unsupported serialization of nil %T", v) 1959 } 1960 1961 if v.Bucket == nil || len(*v.Bucket) == 0 { 1962 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 1963 } 1964 if v.Bucket != nil { 1965 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 1966 return err 1967 } 1968 } 1969 1970 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 1971 locationName := "X-Amz-Expected-Bucket-Owner" 1972 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 1973 } 1974 1975 if v.Key == nil || len(*v.Key) == 0 { 1976 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 1977 } 1978 if v.Key != nil { 1979 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 1980 return err 1981 } 1982 } 1983 1984 if v.VersionId != nil { 1985 encoder.SetQuery("versionId").String(*v.VersionId) 1986 } 1987 1988 return nil 1989} 1990 1991type awsRestxml_serializeOpDeletePublicAccessBlock struct { 1992} 1993 1994func (*awsRestxml_serializeOpDeletePublicAccessBlock) ID() string { 1995 return "OperationSerializer" 1996} 1997 1998func (m *awsRestxml_serializeOpDeletePublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 1999 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2000) { 2001 request, ok := in.Request.(*smithyhttp.Request) 2002 if !ok { 2003 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2004 } 2005 2006 input, ok := in.Parameters.(*DeletePublicAccessBlockInput) 2007 _ = input 2008 if !ok { 2009 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2010 } 2011 2012 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?publicAccessBlock") 2013 request.URL.Path = opPath 2014 if len(request.URL.RawQuery) > 0 { 2015 request.URL.RawQuery = "&" + opQuery 2016 } else { 2017 request.URL.RawQuery = opQuery 2018 } 2019 2020 request.Method = "DELETE" 2021 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2022 if err != nil { 2023 return out, metadata, &smithy.SerializationError{Err: err} 2024 } 2025 2026 if err := awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(input, restEncoder); err != nil { 2027 return out, metadata, &smithy.SerializationError{Err: err} 2028 } 2029 2030 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2031 return out, metadata, &smithy.SerializationError{Err: err} 2032 } 2033 in.Request = request 2034 2035 return next.HandleSerialize(ctx, in) 2036} 2037func awsRestxml_serializeOpHttpBindingsDeletePublicAccessBlockInput(v *DeletePublicAccessBlockInput, encoder *httpbinding.Encoder) error { 2038 if v == nil { 2039 return fmt.Errorf("unsupported serialization of nil %T", v) 2040 } 2041 2042 if v.Bucket == nil || len(*v.Bucket) == 0 { 2043 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2044 } 2045 if v.Bucket != nil { 2046 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2047 return err 2048 } 2049 } 2050 2051 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2052 locationName := "X-Amz-Expected-Bucket-Owner" 2053 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2054 } 2055 2056 return nil 2057} 2058 2059type awsRestxml_serializeOpGetBucketAccelerateConfiguration struct { 2060} 2061 2062func (*awsRestxml_serializeOpGetBucketAccelerateConfiguration) ID() string { 2063 return "OperationSerializer" 2064} 2065 2066func (m *awsRestxml_serializeOpGetBucketAccelerateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2067 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2068) { 2069 request, ok := in.Request.(*smithyhttp.Request) 2070 if !ok { 2071 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2072 } 2073 2074 input, ok := in.Parameters.(*GetBucketAccelerateConfigurationInput) 2075 _ = input 2076 if !ok { 2077 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2078 } 2079 2080 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?accelerate") 2081 request.URL.Path = opPath 2082 if len(request.URL.RawQuery) > 0 { 2083 request.URL.RawQuery = "&" + opQuery 2084 } else { 2085 request.URL.RawQuery = opQuery 2086 } 2087 2088 request.Method = "GET" 2089 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2090 if err != nil { 2091 return out, metadata, &smithy.SerializationError{Err: err} 2092 } 2093 2094 if err := awsRestxml_serializeOpHttpBindingsGetBucketAccelerateConfigurationInput(input, restEncoder); err != nil { 2095 return out, metadata, &smithy.SerializationError{Err: err} 2096 } 2097 2098 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2099 return out, metadata, &smithy.SerializationError{Err: err} 2100 } 2101 in.Request = request 2102 2103 return next.HandleSerialize(ctx, in) 2104} 2105func awsRestxml_serializeOpHttpBindingsGetBucketAccelerateConfigurationInput(v *GetBucketAccelerateConfigurationInput, encoder *httpbinding.Encoder) error { 2106 if v == nil { 2107 return fmt.Errorf("unsupported serialization of nil %T", v) 2108 } 2109 2110 if v.Bucket == nil || len(*v.Bucket) == 0 { 2111 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2112 } 2113 if v.Bucket != nil { 2114 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2115 return err 2116 } 2117 } 2118 2119 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2120 locationName := "X-Amz-Expected-Bucket-Owner" 2121 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2122 } 2123 2124 return nil 2125} 2126 2127type awsRestxml_serializeOpGetBucketAcl struct { 2128} 2129 2130func (*awsRestxml_serializeOpGetBucketAcl) ID() string { 2131 return "OperationSerializer" 2132} 2133 2134func (m *awsRestxml_serializeOpGetBucketAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2135 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2136) { 2137 request, ok := in.Request.(*smithyhttp.Request) 2138 if !ok { 2139 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2140 } 2141 2142 input, ok := in.Parameters.(*GetBucketAclInput) 2143 _ = input 2144 if !ok { 2145 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2146 } 2147 2148 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?acl") 2149 request.URL.Path = opPath 2150 if len(request.URL.RawQuery) > 0 { 2151 request.URL.RawQuery = "&" + opQuery 2152 } else { 2153 request.URL.RawQuery = opQuery 2154 } 2155 2156 request.Method = "GET" 2157 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2158 if err != nil { 2159 return out, metadata, &smithy.SerializationError{Err: err} 2160 } 2161 2162 if err := awsRestxml_serializeOpHttpBindingsGetBucketAclInput(input, restEncoder); err != nil { 2163 return out, metadata, &smithy.SerializationError{Err: err} 2164 } 2165 2166 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2167 return out, metadata, &smithy.SerializationError{Err: err} 2168 } 2169 in.Request = request 2170 2171 return next.HandleSerialize(ctx, in) 2172} 2173func awsRestxml_serializeOpHttpBindingsGetBucketAclInput(v *GetBucketAclInput, encoder *httpbinding.Encoder) error { 2174 if v == nil { 2175 return fmt.Errorf("unsupported serialization of nil %T", v) 2176 } 2177 2178 if v.Bucket == nil || len(*v.Bucket) == 0 { 2179 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2180 } 2181 if v.Bucket != nil { 2182 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2183 return err 2184 } 2185 } 2186 2187 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2188 locationName := "X-Amz-Expected-Bucket-Owner" 2189 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2190 } 2191 2192 return nil 2193} 2194 2195type awsRestxml_serializeOpGetBucketAnalyticsConfiguration struct { 2196} 2197 2198func (*awsRestxml_serializeOpGetBucketAnalyticsConfiguration) ID() string { 2199 return "OperationSerializer" 2200} 2201 2202func (m *awsRestxml_serializeOpGetBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2203 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2204) { 2205 request, ok := in.Request.(*smithyhttp.Request) 2206 if !ok { 2207 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2208 } 2209 2210 input, ok := in.Parameters.(*GetBucketAnalyticsConfigurationInput) 2211 _ = input 2212 if !ok { 2213 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2214 } 2215 2216 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?analytics&x-id=GetBucketAnalyticsConfiguration") 2217 request.URL.Path = opPath 2218 if len(request.URL.RawQuery) > 0 { 2219 request.URL.RawQuery = "&" + opQuery 2220 } else { 2221 request.URL.RawQuery = opQuery 2222 } 2223 2224 request.Method = "GET" 2225 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2226 if err != nil { 2227 return out, metadata, &smithy.SerializationError{Err: err} 2228 } 2229 2230 if err := awsRestxml_serializeOpHttpBindingsGetBucketAnalyticsConfigurationInput(input, restEncoder); err != nil { 2231 return out, metadata, &smithy.SerializationError{Err: err} 2232 } 2233 2234 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2235 return out, metadata, &smithy.SerializationError{Err: err} 2236 } 2237 in.Request = request 2238 2239 return next.HandleSerialize(ctx, in) 2240} 2241func awsRestxml_serializeOpHttpBindingsGetBucketAnalyticsConfigurationInput(v *GetBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error { 2242 if v == nil { 2243 return fmt.Errorf("unsupported serialization of nil %T", v) 2244 } 2245 2246 if v.Bucket == nil || len(*v.Bucket) == 0 { 2247 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2248 } 2249 if v.Bucket != nil { 2250 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2251 return err 2252 } 2253 } 2254 2255 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2256 locationName := "X-Amz-Expected-Bucket-Owner" 2257 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2258 } 2259 2260 if v.Id != nil { 2261 encoder.SetQuery("id").String(*v.Id) 2262 } 2263 2264 return nil 2265} 2266 2267type awsRestxml_serializeOpGetBucketCors struct { 2268} 2269 2270func (*awsRestxml_serializeOpGetBucketCors) ID() string { 2271 return "OperationSerializer" 2272} 2273 2274func (m *awsRestxml_serializeOpGetBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2275 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2276) { 2277 request, ok := in.Request.(*smithyhttp.Request) 2278 if !ok { 2279 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2280 } 2281 2282 input, ok := in.Parameters.(*GetBucketCorsInput) 2283 _ = input 2284 if !ok { 2285 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2286 } 2287 2288 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?cors") 2289 request.URL.Path = opPath 2290 if len(request.URL.RawQuery) > 0 { 2291 request.URL.RawQuery = "&" + opQuery 2292 } else { 2293 request.URL.RawQuery = opQuery 2294 } 2295 2296 request.Method = "GET" 2297 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2298 if err != nil { 2299 return out, metadata, &smithy.SerializationError{Err: err} 2300 } 2301 2302 if err := awsRestxml_serializeOpHttpBindingsGetBucketCorsInput(input, restEncoder); err != nil { 2303 return out, metadata, &smithy.SerializationError{Err: err} 2304 } 2305 2306 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2307 return out, metadata, &smithy.SerializationError{Err: err} 2308 } 2309 in.Request = request 2310 2311 return next.HandleSerialize(ctx, in) 2312} 2313func awsRestxml_serializeOpHttpBindingsGetBucketCorsInput(v *GetBucketCorsInput, encoder *httpbinding.Encoder) error { 2314 if v == nil { 2315 return fmt.Errorf("unsupported serialization of nil %T", v) 2316 } 2317 2318 if v.Bucket == nil || len(*v.Bucket) == 0 { 2319 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2320 } 2321 if v.Bucket != nil { 2322 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2323 return err 2324 } 2325 } 2326 2327 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2328 locationName := "X-Amz-Expected-Bucket-Owner" 2329 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2330 } 2331 2332 return nil 2333} 2334 2335type awsRestxml_serializeOpGetBucketEncryption struct { 2336} 2337 2338func (*awsRestxml_serializeOpGetBucketEncryption) ID() string { 2339 return "OperationSerializer" 2340} 2341 2342func (m *awsRestxml_serializeOpGetBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2343 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2344) { 2345 request, ok := in.Request.(*smithyhttp.Request) 2346 if !ok { 2347 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2348 } 2349 2350 input, ok := in.Parameters.(*GetBucketEncryptionInput) 2351 _ = input 2352 if !ok { 2353 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2354 } 2355 2356 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?encryption") 2357 request.URL.Path = opPath 2358 if len(request.URL.RawQuery) > 0 { 2359 request.URL.RawQuery = "&" + opQuery 2360 } else { 2361 request.URL.RawQuery = opQuery 2362 } 2363 2364 request.Method = "GET" 2365 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2366 if err != nil { 2367 return out, metadata, &smithy.SerializationError{Err: err} 2368 } 2369 2370 if err := awsRestxml_serializeOpHttpBindingsGetBucketEncryptionInput(input, restEncoder); err != nil { 2371 return out, metadata, &smithy.SerializationError{Err: err} 2372 } 2373 2374 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2375 return out, metadata, &smithy.SerializationError{Err: err} 2376 } 2377 in.Request = request 2378 2379 return next.HandleSerialize(ctx, in) 2380} 2381func awsRestxml_serializeOpHttpBindingsGetBucketEncryptionInput(v *GetBucketEncryptionInput, encoder *httpbinding.Encoder) error { 2382 if v == nil { 2383 return fmt.Errorf("unsupported serialization of nil %T", v) 2384 } 2385 2386 if v.Bucket == nil || len(*v.Bucket) == 0 { 2387 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2388 } 2389 if v.Bucket != nil { 2390 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2391 return err 2392 } 2393 } 2394 2395 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2396 locationName := "X-Amz-Expected-Bucket-Owner" 2397 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2398 } 2399 2400 return nil 2401} 2402 2403type awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration struct { 2404} 2405 2406func (*awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) ID() string { 2407 return "OperationSerializer" 2408} 2409 2410func (m *awsRestxml_serializeOpGetBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2411 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2412) { 2413 request, ok := in.Request.(*smithyhttp.Request) 2414 if !ok { 2415 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2416 } 2417 2418 input, ok := in.Parameters.(*GetBucketIntelligentTieringConfigurationInput) 2419 _ = input 2420 if !ok { 2421 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2422 } 2423 2424 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?intelligent-tiering&x-id=GetBucketIntelligentTieringConfiguration") 2425 request.URL.Path = opPath 2426 if len(request.URL.RawQuery) > 0 { 2427 request.URL.RawQuery = "&" + opQuery 2428 } else { 2429 request.URL.RawQuery = opQuery 2430 } 2431 2432 request.Method = "GET" 2433 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2434 if err != nil { 2435 return out, metadata, &smithy.SerializationError{Err: err} 2436 } 2437 2438 if err := awsRestxml_serializeOpHttpBindingsGetBucketIntelligentTieringConfigurationInput(input, restEncoder); err != nil { 2439 return out, metadata, &smithy.SerializationError{Err: err} 2440 } 2441 2442 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2443 return out, metadata, &smithy.SerializationError{Err: err} 2444 } 2445 in.Request = request 2446 2447 return next.HandleSerialize(ctx, in) 2448} 2449func awsRestxml_serializeOpHttpBindingsGetBucketIntelligentTieringConfigurationInput(v *GetBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error { 2450 if v == nil { 2451 return fmt.Errorf("unsupported serialization of nil %T", v) 2452 } 2453 2454 if v.Bucket == nil || len(*v.Bucket) == 0 { 2455 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2456 } 2457 if v.Bucket != nil { 2458 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2459 return err 2460 } 2461 } 2462 2463 if v.Id != nil { 2464 encoder.SetQuery("id").String(*v.Id) 2465 } 2466 2467 return nil 2468} 2469 2470type awsRestxml_serializeOpGetBucketInventoryConfiguration struct { 2471} 2472 2473func (*awsRestxml_serializeOpGetBucketInventoryConfiguration) ID() string { 2474 return "OperationSerializer" 2475} 2476 2477func (m *awsRestxml_serializeOpGetBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2478 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2479) { 2480 request, ok := in.Request.(*smithyhttp.Request) 2481 if !ok { 2482 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2483 } 2484 2485 input, ok := in.Parameters.(*GetBucketInventoryConfigurationInput) 2486 _ = input 2487 if !ok { 2488 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2489 } 2490 2491 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?inventory&x-id=GetBucketInventoryConfiguration") 2492 request.URL.Path = opPath 2493 if len(request.URL.RawQuery) > 0 { 2494 request.URL.RawQuery = "&" + opQuery 2495 } else { 2496 request.URL.RawQuery = opQuery 2497 } 2498 2499 request.Method = "GET" 2500 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2501 if err != nil { 2502 return out, metadata, &smithy.SerializationError{Err: err} 2503 } 2504 2505 if err := awsRestxml_serializeOpHttpBindingsGetBucketInventoryConfigurationInput(input, restEncoder); err != nil { 2506 return out, metadata, &smithy.SerializationError{Err: err} 2507 } 2508 2509 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2510 return out, metadata, &smithy.SerializationError{Err: err} 2511 } 2512 in.Request = request 2513 2514 return next.HandleSerialize(ctx, in) 2515} 2516func awsRestxml_serializeOpHttpBindingsGetBucketInventoryConfigurationInput(v *GetBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error { 2517 if v == nil { 2518 return fmt.Errorf("unsupported serialization of nil %T", v) 2519 } 2520 2521 if v.Bucket == nil || len(*v.Bucket) == 0 { 2522 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2523 } 2524 if v.Bucket != nil { 2525 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2526 return err 2527 } 2528 } 2529 2530 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2531 locationName := "X-Amz-Expected-Bucket-Owner" 2532 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2533 } 2534 2535 if v.Id != nil { 2536 encoder.SetQuery("id").String(*v.Id) 2537 } 2538 2539 return nil 2540} 2541 2542type awsRestxml_serializeOpGetBucketLifecycleConfiguration struct { 2543} 2544 2545func (*awsRestxml_serializeOpGetBucketLifecycleConfiguration) ID() string { 2546 return "OperationSerializer" 2547} 2548 2549func (m *awsRestxml_serializeOpGetBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2550 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2551) { 2552 request, ok := in.Request.(*smithyhttp.Request) 2553 if !ok { 2554 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2555 } 2556 2557 input, ok := in.Parameters.(*GetBucketLifecycleConfigurationInput) 2558 _ = input 2559 if !ok { 2560 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2561 } 2562 2563 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?lifecycle") 2564 request.URL.Path = opPath 2565 if len(request.URL.RawQuery) > 0 { 2566 request.URL.RawQuery = "&" + opQuery 2567 } else { 2568 request.URL.RawQuery = opQuery 2569 } 2570 2571 request.Method = "GET" 2572 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2573 if err != nil { 2574 return out, metadata, &smithy.SerializationError{Err: err} 2575 } 2576 2577 if err := awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(input, restEncoder); err != nil { 2578 return out, metadata, &smithy.SerializationError{Err: err} 2579 } 2580 2581 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2582 return out, metadata, &smithy.SerializationError{Err: err} 2583 } 2584 in.Request = request 2585 2586 return next.HandleSerialize(ctx, in) 2587} 2588func awsRestxml_serializeOpHttpBindingsGetBucketLifecycleConfigurationInput(v *GetBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { 2589 if v == nil { 2590 return fmt.Errorf("unsupported serialization of nil %T", v) 2591 } 2592 2593 if v.Bucket == nil || len(*v.Bucket) == 0 { 2594 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2595 } 2596 if v.Bucket != nil { 2597 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2598 return err 2599 } 2600 } 2601 2602 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2603 locationName := "X-Amz-Expected-Bucket-Owner" 2604 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2605 } 2606 2607 return nil 2608} 2609 2610type awsRestxml_serializeOpGetBucketLocation struct { 2611} 2612 2613func (*awsRestxml_serializeOpGetBucketLocation) ID() string { 2614 return "OperationSerializer" 2615} 2616 2617func (m *awsRestxml_serializeOpGetBucketLocation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2618 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2619) { 2620 request, ok := in.Request.(*smithyhttp.Request) 2621 if !ok { 2622 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2623 } 2624 2625 input, ok := in.Parameters.(*GetBucketLocationInput) 2626 _ = input 2627 if !ok { 2628 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2629 } 2630 2631 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?location") 2632 request.URL.Path = opPath 2633 if len(request.URL.RawQuery) > 0 { 2634 request.URL.RawQuery = "&" + opQuery 2635 } else { 2636 request.URL.RawQuery = opQuery 2637 } 2638 2639 request.Method = "GET" 2640 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2641 if err != nil { 2642 return out, metadata, &smithy.SerializationError{Err: err} 2643 } 2644 2645 if err := awsRestxml_serializeOpHttpBindingsGetBucketLocationInput(input, restEncoder); err != nil { 2646 return out, metadata, &smithy.SerializationError{Err: err} 2647 } 2648 2649 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2650 return out, metadata, &smithy.SerializationError{Err: err} 2651 } 2652 in.Request = request 2653 2654 return next.HandleSerialize(ctx, in) 2655} 2656func awsRestxml_serializeOpHttpBindingsGetBucketLocationInput(v *GetBucketLocationInput, encoder *httpbinding.Encoder) error { 2657 if v == nil { 2658 return fmt.Errorf("unsupported serialization of nil %T", v) 2659 } 2660 2661 if v.Bucket == nil || len(*v.Bucket) == 0 { 2662 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2663 } 2664 if v.Bucket != nil { 2665 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2666 return err 2667 } 2668 } 2669 2670 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2671 locationName := "X-Amz-Expected-Bucket-Owner" 2672 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2673 } 2674 2675 return nil 2676} 2677 2678type awsRestxml_serializeOpGetBucketLogging struct { 2679} 2680 2681func (*awsRestxml_serializeOpGetBucketLogging) ID() string { 2682 return "OperationSerializer" 2683} 2684 2685func (m *awsRestxml_serializeOpGetBucketLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2686 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2687) { 2688 request, ok := in.Request.(*smithyhttp.Request) 2689 if !ok { 2690 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2691 } 2692 2693 input, ok := in.Parameters.(*GetBucketLoggingInput) 2694 _ = input 2695 if !ok { 2696 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2697 } 2698 2699 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?logging") 2700 request.URL.Path = opPath 2701 if len(request.URL.RawQuery) > 0 { 2702 request.URL.RawQuery = "&" + opQuery 2703 } else { 2704 request.URL.RawQuery = opQuery 2705 } 2706 2707 request.Method = "GET" 2708 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2709 if err != nil { 2710 return out, metadata, &smithy.SerializationError{Err: err} 2711 } 2712 2713 if err := awsRestxml_serializeOpHttpBindingsGetBucketLoggingInput(input, restEncoder); err != nil { 2714 return out, metadata, &smithy.SerializationError{Err: err} 2715 } 2716 2717 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2718 return out, metadata, &smithy.SerializationError{Err: err} 2719 } 2720 in.Request = request 2721 2722 return next.HandleSerialize(ctx, in) 2723} 2724func awsRestxml_serializeOpHttpBindingsGetBucketLoggingInput(v *GetBucketLoggingInput, encoder *httpbinding.Encoder) error { 2725 if v == nil { 2726 return fmt.Errorf("unsupported serialization of nil %T", v) 2727 } 2728 2729 if v.Bucket == nil || len(*v.Bucket) == 0 { 2730 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2731 } 2732 if v.Bucket != nil { 2733 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2734 return err 2735 } 2736 } 2737 2738 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2739 locationName := "X-Amz-Expected-Bucket-Owner" 2740 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2741 } 2742 2743 return nil 2744} 2745 2746type awsRestxml_serializeOpGetBucketMetricsConfiguration struct { 2747} 2748 2749func (*awsRestxml_serializeOpGetBucketMetricsConfiguration) ID() string { 2750 return "OperationSerializer" 2751} 2752 2753func (m *awsRestxml_serializeOpGetBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2754 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2755) { 2756 request, ok := in.Request.(*smithyhttp.Request) 2757 if !ok { 2758 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2759 } 2760 2761 input, ok := in.Parameters.(*GetBucketMetricsConfigurationInput) 2762 _ = input 2763 if !ok { 2764 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2765 } 2766 2767 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?metrics&x-id=GetBucketMetricsConfiguration") 2768 request.URL.Path = opPath 2769 if len(request.URL.RawQuery) > 0 { 2770 request.URL.RawQuery = "&" + opQuery 2771 } else { 2772 request.URL.RawQuery = opQuery 2773 } 2774 2775 request.Method = "GET" 2776 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2777 if err != nil { 2778 return out, metadata, &smithy.SerializationError{Err: err} 2779 } 2780 2781 if err := awsRestxml_serializeOpHttpBindingsGetBucketMetricsConfigurationInput(input, restEncoder); err != nil { 2782 return out, metadata, &smithy.SerializationError{Err: err} 2783 } 2784 2785 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2786 return out, metadata, &smithy.SerializationError{Err: err} 2787 } 2788 in.Request = request 2789 2790 return next.HandleSerialize(ctx, in) 2791} 2792func awsRestxml_serializeOpHttpBindingsGetBucketMetricsConfigurationInput(v *GetBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error { 2793 if v == nil { 2794 return fmt.Errorf("unsupported serialization of nil %T", v) 2795 } 2796 2797 if v.Bucket == nil || len(*v.Bucket) == 0 { 2798 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2799 } 2800 if v.Bucket != nil { 2801 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2802 return err 2803 } 2804 } 2805 2806 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2807 locationName := "X-Amz-Expected-Bucket-Owner" 2808 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2809 } 2810 2811 if v.Id != nil { 2812 encoder.SetQuery("id").String(*v.Id) 2813 } 2814 2815 return nil 2816} 2817 2818type awsRestxml_serializeOpGetBucketNotificationConfiguration struct { 2819} 2820 2821func (*awsRestxml_serializeOpGetBucketNotificationConfiguration) ID() string { 2822 return "OperationSerializer" 2823} 2824 2825func (m *awsRestxml_serializeOpGetBucketNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2826 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2827) { 2828 request, ok := in.Request.(*smithyhttp.Request) 2829 if !ok { 2830 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2831 } 2832 2833 input, ok := in.Parameters.(*GetBucketNotificationConfigurationInput) 2834 _ = input 2835 if !ok { 2836 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2837 } 2838 2839 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?notification") 2840 request.URL.Path = opPath 2841 if len(request.URL.RawQuery) > 0 { 2842 request.URL.RawQuery = "&" + opQuery 2843 } else { 2844 request.URL.RawQuery = opQuery 2845 } 2846 2847 request.Method = "GET" 2848 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2849 if err != nil { 2850 return out, metadata, &smithy.SerializationError{Err: err} 2851 } 2852 2853 if err := awsRestxml_serializeOpHttpBindingsGetBucketNotificationConfigurationInput(input, restEncoder); err != nil { 2854 return out, metadata, &smithy.SerializationError{Err: err} 2855 } 2856 2857 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2858 return out, metadata, &smithy.SerializationError{Err: err} 2859 } 2860 in.Request = request 2861 2862 return next.HandleSerialize(ctx, in) 2863} 2864func awsRestxml_serializeOpHttpBindingsGetBucketNotificationConfigurationInput(v *GetBucketNotificationConfigurationInput, encoder *httpbinding.Encoder) error { 2865 if v == nil { 2866 return fmt.Errorf("unsupported serialization of nil %T", v) 2867 } 2868 2869 if v.Bucket == nil || len(*v.Bucket) == 0 { 2870 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2871 } 2872 if v.Bucket != nil { 2873 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2874 return err 2875 } 2876 } 2877 2878 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2879 locationName := "X-Amz-Expected-Bucket-Owner" 2880 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2881 } 2882 2883 return nil 2884} 2885 2886type awsRestxml_serializeOpGetBucketOwnershipControls struct { 2887} 2888 2889func (*awsRestxml_serializeOpGetBucketOwnershipControls) ID() string { 2890 return "OperationSerializer" 2891} 2892 2893func (m *awsRestxml_serializeOpGetBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2894 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2895) { 2896 request, ok := in.Request.(*smithyhttp.Request) 2897 if !ok { 2898 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2899 } 2900 2901 input, ok := in.Parameters.(*GetBucketOwnershipControlsInput) 2902 _ = input 2903 if !ok { 2904 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2905 } 2906 2907 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?ownershipControls") 2908 request.URL.Path = opPath 2909 if len(request.URL.RawQuery) > 0 { 2910 request.URL.RawQuery = "&" + opQuery 2911 } else { 2912 request.URL.RawQuery = opQuery 2913 } 2914 2915 request.Method = "GET" 2916 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2917 if err != nil { 2918 return out, metadata, &smithy.SerializationError{Err: err} 2919 } 2920 2921 if err := awsRestxml_serializeOpHttpBindingsGetBucketOwnershipControlsInput(input, restEncoder); err != nil { 2922 return out, metadata, &smithy.SerializationError{Err: err} 2923 } 2924 2925 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2926 return out, metadata, &smithy.SerializationError{Err: err} 2927 } 2928 in.Request = request 2929 2930 return next.HandleSerialize(ctx, in) 2931} 2932func awsRestxml_serializeOpHttpBindingsGetBucketOwnershipControlsInput(v *GetBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error { 2933 if v == nil { 2934 return fmt.Errorf("unsupported serialization of nil %T", v) 2935 } 2936 2937 if v.Bucket == nil || len(*v.Bucket) == 0 { 2938 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 2939 } 2940 if v.Bucket != nil { 2941 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 2942 return err 2943 } 2944 } 2945 2946 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 2947 locationName := "X-Amz-Expected-Bucket-Owner" 2948 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 2949 } 2950 2951 return nil 2952} 2953 2954type awsRestxml_serializeOpGetBucketPolicy struct { 2955} 2956 2957func (*awsRestxml_serializeOpGetBucketPolicy) ID() string { 2958 return "OperationSerializer" 2959} 2960 2961func (m *awsRestxml_serializeOpGetBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 2962 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 2963) { 2964 request, ok := in.Request.(*smithyhttp.Request) 2965 if !ok { 2966 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 2967 } 2968 2969 input, ok := in.Parameters.(*GetBucketPolicyInput) 2970 _ = input 2971 if !ok { 2972 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 2973 } 2974 2975 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?policy") 2976 request.URL.Path = opPath 2977 if len(request.URL.RawQuery) > 0 { 2978 request.URL.RawQuery = "&" + opQuery 2979 } else { 2980 request.URL.RawQuery = opQuery 2981 } 2982 2983 request.Method = "GET" 2984 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 2985 if err != nil { 2986 return out, metadata, &smithy.SerializationError{Err: err} 2987 } 2988 2989 if err := awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(input, restEncoder); err != nil { 2990 return out, metadata, &smithy.SerializationError{Err: err} 2991 } 2992 2993 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 2994 return out, metadata, &smithy.SerializationError{Err: err} 2995 } 2996 in.Request = request 2997 2998 return next.HandleSerialize(ctx, in) 2999} 3000func awsRestxml_serializeOpHttpBindingsGetBucketPolicyInput(v *GetBucketPolicyInput, encoder *httpbinding.Encoder) error { 3001 if v == nil { 3002 return fmt.Errorf("unsupported serialization of nil %T", v) 3003 } 3004 3005 if v.Bucket == nil || len(*v.Bucket) == 0 { 3006 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3007 } 3008 if v.Bucket != nil { 3009 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3010 return err 3011 } 3012 } 3013 3014 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3015 locationName := "X-Amz-Expected-Bucket-Owner" 3016 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3017 } 3018 3019 return nil 3020} 3021 3022type awsRestxml_serializeOpGetBucketPolicyStatus struct { 3023} 3024 3025func (*awsRestxml_serializeOpGetBucketPolicyStatus) ID() string { 3026 return "OperationSerializer" 3027} 3028 3029func (m *awsRestxml_serializeOpGetBucketPolicyStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3030 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3031) { 3032 request, ok := in.Request.(*smithyhttp.Request) 3033 if !ok { 3034 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3035 } 3036 3037 input, ok := in.Parameters.(*GetBucketPolicyStatusInput) 3038 _ = input 3039 if !ok { 3040 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3041 } 3042 3043 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?policyStatus") 3044 request.URL.Path = opPath 3045 if len(request.URL.RawQuery) > 0 { 3046 request.URL.RawQuery = "&" + opQuery 3047 } else { 3048 request.URL.RawQuery = opQuery 3049 } 3050 3051 request.Method = "GET" 3052 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3053 if err != nil { 3054 return out, metadata, &smithy.SerializationError{Err: err} 3055 } 3056 3057 if err := awsRestxml_serializeOpHttpBindingsGetBucketPolicyStatusInput(input, restEncoder); err != nil { 3058 return out, metadata, &smithy.SerializationError{Err: err} 3059 } 3060 3061 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3062 return out, metadata, &smithy.SerializationError{Err: err} 3063 } 3064 in.Request = request 3065 3066 return next.HandleSerialize(ctx, in) 3067} 3068func awsRestxml_serializeOpHttpBindingsGetBucketPolicyStatusInput(v *GetBucketPolicyStatusInput, encoder *httpbinding.Encoder) error { 3069 if v == nil { 3070 return fmt.Errorf("unsupported serialization of nil %T", v) 3071 } 3072 3073 if v.Bucket == nil || len(*v.Bucket) == 0 { 3074 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3075 } 3076 if v.Bucket != nil { 3077 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3078 return err 3079 } 3080 } 3081 3082 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3083 locationName := "X-Amz-Expected-Bucket-Owner" 3084 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3085 } 3086 3087 return nil 3088} 3089 3090type awsRestxml_serializeOpGetBucketReplication struct { 3091} 3092 3093func (*awsRestxml_serializeOpGetBucketReplication) ID() string { 3094 return "OperationSerializer" 3095} 3096 3097func (m *awsRestxml_serializeOpGetBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3098 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3099) { 3100 request, ok := in.Request.(*smithyhttp.Request) 3101 if !ok { 3102 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3103 } 3104 3105 input, ok := in.Parameters.(*GetBucketReplicationInput) 3106 _ = input 3107 if !ok { 3108 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3109 } 3110 3111 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?replication") 3112 request.URL.Path = opPath 3113 if len(request.URL.RawQuery) > 0 { 3114 request.URL.RawQuery = "&" + opQuery 3115 } else { 3116 request.URL.RawQuery = opQuery 3117 } 3118 3119 request.Method = "GET" 3120 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3121 if err != nil { 3122 return out, metadata, &smithy.SerializationError{Err: err} 3123 } 3124 3125 if err := awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(input, restEncoder); err != nil { 3126 return out, metadata, &smithy.SerializationError{Err: err} 3127 } 3128 3129 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3130 return out, metadata, &smithy.SerializationError{Err: err} 3131 } 3132 in.Request = request 3133 3134 return next.HandleSerialize(ctx, in) 3135} 3136func awsRestxml_serializeOpHttpBindingsGetBucketReplicationInput(v *GetBucketReplicationInput, encoder *httpbinding.Encoder) error { 3137 if v == nil { 3138 return fmt.Errorf("unsupported serialization of nil %T", v) 3139 } 3140 3141 if v.Bucket == nil || len(*v.Bucket) == 0 { 3142 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3143 } 3144 if v.Bucket != nil { 3145 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3146 return err 3147 } 3148 } 3149 3150 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3151 locationName := "X-Amz-Expected-Bucket-Owner" 3152 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3153 } 3154 3155 return nil 3156} 3157 3158type awsRestxml_serializeOpGetBucketRequestPayment struct { 3159} 3160 3161func (*awsRestxml_serializeOpGetBucketRequestPayment) ID() string { 3162 return "OperationSerializer" 3163} 3164 3165func (m *awsRestxml_serializeOpGetBucketRequestPayment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3166 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3167) { 3168 request, ok := in.Request.(*smithyhttp.Request) 3169 if !ok { 3170 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3171 } 3172 3173 input, ok := in.Parameters.(*GetBucketRequestPaymentInput) 3174 _ = input 3175 if !ok { 3176 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3177 } 3178 3179 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?requestPayment") 3180 request.URL.Path = opPath 3181 if len(request.URL.RawQuery) > 0 { 3182 request.URL.RawQuery = "&" + opQuery 3183 } else { 3184 request.URL.RawQuery = opQuery 3185 } 3186 3187 request.Method = "GET" 3188 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3189 if err != nil { 3190 return out, metadata, &smithy.SerializationError{Err: err} 3191 } 3192 3193 if err := awsRestxml_serializeOpHttpBindingsGetBucketRequestPaymentInput(input, restEncoder); err != nil { 3194 return out, metadata, &smithy.SerializationError{Err: err} 3195 } 3196 3197 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3198 return out, metadata, &smithy.SerializationError{Err: err} 3199 } 3200 in.Request = request 3201 3202 return next.HandleSerialize(ctx, in) 3203} 3204func awsRestxml_serializeOpHttpBindingsGetBucketRequestPaymentInput(v *GetBucketRequestPaymentInput, encoder *httpbinding.Encoder) error { 3205 if v == nil { 3206 return fmt.Errorf("unsupported serialization of nil %T", v) 3207 } 3208 3209 if v.Bucket == nil || len(*v.Bucket) == 0 { 3210 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3211 } 3212 if v.Bucket != nil { 3213 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3214 return err 3215 } 3216 } 3217 3218 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3219 locationName := "X-Amz-Expected-Bucket-Owner" 3220 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3221 } 3222 3223 return nil 3224} 3225 3226type awsRestxml_serializeOpGetBucketTagging struct { 3227} 3228 3229func (*awsRestxml_serializeOpGetBucketTagging) ID() string { 3230 return "OperationSerializer" 3231} 3232 3233func (m *awsRestxml_serializeOpGetBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3234 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3235) { 3236 request, ok := in.Request.(*smithyhttp.Request) 3237 if !ok { 3238 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3239 } 3240 3241 input, ok := in.Parameters.(*GetBucketTaggingInput) 3242 _ = input 3243 if !ok { 3244 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3245 } 3246 3247 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?tagging") 3248 request.URL.Path = opPath 3249 if len(request.URL.RawQuery) > 0 { 3250 request.URL.RawQuery = "&" + opQuery 3251 } else { 3252 request.URL.RawQuery = opQuery 3253 } 3254 3255 request.Method = "GET" 3256 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3257 if err != nil { 3258 return out, metadata, &smithy.SerializationError{Err: err} 3259 } 3260 3261 if err := awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(input, restEncoder); err != nil { 3262 return out, metadata, &smithy.SerializationError{Err: err} 3263 } 3264 3265 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3266 return out, metadata, &smithy.SerializationError{Err: err} 3267 } 3268 in.Request = request 3269 3270 return next.HandleSerialize(ctx, in) 3271} 3272func awsRestxml_serializeOpHttpBindingsGetBucketTaggingInput(v *GetBucketTaggingInput, encoder *httpbinding.Encoder) error { 3273 if v == nil { 3274 return fmt.Errorf("unsupported serialization of nil %T", v) 3275 } 3276 3277 if v.Bucket == nil || len(*v.Bucket) == 0 { 3278 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3279 } 3280 if v.Bucket != nil { 3281 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3282 return err 3283 } 3284 } 3285 3286 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3287 locationName := "X-Amz-Expected-Bucket-Owner" 3288 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3289 } 3290 3291 return nil 3292} 3293 3294type awsRestxml_serializeOpGetBucketVersioning struct { 3295} 3296 3297func (*awsRestxml_serializeOpGetBucketVersioning) ID() string { 3298 return "OperationSerializer" 3299} 3300 3301func (m *awsRestxml_serializeOpGetBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3302 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3303) { 3304 request, ok := in.Request.(*smithyhttp.Request) 3305 if !ok { 3306 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3307 } 3308 3309 input, ok := in.Parameters.(*GetBucketVersioningInput) 3310 _ = input 3311 if !ok { 3312 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3313 } 3314 3315 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?versioning") 3316 request.URL.Path = opPath 3317 if len(request.URL.RawQuery) > 0 { 3318 request.URL.RawQuery = "&" + opQuery 3319 } else { 3320 request.URL.RawQuery = opQuery 3321 } 3322 3323 request.Method = "GET" 3324 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3325 if err != nil { 3326 return out, metadata, &smithy.SerializationError{Err: err} 3327 } 3328 3329 if err := awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(input, restEncoder); err != nil { 3330 return out, metadata, &smithy.SerializationError{Err: err} 3331 } 3332 3333 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3334 return out, metadata, &smithy.SerializationError{Err: err} 3335 } 3336 in.Request = request 3337 3338 return next.HandleSerialize(ctx, in) 3339} 3340func awsRestxml_serializeOpHttpBindingsGetBucketVersioningInput(v *GetBucketVersioningInput, encoder *httpbinding.Encoder) error { 3341 if v == nil { 3342 return fmt.Errorf("unsupported serialization of nil %T", v) 3343 } 3344 3345 if v.Bucket == nil || len(*v.Bucket) == 0 { 3346 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3347 } 3348 if v.Bucket != nil { 3349 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3350 return err 3351 } 3352 } 3353 3354 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3355 locationName := "X-Amz-Expected-Bucket-Owner" 3356 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3357 } 3358 3359 return nil 3360} 3361 3362type awsRestxml_serializeOpGetBucketWebsite struct { 3363} 3364 3365func (*awsRestxml_serializeOpGetBucketWebsite) ID() string { 3366 return "OperationSerializer" 3367} 3368 3369func (m *awsRestxml_serializeOpGetBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3370 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3371) { 3372 request, ok := in.Request.(*smithyhttp.Request) 3373 if !ok { 3374 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3375 } 3376 3377 input, ok := in.Parameters.(*GetBucketWebsiteInput) 3378 _ = input 3379 if !ok { 3380 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3381 } 3382 3383 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?website") 3384 request.URL.Path = opPath 3385 if len(request.URL.RawQuery) > 0 { 3386 request.URL.RawQuery = "&" + opQuery 3387 } else { 3388 request.URL.RawQuery = opQuery 3389 } 3390 3391 request.Method = "GET" 3392 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3393 if err != nil { 3394 return out, metadata, &smithy.SerializationError{Err: err} 3395 } 3396 3397 if err := awsRestxml_serializeOpHttpBindingsGetBucketWebsiteInput(input, restEncoder); err != nil { 3398 return out, metadata, &smithy.SerializationError{Err: err} 3399 } 3400 3401 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3402 return out, metadata, &smithy.SerializationError{Err: err} 3403 } 3404 in.Request = request 3405 3406 return next.HandleSerialize(ctx, in) 3407} 3408func awsRestxml_serializeOpHttpBindingsGetBucketWebsiteInput(v *GetBucketWebsiteInput, encoder *httpbinding.Encoder) error { 3409 if v == nil { 3410 return fmt.Errorf("unsupported serialization of nil %T", v) 3411 } 3412 3413 if v.Bucket == nil || len(*v.Bucket) == 0 { 3414 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3415 } 3416 if v.Bucket != nil { 3417 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3418 return err 3419 } 3420 } 3421 3422 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3423 locationName := "X-Amz-Expected-Bucket-Owner" 3424 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3425 } 3426 3427 return nil 3428} 3429 3430type awsRestxml_serializeOpGetObject struct { 3431} 3432 3433func (*awsRestxml_serializeOpGetObject) ID() string { 3434 return "OperationSerializer" 3435} 3436 3437func (m *awsRestxml_serializeOpGetObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3438 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3439) { 3440 request, ok := in.Request.(*smithyhttp.Request) 3441 if !ok { 3442 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3443 } 3444 3445 input, ok := in.Parameters.(*GetObjectInput) 3446 _ = input 3447 if !ok { 3448 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3449 } 3450 3451 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=GetObject") 3452 request.URL.Path = opPath 3453 if len(request.URL.RawQuery) > 0 { 3454 request.URL.RawQuery = "&" + opQuery 3455 } else { 3456 request.URL.RawQuery = opQuery 3457 } 3458 3459 request.Method = "GET" 3460 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3461 if err != nil { 3462 return out, metadata, &smithy.SerializationError{Err: err} 3463 } 3464 3465 if err := awsRestxml_serializeOpHttpBindingsGetObjectInput(input, restEncoder); err != nil { 3466 return out, metadata, &smithy.SerializationError{Err: err} 3467 } 3468 3469 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3470 return out, metadata, &smithy.SerializationError{Err: err} 3471 } 3472 in.Request = request 3473 3474 return next.HandleSerialize(ctx, in) 3475} 3476func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder *httpbinding.Encoder) error { 3477 if v == nil { 3478 return fmt.Errorf("unsupported serialization of nil %T", v) 3479 } 3480 3481 if v.Bucket == nil || len(*v.Bucket) == 0 { 3482 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3483 } 3484 if v.Bucket != nil { 3485 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3486 return err 3487 } 3488 } 3489 3490 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3491 locationName := "X-Amz-Expected-Bucket-Owner" 3492 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3493 } 3494 3495 if v.IfMatch != nil && len(*v.IfMatch) > 0 { 3496 locationName := "If-Match" 3497 encoder.SetHeader(locationName).String(*v.IfMatch) 3498 } 3499 3500 if v.IfModifiedSince != nil { 3501 locationName := "If-Modified-Since" 3502 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfModifiedSince)) 3503 } 3504 3505 if v.IfNoneMatch != nil && len(*v.IfNoneMatch) > 0 { 3506 locationName := "If-None-Match" 3507 encoder.SetHeader(locationName).String(*v.IfNoneMatch) 3508 } 3509 3510 if v.IfUnmodifiedSince != nil { 3511 locationName := "If-Unmodified-Since" 3512 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfUnmodifiedSince)) 3513 } 3514 3515 if v.Key == nil || len(*v.Key) == 0 { 3516 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 3517 } 3518 if v.Key != nil { 3519 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 3520 return err 3521 } 3522 } 3523 3524 if v.PartNumber != 0 { 3525 encoder.SetQuery("partNumber").Integer(v.PartNumber) 3526 } 3527 3528 if v.Range != nil && len(*v.Range) > 0 { 3529 locationName := "Range" 3530 encoder.SetHeader(locationName).String(*v.Range) 3531 } 3532 3533 if len(v.RequestPayer) > 0 { 3534 locationName := "X-Amz-Request-Payer" 3535 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 3536 } 3537 3538 if v.ResponseCacheControl != nil { 3539 encoder.SetQuery("response-cache-control").String(*v.ResponseCacheControl) 3540 } 3541 3542 if v.ResponseContentDisposition != nil { 3543 encoder.SetQuery("response-content-disposition").String(*v.ResponseContentDisposition) 3544 } 3545 3546 if v.ResponseContentEncoding != nil { 3547 encoder.SetQuery("response-content-encoding").String(*v.ResponseContentEncoding) 3548 } 3549 3550 if v.ResponseContentLanguage != nil { 3551 encoder.SetQuery("response-content-language").String(*v.ResponseContentLanguage) 3552 } 3553 3554 if v.ResponseContentType != nil { 3555 encoder.SetQuery("response-content-type").String(*v.ResponseContentType) 3556 } 3557 3558 if v.ResponseExpires != nil { 3559 encoder.SetQuery("response-expires").String(smithytime.FormatHTTPDate(*v.ResponseExpires)) 3560 } 3561 3562 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 3563 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 3564 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 3565 } 3566 3567 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 3568 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 3569 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 3570 } 3571 3572 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 3573 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 3574 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 3575 } 3576 3577 if v.VersionId != nil { 3578 encoder.SetQuery("versionId").String(*v.VersionId) 3579 } 3580 3581 return nil 3582} 3583 3584type awsRestxml_serializeOpGetObjectAcl struct { 3585} 3586 3587func (*awsRestxml_serializeOpGetObjectAcl) ID() string { 3588 return "OperationSerializer" 3589} 3590 3591func (m *awsRestxml_serializeOpGetObjectAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3592 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3593) { 3594 request, ok := in.Request.(*smithyhttp.Request) 3595 if !ok { 3596 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3597 } 3598 3599 input, ok := in.Parameters.(*GetObjectAclInput) 3600 _ = input 3601 if !ok { 3602 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3603 } 3604 3605 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?acl") 3606 request.URL.Path = opPath 3607 if len(request.URL.RawQuery) > 0 { 3608 request.URL.RawQuery = "&" + opQuery 3609 } else { 3610 request.URL.RawQuery = opQuery 3611 } 3612 3613 request.Method = "GET" 3614 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3615 if err != nil { 3616 return out, metadata, &smithy.SerializationError{Err: err} 3617 } 3618 3619 if err := awsRestxml_serializeOpHttpBindingsGetObjectAclInput(input, restEncoder); err != nil { 3620 return out, metadata, &smithy.SerializationError{Err: err} 3621 } 3622 3623 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3624 return out, metadata, &smithy.SerializationError{Err: err} 3625 } 3626 in.Request = request 3627 3628 return next.HandleSerialize(ctx, in) 3629} 3630func awsRestxml_serializeOpHttpBindingsGetObjectAclInput(v *GetObjectAclInput, encoder *httpbinding.Encoder) error { 3631 if v == nil { 3632 return fmt.Errorf("unsupported serialization of nil %T", v) 3633 } 3634 3635 if v.Bucket == nil || len(*v.Bucket) == 0 { 3636 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3637 } 3638 if v.Bucket != nil { 3639 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3640 return err 3641 } 3642 } 3643 3644 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3645 locationName := "X-Amz-Expected-Bucket-Owner" 3646 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3647 } 3648 3649 if v.Key == nil || len(*v.Key) == 0 { 3650 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 3651 } 3652 if v.Key != nil { 3653 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 3654 return err 3655 } 3656 } 3657 3658 if len(v.RequestPayer) > 0 { 3659 locationName := "X-Amz-Request-Payer" 3660 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 3661 } 3662 3663 if v.VersionId != nil { 3664 encoder.SetQuery("versionId").String(*v.VersionId) 3665 } 3666 3667 return nil 3668} 3669 3670type awsRestxml_serializeOpGetObjectLegalHold struct { 3671} 3672 3673func (*awsRestxml_serializeOpGetObjectLegalHold) ID() string { 3674 return "OperationSerializer" 3675} 3676 3677func (m *awsRestxml_serializeOpGetObjectLegalHold) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3678 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3679) { 3680 request, ok := in.Request.(*smithyhttp.Request) 3681 if !ok { 3682 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3683 } 3684 3685 input, ok := in.Parameters.(*GetObjectLegalHoldInput) 3686 _ = input 3687 if !ok { 3688 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3689 } 3690 3691 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?legal-hold") 3692 request.URL.Path = opPath 3693 if len(request.URL.RawQuery) > 0 { 3694 request.URL.RawQuery = "&" + opQuery 3695 } else { 3696 request.URL.RawQuery = opQuery 3697 } 3698 3699 request.Method = "GET" 3700 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3701 if err != nil { 3702 return out, metadata, &smithy.SerializationError{Err: err} 3703 } 3704 3705 if err := awsRestxml_serializeOpHttpBindingsGetObjectLegalHoldInput(input, restEncoder); err != nil { 3706 return out, metadata, &smithy.SerializationError{Err: err} 3707 } 3708 3709 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3710 return out, metadata, &smithy.SerializationError{Err: err} 3711 } 3712 in.Request = request 3713 3714 return next.HandleSerialize(ctx, in) 3715} 3716func awsRestxml_serializeOpHttpBindingsGetObjectLegalHoldInput(v *GetObjectLegalHoldInput, encoder *httpbinding.Encoder) error { 3717 if v == nil { 3718 return fmt.Errorf("unsupported serialization of nil %T", v) 3719 } 3720 3721 if v.Bucket == nil || len(*v.Bucket) == 0 { 3722 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3723 } 3724 if v.Bucket != nil { 3725 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3726 return err 3727 } 3728 } 3729 3730 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3731 locationName := "X-Amz-Expected-Bucket-Owner" 3732 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3733 } 3734 3735 if v.Key == nil || len(*v.Key) == 0 { 3736 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 3737 } 3738 if v.Key != nil { 3739 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 3740 return err 3741 } 3742 } 3743 3744 if len(v.RequestPayer) > 0 { 3745 locationName := "X-Amz-Request-Payer" 3746 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 3747 } 3748 3749 if v.VersionId != nil { 3750 encoder.SetQuery("versionId").String(*v.VersionId) 3751 } 3752 3753 return nil 3754} 3755 3756type awsRestxml_serializeOpGetObjectLockConfiguration struct { 3757} 3758 3759func (*awsRestxml_serializeOpGetObjectLockConfiguration) ID() string { 3760 return "OperationSerializer" 3761} 3762 3763func (m *awsRestxml_serializeOpGetObjectLockConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3764 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3765) { 3766 request, ok := in.Request.(*smithyhttp.Request) 3767 if !ok { 3768 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3769 } 3770 3771 input, ok := in.Parameters.(*GetObjectLockConfigurationInput) 3772 _ = input 3773 if !ok { 3774 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3775 } 3776 3777 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?object-lock") 3778 request.URL.Path = opPath 3779 if len(request.URL.RawQuery) > 0 { 3780 request.URL.RawQuery = "&" + opQuery 3781 } else { 3782 request.URL.RawQuery = opQuery 3783 } 3784 3785 request.Method = "GET" 3786 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3787 if err != nil { 3788 return out, metadata, &smithy.SerializationError{Err: err} 3789 } 3790 3791 if err := awsRestxml_serializeOpHttpBindingsGetObjectLockConfigurationInput(input, restEncoder); err != nil { 3792 return out, metadata, &smithy.SerializationError{Err: err} 3793 } 3794 3795 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3796 return out, metadata, &smithy.SerializationError{Err: err} 3797 } 3798 in.Request = request 3799 3800 return next.HandleSerialize(ctx, in) 3801} 3802func awsRestxml_serializeOpHttpBindingsGetObjectLockConfigurationInput(v *GetObjectLockConfigurationInput, encoder *httpbinding.Encoder) error { 3803 if v == nil { 3804 return fmt.Errorf("unsupported serialization of nil %T", v) 3805 } 3806 3807 if v.Bucket == nil || len(*v.Bucket) == 0 { 3808 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3809 } 3810 if v.Bucket != nil { 3811 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3812 return err 3813 } 3814 } 3815 3816 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3817 locationName := "X-Amz-Expected-Bucket-Owner" 3818 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3819 } 3820 3821 return nil 3822} 3823 3824type awsRestxml_serializeOpGetObjectRetention struct { 3825} 3826 3827func (*awsRestxml_serializeOpGetObjectRetention) ID() string { 3828 return "OperationSerializer" 3829} 3830 3831func (m *awsRestxml_serializeOpGetObjectRetention) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3832 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3833) { 3834 request, ok := in.Request.(*smithyhttp.Request) 3835 if !ok { 3836 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3837 } 3838 3839 input, ok := in.Parameters.(*GetObjectRetentionInput) 3840 _ = input 3841 if !ok { 3842 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3843 } 3844 3845 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?retention") 3846 request.URL.Path = opPath 3847 if len(request.URL.RawQuery) > 0 { 3848 request.URL.RawQuery = "&" + opQuery 3849 } else { 3850 request.URL.RawQuery = opQuery 3851 } 3852 3853 request.Method = "GET" 3854 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3855 if err != nil { 3856 return out, metadata, &smithy.SerializationError{Err: err} 3857 } 3858 3859 if err := awsRestxml_serializeOpHttpBindingsGetObjectRetentionInput(input, restEncoder); err != nil { 3860 return out, metadata, &smithy.SerializationError{Err: err} 3861 } 3862 3863 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3864 return out, metadata, &smithy.SerializationError{Err: err} 3865 } 3866 in.Request = request 3867 3868 return next.HandleSerialize(ctx, in) 3869} 3870func awsRestxml_serializeOpHttpBindingsGetObjectRetentionInput(v *GetObjectRetentionInput, encoder *httpbinding.Encoder) error { 3871 if v == nil { 3872 return fmt.Errorf("unsupported serialization of nil %T", v) 3873 } 3874 3875 if v.Bucket == nil || len(*v.Bucket) == 0 { 3876 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3877 } 3878 if v.Bucket != nil { 3879 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3880 return err 3881 } 3882 } 3883 3884 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3885 locationName := "X-Amz-Expected-Bucket-Owner" 3886 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3887 } 3888 3889 if v.Key == nil || len(*v.Key) == 0 { 3890 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 3891 } 3892 if v.Key != nil { 3893 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 3894 return err 3895 } 3896 } 3897 3898 if len(v.RequestPayer) > 0 { 3899 locationName := "X-Amz-Request-Payer" 3900 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 3901 } 3902 3903 if v.VersionId != nil { 3904 encoder.SetQuery("versionId").String(*v.VersionId) 3905 } 3906 3907 return nil 3908} 3909 3910type awsRestxml_serializeOpGetObjectTagging struct { 3911} 3912 3913func (*awsRestxml_serializeOpGetObjectTagging) ID() string { 3914 return "OperationSerializer" 3915} 3916 3917func (m *awsRestxml_serializeOpGetObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3918 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 3919) { 3920 request, ok := in.Request.(*smithyhttp.Request) 3921 if !ok { 3922 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 3923 } 3924 3925 input, ok := in.Parameters.(*GetObjectTaggingInput) 3926 _ = input 3927 if !ok { 3928 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 3929 } 3930 3931 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?tagging") 3932 request.URL.Path = opPath 3933 if len(request.URL.RawQuery) > 0 { 3934 request.URL.RawQuery = "&" + opQuery 3935 } else { 3936 request.URL.RawQuery = opQuery 3937 } 3938 3939 request.Method = "GET" 3940 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 3941 if err != nil { 3942 return out, metadata, &smithy.SerializationError{Err: err} 3943 } 3944 3945 if err := awsRestxml_serializeOpHttpBindingsGetObjectTaggingInput(input, restEncoder); err != nil { 3946 return out, metadata, &smithy.SerializationError{Err: err} 3947 } 3948 3949 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 3950 return out, metadata, &smithy.SerializationError{Err: err} 3951 } 3952 in.Request = request 3953 3954 return next.HandleSerialize(ctx, in) 3955} 3956func awsRestxml_serializeOpHttpBindingsGetObjectTaggingInput(v *GetObjectTaggingInput, encoder *httpbinding.Encoder) error { 3957 if v == nil { 3958 return fmt.Errorf("unsupported serialization of nil %T", v) 3959 } 3960 3961 if v.Bucket == nil || len(*v.Bucket) == 0 { 3962 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 3963 } 3964 if v.Bucket != nil { 3965 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 3966 return err 3967 } 3968 } 3969 3970 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 3971 locationName := "X-Amz-Expected-Bucket-Owner" 3972 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 3973 } 3974 3975 if v.Key == nil || len(*v.Key) == 0 { 3976 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 3977 } 3978 if v.Key != nil { 3979 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 3980 return err 3981 } 3982 } 3983 3984 if v.VersionId != nil { 3985 encoder.SetQuery("versionId").String(*v.VersionId) 3986 } 3987 3988 return nil 3989} 3990 3991type awsRestxml_serializeOpGetObjectTorrent struct { 3992} 3993 3994func (*awsRestxml_serializeOpGetObjectTorrent) ID() string { 3995 return "OperationSerializer" 3996} 3997 3998func (m *awsRestxml_serializeOpGetObjectTorrent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 3999 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4000) { 4001 request, ok := in.Request.(*smithyhttp.Request) 4002 if !ok { 4003 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4004 } 4005 4006 input, ok := in.Parameters.(*GetObjectTorrentInput) 4007 _ = input 4008 if !ok { 4009 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4010 } 4011 4012 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?torrent") 4013 request.URL.Path = opPath 4014 if len(request.URL.RawQuery) > 0 { 4015 request.URL.RawQuery = "&" + opQuery 4016 } else { 4017 request.URL.RawQuery = opQuery 4018 } 4019 4020 request.Method = "GET" 4021 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4022 if err != nil { 4023 return out, metadata, &smithy.SerializationError{Err: err} 4024 } 4025 4026 if err := awsRestxml_serializeOpHttpBindingsGetObjectTorrentInput(input, restEncoder); err != nil { 4027 return out, metadata, &smithy.SerializationError{Err: err} 4028 } 4029 4030 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4031 return out, metadata, &smithy.SerializationError{Err: err} 4032 } 4033 in.Request = request 4034 4035 return next.HandleSerialize(ctx, in) 4036} 4037func awsRestxml_serializeOpHttpBindingsGetObjectTorrentInput(v *GetObjectTorrentInput, encoder *httpbinding.Encoder) error { 4038 if v == nil { 4039 return fmt.Errorf("unsupported serialization of nil %T", v) 4040 } 4041 4042 if v.Bucket == nil || len(*v.Bucket) == 0 { 4043 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4044 } 4045 if v.Bucket != nil { 4046 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4047 return err 4048 } 4049 } 4050 4051 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4052 locationName := "X-Amz-Expected-Bucket-Owner" 4053 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4054 } 4055 4056 if v.Key == nil || len(*v.Key) == 0 { 4057 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 4058 } 4059 if v.Key != nil { 4060 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 4061 return err 4062 } 4063 } 4064 4065 if len(v.RequestPayer) > 0 { 4066 locationName := "X-Amz-Request-Payer" 4067 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 4068 } 4069 4070 return nil 4071} 4072 4073type awsRestxml_serializeOpGetPublicAccessBlock struct { 4074} 4075 4076func (*awsRestxml_serializeOpGetPublicAccessBlock) ID() string { 4077 return "OperationSerializer" 4078} 4079 4080func (m *awsRestxml_serializeOpGetPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4081 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4082) { 4083 request, ok := in.Request.(*smithyhttp.Request) 4084 if !ok { 4085 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4086 } 4087 4088 input, ok := in.Parameters.(*GetPublicAccessBlockInput) 4089 _ = input 4090 if !ok { 4091 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4092 } 4093 4094 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?publicAccessBlock") 4095 request.URL.Path = opPath 4096 if len(request.URL.RawQuery) > 0 { 4097 request.URL.RawQuery = "&" + opQuery 4098 } else { 4099 request.URL.RawQuery = opQuery 4100 } 4101 4102 request.Method = "GET" 4103 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4104 if err != nil { 4105 return out, metadata, &smithy.SerializationError{Err: err} 4106 } 4107 4108 if err := awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(input, restEncoder); err != nil { 4109 return out, metadata, &smithy.SerializationError{Err: err} 4110 } 4111 4112 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4113 return out, metadata, &smithy.SerializationError{Err: err} 4114 } 4115 in.Request = request 4116 4117 return next.HandleSerialize(ctx, in) 4118} 4119func awsRestxml_serializeOpHttpBindingsGetPublicAccessBlockInput(v *GetPublicAccessBlockInput, encoder *httpbinding.Encoder) error { 4120 if v == nil { 4121 return fmt.Errorf("unsupported serialization of nil %T", v) 4122 } 4123 4124 if v.Bucket == nil || len(*v.Bucket) == 0 { 4125 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4126 } 4127 if v.Bucket != nil { 4128 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4129 return err 4130 } 4131 } 4132 4133 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4134 locationName := "X-Amz-Expected-Bucket-Owner" 4135 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4136 } 4137 4138 return nil 4139} 4140 4141type awsRestxml_serializeOpHeadBucket struct { 4142} 4143 4144func (*awsRestxml_serializeOpHeadBucket) ID() string { 4145 return "OperationSerializer" 4146} 4147 4148func (m *awsRestxml_serializeOpHeadBucket) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4149 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4150) { 4151 request, ok := in.Request.(*smithyhttp.Request) 4152 if !ok { 4153 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4154 } 4155 4156 input, ok := in.Parameters.(*HeadBucketInput) 4157 _ = input 4158 if !ok { 4159 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4160 } 4161 4162 opPath, opQuery := httpbinding.SplitURI("/{Bucket}") 4163 request.URL.Path = opPath 4164 if len(request.URL.RawQuery) > 0 { 4165 request.URL.RawQuery = "&" + opQuery 4166 } else { 4167 request.URL.RawQuery = opQuery 4168 } 4169 4170 request.Method = "HEAD" 4171 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4172 if err != nil { 4173 return out, metadata, &smithy.SerializationError{Err: err} 4174 } 4175 4176 if err := awsRestxml_serializeOpHttpBindingsHeadBucketInput(input, restEncoder); err != nil { 4177 return out, metadata, &smithy.SerializationError{Err: err} 4178 } 4179 4180 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4181 return out, metadata, &smithy.SerializationError{Err: err} 4182 } 4183 in.Request = request 4184 4185 return next.HandleSerialize(ctx, in) 4186} 4187func awsRestxml_serializeOpHttpBindingsHeadBucketInput(v *HeadBucketInput, encoder *httpbinding.Encoder) error { 4188 if v == nil { 4189 return fmt.Errorf("unsupported serialization of nil %T", v) 4190 } 4191 4192 if v.Bucket == nil || len(*v.Bucket) == 0 { 4193 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4194 } 4195 if v.Bucket != nil { 4196 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4197 return err 4198 } 4199 } 4200 4201 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4202 locationName := "X-Amz-Expected-Bucket-Owner" 4203 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4204 } 4205 4206 return nil 4207} 4208 4209type awsRestxml_serializeOpHeadObject struct { 4210} 4211 4212func (*awsRestxml_serializeOpHeadObject) ID() string { 4213 return "OperationSerializer" 4214} 4215 4216func (m *awsRestxml_serializeOpHeadObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4217 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4218) { 4219 request, ok := in.Request.(*smithyhttp.Request) 4220 if !ok { 4221 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4222 } 4223 4224 input, ok := in.Parameters.(*HeadObjectInput) 4225 _ = input 4226 if !ok { 4227 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4228 } 4229 4230 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}") 4231 request.URL.Path = opPath 4232 if len(request.URL.RawQuery) > 0 { 4233 request.URL.RawQuery = "&" + opQuery 4234 } else { 4235 request.URL.RawQuery = opQuery 4236 } 4237 4238 request.Method = "HEAD" 4239 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4240 if err != nil { 4241 return out, metadata, &smithy.SerializationError{Err: err} 4242 } 4243 4244 if err := awsRestxml_serializeOpHttpBindingsHeadObjectInput(input, restEncoder); err != nil { 4245 return out, metadata, &smithy.SerializationError{Err: err} 4246 } 4247 4248 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4249 return out, metadata, &smithy.SerializationError{Err: err} 4250 } 4251 in.Request = request 4252 4253 return next.HandleSerialize(ctx, in) 4254} 4255func awsRestxml_serializeOpHttpBindingsHeadObjectInput(v *HeadObjectInput, encoder *httpbinding.Encoder) error { 4256 if v == nil { 4257 return fmt.Errorf("unsupported serialization of nil %T", v) 4258 } 4259 4260 if v.Bucket == nil || len(*v.Bucket) == 0 { 4261 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4262 } 4263 if v.Bucket != nil { 4264 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4265 return err 4266 } 4267 } 4268 4269 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4270 locationName := "X-Amz-Expected-Bucket-Owner" 4271 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4272 } 4273 4274 if v.IfMatch != nil && len(*v.IfMatch) > 0 { 4275 locationName := "If-Match" 4276 encoder.SetHeader(locationName).String(*v.IfMatch) 4277 } 4278 4279 if v.IfModifiedSince != nil { 4280 locationName := "If-Modified-Since" 4281 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfModifiedSince)) 4282 } 4283 4284 if v.IfNoneMatch != nil && len(*v.IfNoneMatch) > 0 { 4285 locationName := "If-None-Match" 4286 encoder.SetHeader(locationName).String(*v.IfNoneMatch) 4287 } 4288 4289 if v.IfUnmodifiedSince != nil { 4290 locationName := "If-Unmodified-Since" 4291 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfUnmodifiedSince)) 4292 } 4293 4294 if v.Key == nil || len(*v.Key) == 0 { 4295 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 4296 } 4297 if v.Key != nil { 4298 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 4299 return err 4300 } 4301 } 4302 4303 if v.PartNumber != 0 { 4304 encoder.SetQuery("partNumber").Integer(v.PartNumber) 4305 } 4306 4307 if v.Range != nil && len(*v.Range) > 0 { 4308 locationName := "Range" 4309 encoder.SetHeader(locationName).String(*v.Range) 4310 } 4311 4312 if len(v.RequestPayer) > 0 { 4313 locationName := "X-Amz-Request-Payer" 4314 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 4315 } 4316 4317 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 4318 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 4319 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 4320 } 4321 4322 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 4323 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 4324 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 4325 } 4326 4327 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 4328 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 4329 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 4330 } 4331 4332 if v.VersionId != nil { 4333 encoder.SetQuery("versionId").String(*v.VersionId) 4334 } 4335 4336 return nil 4337} 4338 4339type awsRestxml_serializeOpListBucketAnalyticsConfigurations struct { 4340} 4341 4342func (*awsRestxml_serializeOpListBucketAnalyticsConfigurations) ID() string { 4343 return "OperationSerializer" 4344} 4345 4346func (m *awsRestxml_serializeOpListBucketAnalyticsConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4347 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4348) { 4349 request, ok := in.Request.(*smithyhttp.Request) 4350 if !ok { 4351 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4352 } 4353 4354 input, ok := in.Parameters.(*ListBucketAnalyticsConfigurationsInput) 4355 _ = input 4356 if !ok { 4357 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4358 } 4359 4360 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?analytics&x-id=ListBucketAnalyticsConfigurations") 4361 request.URL.Path = opPath 4362 if len(request.URL.RawQuery) > 0 { 4363 request.URL.RawQuery = "&" + opQuery 4364 } else { 4365 request.URL.RawQuery = opQuery 4366 } 4367 4368 request.Method = "GET" 4369 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4370 if err != nil { 4371 return out, metadata, &smithy.SerializationError{Err: err} 4372 } 4373 4374 if err := awsRestxml_serializeOpHttpBindingsListBucketAnalyticsConfigurationsInput(input, restEncoder); err != nil { 4375 return out, metadata, &smithy.SerializationError{Err: err} 4376 } 4377 4378 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4379 return out, metadata, &smithy.SerializationError{Err: err} 4380 } 4381 in.Request = request 4382 4383 return next.HandleSerialize(ctx, in) 4384} 4385func awsRestxml_serializeOpHttpBindingsListBucketAnalyticsConfigurationsInput(v *ListBucketAnalyticsConfigurationsInput, encoder *httpbinding.Encoder) error { 4386 if v == nil { 4387 return fmt.Errorf("unsupported serialization of nil %T", v) 4388 } 4389 4390 if v.Bucket == nil || len(*v.Bucket) == 0 { 4391 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4392 } 4393 if v.Bucket != nil { 4394 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4395 return err 4396 } 4397 } 4398 4399 if v.ContinuationToken != nil { 4400 encoder.SetQuery("continuation-token").String(*v.ContinuationToken) 4401 } 4402 4403 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4404 locationName := "X-Amz-Expected-Bucket-Owner" 4405 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4406 } 4407 4408 return nil 4409} 4410 4411type awsRestxml_serializeOpListBucketIntelligentTieringConfigurations struct { 4412} 4413 4414func (*awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) ID() string { 4415 return "OperationSerializer" 4416} 4417 4418func (m *awsRestxml_serializeOpListBucketIntelligentTieringConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4419 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4420) { 4421 request, ok := in.Request.(*smithyhttp.Request) 4422 if !ok { 4423 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4424 } 4425 4426 input, ok := in.Parameters.(*ListBucketIntelligentTieringConfigurationsInput) 4427 _ = input 4428 if !ok { 4429 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4430 } 4431 4432 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?intelligent-tiering&x-id=ListBucketIntelligentTieringConfigurations") 4433 request.URL.Path = opPath 4434 if len(request.URL.RawQuery) > 0 { 4435 request.URL.RawQuery = "&" + opQuery 4436 } else { 4437 request.URL.RawQuery = opQuery 4438 } 4439 4440 request.Method = "GET" 4441 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4442 if err != nil { 4443 return out, metadata, &smithy.SerializationError{Err: err} 4444 } 4445 4446 if err := awsRestxml_serializeOpHttpBindingsListBucketIntelligentTieringConfigurationsInput(input, restEncoder); err != nil { 4447 return out, metadata, &smithy.SerializationError{Err: err} 4448 } 4449 4450 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4451 return out, metadata, &smithy.SerializationError{Err: err} 4452 } 4453 in.Request = request 4454 4455 return next.HandleSerialize(ctx, in) 4456} 4457func awsRestxml_serializeOpHttpBindingsListBucketIntelligentTieringConfigurationsInput(v *ListBucketIntelligentTieringConfigurationsInput, encoder *httpbinding.Encoder) error { 4458 if v == nil { 4459 return fmt.Errorf("unsupported serialization of nil %T", v) 4460 } 4461 4462 if v.Bucket == nil || len(*v.Bucket) == 0 { 4463 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4464 } 4465 if v.Bucket != nil { 4466 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4467 return err 4468 } 4469 } 4470 4471 if v.ContinuationToken != nil { 4472 encoder.SetQuery("continuation-token").String(*v.ContinuationToken) 4473 } 4474 4475 return nil 4476} 4477 4478type awsRestxml_serializeOpListBucketInventoryConfigurations struct { 4479} 4480 4481func (*awsRestxml_serializeOpListBucketInventoryConfigurations) ID() string { 4482 return "OperationSerializer" 4483} 4484 4485func (m *awsRestxml_serializeOpListBucketInventoryConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4486 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4487) { 4488 request, ok := in.Request.(*smithyhttp.Request) 4489 if !ok { 4490 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4491 } 4492 4493 input, ok := in.Parameters.(*ListBucketInventoryConfigurationsInput) 4494 _ = input 4495 if !ok { 4496 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4497 } 4498 4499 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?inventory&x-id=ListBucketInventoryConfigurations") 4500 request.URL.Path = opPath 4501 if len(request.URL.RawQuery) > 0 { 4502 request.URL.RawQuery = "&" + opQuery 4503 } else { 4504 request.URL.RawQuery = opQuery 4505 } 4506 4507 request.Method = "GET" 4508 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4509 if err != nil { 4510 return out, metadata, &smithy.SerializationError{Err: err} 4511 } 4512 4513 if err := awsRestxml_serializeOpHttpBindingsListBucketInventoryConfigurationsInput(input, restEncoder); err != nil { 4514 return out, metadata, &smithy.SerializationError{Err: err} 4515 } 4516 4517 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4518 return out, metadata, &smithy.SerializationError{Err: err} 4519 } 4520 in.Request = request 4521 4522 return next.HandleSerialize(ctx, in) 4523} 4524func awsRestxml_serializeOpHttpBindingsListBucketInventoryConfigurationsInput(v *ListBucketInventoryConfigurationsInput, encoder *httpbinding.Encoder) error { 4525 if v == nil { 4526 return fmt.Errorf("unsupported serialization of nil %T", v) 4527 } 4528 4529 if v.Bucket == nil || len(*v.Bucket) == 0 { 4530 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4531 } 4532 if v.Bucket != nil { 4533 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4534 return err 4535 } 4536 } 4537 4538 if v.ContinuationToken != nil { 4539 encoder.SetQuery("continuation-token").String(*v.ContinuationToken) 4540 } 4541 4542 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4543 locationName := "X-Amz-Expected-Bucket-Owner" 4544 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4545 } 4546 4547 return nil 4548} 4549 4550type awsRestxml_serializeOpListBucketMetricsConfigurations struct { 4551} 4552 4553func (*awsRestxml_serializeOpListBucketMetricsConfigurations) ID() string { 4554 return "OperationSerializer" 4555} 4556 4557func (m *awsRestxml_serializeOpListBucketMetricsConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4558 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4559) { 4560 request, ok := in.Request.(*smithyhttp.Request) 4561 if !ok { 4562 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4563 } 4564 4565 input, ok := in.Parameters.(*ListBucketMetricsConfigurationsInput) 4566 _ = input 4567 if !ok { 4568 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4569 } 4570 4571 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?metrics&x-id=ListBucketMetricsConfigurations") 4572 request.URL.Path = opPath 4573 if len(request.URL.RawQuery) > 0 { 4574 request.URL.RawQuery = "&" + opQuery 4575 } else { 4576 request.URL.RawQuery = opQuery 4577 } 4578 4579 request.Method = "GET" 4580 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4581 if err != nil { 4582 return out, metadata, &smithy.SerializationError{Err: err} 4583 } 4584 4585 if err := awsRestxml_serializeOpHttpBindingsListBucketMetricsConfigurationsInput(input, restEncoder); err != nil { 4586 return out, metadata, &smithy.SerializationError{Err: err} 4587 } 4588 4589 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4590 return out, metadata, &smithy.SerializationError{Err: err} 4591 } 4592 in.Request = request 4593 4594 return next.HandleSerialize(ctx, in) 4595} 4596func awsRestxml_serializeOpHttpBindingsListBucketMetricsConfigurationsInput(v *ListBucketMetricsConfigurationsInput, encoder *httpbinding.Encoder) error { 4597 if v == nil { 4598 return fmt.Errorf("unsupported serialization of nil %T", v) 4599 } 4600 4601 if v.Bucket == nil || len(*v.Bucket) == 0 { 4602 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4603 } 4604 if v.Bucket != nil { 4605 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4606 return err 4607 } 4608 } 4609 4610 if v.ContinuationToken != nil { 4611 encoder.SetQuery("continuation-token").String(*v.ContinuationToken) 4612 } 4613 4614 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4615 locationName := "X-Amz-Expected-Bucket-Owner" 4616 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4617 } 4618 4619 return nil 4620} 4621 4622type awsRestxml_serializeOpListBuckets struct { 4623} 4624 4625func (*awsRestxml_serializeOpListBuckets) ID() string { 4626 return "OperationSerializer" 4627} 4628 4629func (m *awsRestxml_serializeOpListBuckets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4630 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4631) { 4632 request, ok := in.Request.(*smithyhttp.Request) 4633 if !ok { 4634 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4635 } 4636 4637 input, ok := in.Parameters.(*ListBucketsInput) 4638 _ = input 4639 if !ok { 4640 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4641 } 4642 4643 opPath, opQuery := httpbinding.SplitURI("/") 4644 request.URL.Path = opPath 4645 if len(request.URL.RawQuery) > 0 { 4646 request.URL.RawQuery = "&" + opQuery 4647 } else { 4648 request.URL.RawQuery = opQuery 4649 } 4650 4651 request.Method = "GET" 4652 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4653 if err != nil { 4654 return out, metadata, &smithy.SerializationError{Err: err} 4655 } 4656 4657 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4658 return out, metadata, &smithy.SerializationError{Err: err} 4659 } 4660 in.Request = request 4661 4662 return next.HandleSerialize(ctx, in) 4663} 4664func awsRestxml_serializeOpHttpBindingsListBucketsInput(v *ListBucketsInput, encoder *httpbinding.Encoder) error { 4665 if v == nil { 4666 return fmt.Errorf("unsupported serialization of nil %T", v) 4667 } 4668 4669 return nil 4670} 4671 4672type awsRestxml_serializeOpListMultipartUploads struct { 4673} 4674 4675func (*awsRestxml_serializeOpListMultipartUploads) ID() string { 4676 return "OperationSerializer" 4677} 4678 4679func (m *awsRestxml_serializeOpListMultipartUploads) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4680 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4681) { 4682 request, ok := in.Request.(*smithyhttp.Request) 4683 if !ok { 4684 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4685 } 4686 4687 input, ok := in.Parameters.(*ListMultipartUploadsInput) 4688 _ = input 4689 if !ok { 4690 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4691 } 4692 4693 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?uploads") 4694 request.URL.Path = opPath 4695 if len(request.URL.RawQuery) > 0 { 4696 request.URL.RawQuery = "&" + opQuery 4697 } else { 4698 request.URL.RawQuery = opQuery 4699 } 4700 4701 request.Method = "GET" 4702 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4703 if err != nil { 4704 return out, metadata, &smithy.SerializationError{Err: err} 4705 } 4706 4707 if err := awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(input, restEncoder); err != nil { 4708 return out, metadata, &smithy.SerializationError{Err: err} 4709 } 4710 4711 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4712 return out, metadata, &smithy.SerializationError{Err: err} 4713 } 4714 in.Request = request 4715 4716 return next.HandleSerialize(ctx, in) 4717} 4718func awsRestxml_serializeOpHttpBindingsListMultipartUploadsInput(v *ListMultipartUploadsInput, encoder *httpbinding.Encoder) error { 4719 if v == nil { 4720 return fmt.Errorf("unsupported serialization of nil %T", v) 4721 } 4722 4723 if v.Bucket == nil || len(*v.Bucket) == 0 { 4724 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4725 } 4726 if v.Bucket != nil { 4727 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4728 return err 4729 } 4730 } 4731 4732 if v.Delimiter != nil { 4733 encoder.SetQuery("delimiter").String(*v.Delimiter) 4734 } 4735 4736 if len(v.EncodingType) > 0 { 4737 encoder.SetQuery("encoding-type").String(string(v.EncodingType)) 4738 } 4739 4740 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4741 locationName := "X-Amz-Expected-Bucket-Owner" 4742 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4743 } 4744 4745 if v.KeyMarker != nil { 4746 encoder.SetQuery("key-marker").String(*v.KeyMarker) 4747 } 4748 4749 if v.MaxUploads != 0 { 4750 encoder.SetQuery("max-uploads").Integer(v.MaxUploads) 4751 } 4752 4753 if v.Prefix != nil { 4754 encoder.SetQuery("prefix").String(*v.Prefix) 4755 } 4756 4757 if v.UploadIdMarker != nil { 4758 encoder.SetQuery("upload-id-marker").String(*v.UploadIdMarker) 4759 } 4760 4761 return nil 4762} 4763 4764type awsRestxml_serializeOpListObjects struct { 4765} 4766 4767func (*awsRestxml_serializeOpListObjects) ID() string { 4768 return "OperationSerializer" 4769} 4770 4771func (m *awsRestxml_serializeOpListObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4772 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4773) { 4774 request, ok := in.Request.(*smithyhttp.Request) 4775 if !ok { 4776 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4777 } 4778 4779 input, ok := in.Parameters.(*ListObjectsInput) 4780 _ = input 4781 if !ok { 4782 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4783 } 4784 4785 opPath, opQuery := httpbinding.SplitURI("/{Bucket}") 4786 request.URL.Path = opPath 4787 if len(request.URL.RawQuery) > 0 { 4788 request.URL.RawQuery = "&" + opQuery 4789 } else { 4790 request.URL.RawQuery = opQuery 4791 } 4792 4793 request.Method = "GET" 4794 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4795 if err != nil { 4796 return out, metadata, &smithy.SerializationError{Err: err} 4797 } 4798 4799 if err := awsRestxml_serializeOpHttpBindingsListObjectsInput(input, restEncoder); err != nil { 4800 return out, metadata, &smithy.SerializationError{Err: err} 4801 } 4802 4803 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4804 return out, metadata, &smithy.SerializationError{Err: err} 4805 } 4806 in.Request = request 4807 4808 return next.HandleSerialize(ctx, in) 4809} 4810func awsRestxml_serializeOpHttpBindingsListObjectsInput(v *ListObjectsInput, encoder *httpbinding.Encoder) error { 4811 if v == nil { 4812 return fmt.Errorf("unsupported serialization of nil %T", v) 4813 } 4814 4815 if v.Bucket == nil || len(*v.Bucket) == 0 { 4816 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4817 } 4818 if v.Bucket != nil { 4819 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4820 return err 4821 } 4822 } 4823 4824 if v.Delimiter != nil { 4825 encoder.SetQuery("delimiter").String(*v.Delimiter) 4826 } 4827 4828 if len(v.EncodingType) > 0 { 4829 encoder.SetQuery("encoding-type").String(string(v.EncodingType)) 4830 } 4831 4832 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4833 locationName := "X-Amz-Expected-Bucket-Owner" 4834 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4835 } 4836 4837 if v.Marker != nil { 4838 encoder.SetQuery("marker").String(*v.Marker) 4839 } 4840 4841 if v.MaxKeys != 0 { 4842 encoder.SetQuery("max-keys").Integer(v.MaxKeys) 4843 } 4844 4845 if v.Prefix != nil { 4846 encoder.SetQuery("prefix").String(*v.Prefix) 4847 } 4848 4849 if len(v.RequestPayer) > 0 { 4850 locationName := "X-Amz-Request-Payer" 4851 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 4852 } 4853 4854 return nil 4855} 4856 4857type awsRestxml_serializeOpListObjectsV2 struct { 4858} 4859 4860func (*awsRestxml_serializeOpListObjectsV2) ID() string { 4861 return "OperationSerializer" 4862} 4863 4864func (m *awsRestxml_serializeOpListObjectsV2) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4865 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4866) { 4867 request, ok := in.Request.(*smithyhttp.Request) 4868 if !ok { 4869 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4870 } 4871 4872 input, ok := in.Parameters.(*ListObjectsV2Input) 4873 _ = input 4874 if !ok { 4875 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4876 } 4877 4878 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?list-type=2") 4879 request.URL.Path = opPath 4880 if len(request.URL.RawQuery) > 0 { 4881 request.URL.RawQuery = "&" + opQuery 4882 } else { 4883 request.URL.RawQuery = opQuery 4884 } 4885 4886 request.Method = "GET" 4887 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4888 if err != nil { 4889 return out, metadata, &smithy.SerializationError{Err: err} 4890 } 4891 4892 if err := awsRestxml_serializeOpHttpBindingsListObjectsV2Input(input, restEncoder); err != nil { 4893 return out, metadata, &smithy.SerializationError{Err: err} 4894 } 4895 4896 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4897 return out, metadata, &smithy.SerializationError{Err: err} 4898 } 4899 in.Request = request 4900 4901 return next.HandleSerialize(ctx, in) 4902} 4903func awsRestxml_serializeOpHttpBindingsListObjectsV2Input(v *ListObjectsV2Input, encoder *httpbinding.Encoder) error { 4904 if v == nil { 4905 return fmt.Errorf("unsupported serialization of nil %T", v) 4906 } 4907 4908 if v.Bucket == nil || len(*v.Bucket) == 0 { 4909 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 4910 } 4911 if v.Bucket != nil { 4912 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 4913 return err 4914 } 4915 } 4916 4917 if v.ContinuationToken != nil { 4918 encoder.SetQuery("continuation-token").String(*v.ContinuationToken) 4919 } 4920 4921 if v.Delimiter != nil { 4922 encoder.SetQuery("delimiter").String(*v.Delimiter) 4923 } 4924 4925 if len(v.EncodingType) > 0 { 4926 encoder.SetQuery("encoding-type").String(string(v.EncodingType)) 4927 } 4928 4929 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 4930 locationName := "X-Amz-Expected-Bucket-Owner" 4931 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 4932 } 4933 4934 if v.FetchOwner { 4935 encoder.SetQuery("fetch-owner").Boolean(v.FetchOwner) 4936 } 4937 4938 if v.MaxKeys != 0 { 4939 encoder.SetQuery("max-keys").Integer(v.MaxKeys) 4940 } 4941 4942 if v.Prefix != nil { 4943 encoder.SetQuery("prefix").String(*v.Prefix) 4944 } 4945 4946 if len(v.RequestPayer) > 0 { 4947 locationName := "X-Amz-Request-Payer" 4948 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 4949 } 4950 4951 if v.StartAfter != nil { 4952 encoder.SetQuery("start-after").String(*v.StartAfter) 4953 } 4954 4955 return nil 4956} 4957 4958type awsRestxml_serializeOpListObjectVersions struct { 4959} 4960 4961func (*awsRestxml_serializeOpListObjectVersions) ID() string { 4962 return "OperationSerializer" 4963} 4964 4965func (m *awsRestxml_serializeOpListObjectVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 4966 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 4967) { 4968 request, ok := in.Request.(*smithyhttp.Request) 4969 if !ok { 4970 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 4971 } 4972 4973 input, ok := in.Parameters.(*ListObjectVersionsInput) 4974 _ = input 4975 if !ok { 4976 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 4977 } 4978 4979 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?versions") 4980 request.URL.Path = opPath 4981 if len(request.URL.RawQuery) > 0 { 4982 request.URL.RawQuery = "&" + opQuery 4983 } else { 4984 request.URL.RawQuery = opQuery 4985 } 4986 4987 request.Method = "GET" 4988 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 4989 if err != nil { 4990 return out, metadata, &smithy.SerializationError{Err: err} 4991 } 4992 4993 if err := awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(input, restEncoder); err != nil { 4994 return out, metadata, &smithy.SerializationError{Err: err} 4995 } 4996 4997 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 4998 return out, metadata, &smithy.SerializationError{Err: err} 4999 } 5000 in.Request = request 5001 5002 return next.HandleSerialize(ctx, in) 5003} 5004func awsRestxml_serializeOpHttpBindingsListObjectVersionsInput(v *ListObjectVersionsInput, encoder *httpbinding.Encoder) error { 5005 if v == nil { 5006 return fmt.Errorf("unsupported serialization of nil %T", v) 5007 } 5008 5009 if v.Bucket == nil || len(*v.Bucket) == 0 { 5010 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5011 } 5012 if v.Bucket != nil { 5013 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5014 return err 5015 } 5016 } 5017 5018 if v.Delimiter != nil { 5019 encoder.SetQuery("delimiter").String(*v.Delimiter) 5020 } 5021 5022 if len(v.EncodingType) > 0 { 5023 encoder.SetQuery("encoding-type").String(string(v.EncodingType)) 5024 } 5025 5026 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5027 locationName := "X-Amz-Expected-Bucket-Owner" 5028 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5029 } 5030 5031 if v.KeyMarker != nil { 5032 encoder.SetQuery("key-marker").String(*v.KeyMarker) 5033 } 5034 5035 if v.MaxKeys != 0 { 5036 encoder.SetQuery("max-keys").Integer(v.MaxKeys) 5037 } 5038 5039 if v.Prefix != nil { 5040 encoder.SetQuery("prefix").String(*v.Prefix) 5041 } 5042 5043 if v.VersionIdMarker != nil { 5044 encoder.SetQuery("version-id-marker").String(*v.VersionIdMarker) 5045 } 5046 5047 return nil 5048} 5049 5050type awsRestxml_serializeOpListParts struct { 5051} 5052 5053func (*awsRestxml_serializeOpListParts) ID() string { 5054 return "OperationSerializer" 5055} 5056 5057func (m *awsRestxml_serializeOpListParts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5058 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5059) { 5060 request, ok := in.Request.(*smithyhttp.Request) 5061 if !ok { 5062 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5063 } 5064 5065 input, ok := in.Parameters.(*ListPartsInput) 5066 _ = input 5067 if !ok { 5068 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5069 } 5070 5071 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=ListParts") 5072 request.URL.Path = opPath 5073 if len(request.URL.RawQuery) > 0 { 5074 request.URL.RawQuery = "&" + opQuery 5075 } else { 5076 request.URL.RawQuery = opQuery 5077 } 5078 5079 request.Method = "GET" 5080 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5081 if err != nil { 5082 return out, metadata, &smithy.SerializationError{Err: err} 5083 } 5084 5085 if err := awsRestxml_serializeOpHttpBindingsListPartsInput(input, restEncoder); err != nil { 5086 return out, metadata, &smithy.SerializationError{Err: err} 5087 } 5088 5089 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5090 return out, metadata, &smithy.SerializationError{Err: err} 5091 } 5092 in.Request = request 5093 5094 return next.HandleSerialize(ctx, in) 5095} 5096func awsRestxml_serializeOpHttpBindingsListPartsInput(v *ListPartsInput, encoder *httpbinding.Encoder) error { 5097 if v == nil { 5098 return fmt.Errorf("unsupported serialization of nil %T", v) 5099 } 5100 5101 if v.Bucket == nil || len(*v.Bucket) == 0 { 5102 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5103 } 5104 if v.Bucket != nil { 5105 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5106 return err 5107 } 5108 } 5109 5110 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5111 locationName := "X-Amz-Expected-Bucket-Owner" 5112 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5113 } 5114 5115 if v.Key == nil || len(*v.Key) == 0 { 5116 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 5117 } 5118 if v.Key != nil { 5119 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 5120 return err 5121 } 5122 } 5123 5124 if v.MaxParts != 0 { 5125 encoder.SetQuery("max-parts").Integer(v.MaxParts) 5126 } 5127 5128 if v.PartNumberMarker != nil { 5129 encoder.SetQuery("part-number-marker").String(*v.PartNumberMarker) 5130 } 5131 5132 if len(v.RequestPayer) > 0 { 5133 locationName := "X-Amz-Request-Payer" 5134 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 5135 } 5136 5137 if v.UploadId != nil { 5138 encoder.SetQuery("uploadId").String(*v.UploadId) 5139 } 5140 5141 return nil 5142} 5143 5144type awsRestxml_serializeOpPutBucketAccelerateConfiguration struct { 5145} 5146 5147func (*awsRestxml_serializeOpPutBucketAccelerateConfiguration) ID() string { 5148 return "OperationSerializer" 5149} 5150 5151func (m *awsRestxml_serializeOpPutBucketAccelerateConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5152 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5153) { 5154 request, ok := in.Request.(*smithyhttp.Request) 5155 if !ok { 5156 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5157 } 5158 5159 input, ok := in.Parameters.(*PutBucketAccelerateConfigurationInput) 5160 _ = input 5161 if !ok { 5162 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5163 } 5164 5165 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?accelerate") 5166 request.URL.Path = opPath 5167 if len(request.URL.RawQuery) > 0 { 5168 request.URL.RawQuery = "&" + opQuery 5169 } else { 5170 request.URL.RawQuery = opQuery 5171 } 5172 5173 request.Method = "PUT" 5174 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5175 if err != nil { 5176 return out, metadata, &smithy.SerializationError{Err: err} 5177 } 5178 5179 if err := awsRestxml_serializeOpHttpBindingsPutBucketAccelerateConfigurationInput(input, restEncoder); err != nil { 5180 return out, metadata, &smithy.SerializationError{Err: err} 5181 } 5182 5183 if input.AccelerateConfiguration != nil { 5184 if !restEncoder.HasHeader("Content-Type") { 5185 restEncoder.SetHeader("Content-Type").String("application/xml") 5186 } 5187 5188 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5189 payloadRootAttr := []smithyxml.Attr{} 5190 payloadRoot := smithyxml.StartElement{ 5191 Name: smithyxml.Name{ 5192 Local: "AccelerateConfiguration", 5193 }, 5194 Attr: payloadRootAttr, 5195 } 5196 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5197 if err := awsRestxml_serializeDocumentAccelerateConfiguration(input.AccelerateConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5198 return out, metadata, &smithy.SerializationError{Err: err} 5199 } 5200 payload := bytes.NewReader(xmlEncoder.Bytes()) 5201 if request, err = request.SetStream(payload); err != nil { 5202 return out, metadata, &smithy.SerializationError{Err: err} 5203 } 5204 } 5205 5206 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5207 return out, metadata, &smithy.SerializationError{Err: err} 5208 } 5209 in.Request = request 5210 5211 return next.HandleSerialize(ctx, in) 5212} 5213func awsRestxml_serializeOpHttpBindingsPutBucketAccelerateConfigurationInput(v *PutBucketAccelerateConfigurationInput, encoder *httpbinding.Encoder) error { 5214 if v == nil { 5215 return fmt.Errorf("unsupported serialization of nil %T", v) 5216 } 5217 5218 if v.Bucket == nil || len(*v.Bucket) == 0 { 5219 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5220 } 5221 if v.Bucket != nil { 5222 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5223 return err 5224 } 5225 } 5226 5227 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5228 locationName := "X-Amz-Expected-Bucket-Owner" 5229 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5230 } 5231 5232 return nil 5233} 5234 5235type awsRestxml_serializeOpPutBucketAcl struct { 5236} 5237 5238func (*awsRestxml_serializeOpPutBucketAcl) ID() string { 5239 return "OperationSerializer" 5240} 5241 5242func (m *awsRestxml_serializeOpPutBucketAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5243 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5244) { 5245 request, ok := in.Request.(*smithyhttp.Request) 5246 if !ok { 5247 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5248 } 5249 5250 input, ok := in.Parameters.(*PutBucketAclInput) 5251 _ = input 5252 if !ok { 5253 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5254 } 5255 5256 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?acl") 5257 request.URL.Path = opPath 5258 if len(request.URL.RawQuery) > 0 { 5259 request.URL.RawQuery = "&" + opQuery 5260 } else { 5261 request.URL.RawQuery = opQuery 5262 } 5263 5264 request.Method = "PUT" 5265 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5266 if err != nil { 5267 return out, metadata, &smithy.SerializationError{Err: err} 5268 } 5269 5270 if err := awsRestxml_serializeOpHttpBindingsPutBucketAclInput(input, restEncoder); err != nil { 5271 return out, metadata, &smithy.SerializationError{Err: err} 5272 } 5273 5274 if input.AccessControlPolicy != nil { 5275 if !restEncoder.HasHeader("Content-Type") { 5276 restEncoder.SetHeader("Content-Type").String("application/xml") 5277 } 5278 5279 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5280 payloadRootAttr := []smithyxml.Attr{} 5281 payloadRoot := smithyxml.StartElement{ 5282 Name: smithyxml.Name{ 5283 Local: "AccessControlPolicy", 5284 }, 5285 Attr: payloadRootAttr, 5286 } 5287 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5288 if err := awsRestxml_serializeDocumentAccessControlPolicy(input.AccessControlPolicy, xmlEncoder.RootElement(payloadRoot)); err != nil { 5289 return out, metadata, &smithy.SerializationError{Err: err} 5290 } 5291 payload := bytes.NewReader(xmlEncoder.Bytes()) 5292 if request, err = request.SetStream(payload); err != nil { 5293 return out, metadata, &smithy.SerializationError{Err: err} 5294 } 5295 } 5296 5297 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5298 return out, metadata, &smithy.SerializationError{Err: err} 5299 } 5300 in.Request = request 5301 5302 return next.HandleSerialize(ctx, in) 5303} 5304func awsRestxml_serializeOpHttpBindingsPutBucketAclInput(v *PutBucketAclInput, encoder *httpbinding.Encoder) error { 5305 if v == nil { 5306 return fmt.Errorf("unsupported serialization of nil %T", v) 5307 } 5308 5309 if len(v.ACL) > 0 { 5310 locationName := "X-Amz-Acl" 5311 encoder.SetHeader(locationName).String(string(v.ACL)) 5312 } 5313 5314 if v.Bucket == nil || len(*v.Bucket) == 0 { 5315 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5316 } 5317 if v.Bucket != nil { 5318 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5319 return err 5320 } 5321 } 5322 5323 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 5324 locationName := "Content-Md5" 5325 encoder.SetHeader(locationName).String(*v.ContentMD5) 5326 } 5327 5328 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5329 locationName := "X-Amz-Expected-Bucket-Owner" 5330 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5331 } 5332 5333 if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { 5334 locationName := "X-Amz-Grant-Full-Control" 5335 encoder.SetHeader(locationName).String(*v.GrantFullControl) 5336 } 5337 5338 if v.GrantRead != nil && len(*v.GrantRead) > 0 { 5339 locationName := "X-Amz-Grant-Read" 5340 encoder.SetHeader(locationName).String(*v.GrantRead) 5341 } 5342 5343 if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { 5344 locationName := "X-Amz-Grant-Read-Acp" 5345 encoder.SetHeader(locationName).String(*v.GrantReadACP) 5346 } 5347 5348 if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { 5349 locationName := "X-Amz-Grant-Write" 5350 encoder.SetHeader(locationName).String(*v.GrantWrite) 5351 } 5352 5353 if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { 5354 locationName := "X-Amz-Grant-Write-Acp" 5355 encoder.SetHeader(locationName).String(*v.GrantWriteACP) 5356 } 5357 5358 return nil 5359} 5360 5361type awsRestxml_serializeOpPutBucketAnalyticsConfiguration struct { 5362} 5363 5364func (*awsRestxml_serializeOpPutBucketAnalyticsConfiguration) ID() string { 5365 return "OperationSerializer" 5366} 5367 5368func (m *awsRestxml_serializeOpPutBucketAnalyticsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5369 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5370) { 5371 request, ok := in.Request.(*smithyhttp.Request) 5372 if !ok { 5373 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5374 } 5375 5376 input, ok := in.Parameters.(*PutBucketAnalyticsConfigurationInput) 5377 _ = input 5378 if !ok { 5379 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5380 } 5381 5382 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?analytics") 5383 request.URL.Path = opPath 5384 if len(request.URL.RawQuery) > 0 { 5385 request.URL.RawQuery = "&" + opQuery 5386 } else { 5387 request.URL.RawQuery = opQuery 5388 } 5389 5390 request.Method = "PUT" 5391 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5392 if err != nil { 5393 return out, metadata, &smithy.SerializationError{Err: err} 5394 } 5395 5396 if err := awsRestxml_serializeOpHttpBindingsPutBucketAnalyticsConfigurationInput(input, restEncoder); err != nil { 5397 return out, metadata, &smithy.SerializationError{Err: err} 5398 } 5399 5400 if input.AnalyticsConfiguration != nil { 5401 if !restEncoder.HasHeader("Content-Type") { 5402 restEncoder.SetHeader("Content-Type").String("application/xml") 5403 } 5404 5405 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5406 payloadRootAttr := []smithyxml.Attr{} 5407 payloadRoot := smithyxml.StartElement{ 5408 Name: smithyxml.Name{ 5409 Local: "AnalyticsConfiguration", 5410 }, 5411 Attr: payloadRootAttr, 5412 } 5413 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5414 if err := awsRestxml_serializeDocumentAnalyticsConfiguration(input.AnalyticsConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5415 return out, metadata, &smithy.SerializationError{Err: err} 5416 } 5417 payload := bytes.NewReader(xmlEncoder.Bytes()) 5418 if request, err = request.SetStream(payload); err != nil { 5419 return out, metadata, &smithy.SerializationError{Err: err} 5420 } 5421 } 5422 5423 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5424 return out, metadata, &smithy.SerializationError{Err: err} 5425 } 5426 in.Request = request 5427 5428 return next.HandleSerialize(ctx, in) 5429} 5430func awsRestxml_serializeOpHttpBindingsPutBucketAnalyticsConfigurationInput(v *PutBucketAnalyticsConfigurationInput, encoder *httpbinding.Encoder) error { 5431 if v == nil { 5432 return fmt.Errorf("unsupported serialization of nil %T", v) 5433 } 5434 5435 if v.Bucket == nil || len(*v.Bucket) == 0 { 5436 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5437 } 5438 if v.Bucket != nil { 5439 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5440 return err 5441 } 5442 } 5443 5444 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5445 locationName := "X-Amz-Expected-Bucket-Owner" 5446 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5447 } 5448 5449 if v.Id != nil { 5450 encoder.SetQuery("id").String(*v.Id) 5451 } 5452 5453 return nil 5454} 5455 5456type awsRestxml_serializeOpPutBucketCors struct { 5457} 5458 5459func (*awsRestxml_serializeOpPutBucketCors) ID() string { 5460 return "OperationSerializer" 5461} 5462 5463func (m *awsRestxml_serializeOpPutBucketCors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5464 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5465) { 5466 request, ok := in.Request.(*smithyhttp.Request) 5467 if !ok { 5468 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5469 } 5470 5471 input, ok := in.Parameters.(*PutBucketCorsInput) 5472 _ = input 5473 if !ok { 5474 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5475 } 5476 5477 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?cors") 5478 request.URL.Path = opPath 5479 if len(request.URL.RawQuery) > 0 { 5480 request.URL.RawQuery = "&" + opQuery 5481 } else { 5482 request.URL.RawQuery = opQuery 5483 } 5484 5485 request.Method = "PUT" 5486 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5487 if err != nil { 5488 return out, metadata, &smithy.SerializationError{Err: err} 5489 } 5490 5491 if err := awsRestxml_serializeOpHttpBindingsPutBucketCorsInput(input, restEncoder); err != nil { 5492 return out, metadata, &smithy.SerializationError{Err: err} 5493 } 5494 5495 if input.CORSConfiguration != nil { 5496 if !restEncoder.HasHeader("Content-Type") { 5497 restEncoder.SetHeader("Content-Type").String("application/xml") 5498 } 5499 5500 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5501 payloadRootAttr := []smithyxml.Attr{} 5502 payloadRoot := smithyxml.StartElement{ 5503 Name: smithyxml.Name{ 5504 Local: "CORSConfiguration", 5505 }, 5506 Attr: payloadRootAttr, 5507 } 5508 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5509 if err := awsRestxml_serializeDocumentCORSConfiguration(input.CORSConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5510 return out, metadata, &smithy.SerializationError{Err: err} 5511 } 5512 payload := bytes.NewReader(xmlEncoder.Bytes()) 5513 if request, err = request.SetStream(payload); err != nil { 5514 return out, metadata, &smithy.SerializationError{Err: err} 5515 } 5516 } 5517 5518 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5519 return out, metadata, &smithy.SerializationError{Err: err} 5520 } 5521 in.Request = request 5522 5523 return next.HandleSerialize(ctx, in) 5524} 5525func awsRestxml_serializeOpHttpBindingsPutBucketCorsInput(v *PutBucketCorsInput, encoder *httpbinding.Encoder) error { 5526 if v == nil { 5527 return fmt.Errorf("unsupported serialization of nil %T", v) 5528 } 5529 5530 if v.Bucket == nil || len(*v.Bucket) == 0 { 5531 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5532 } 5533 if v.Bucket != nil { 5534 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5535 return err 5536 } 5537 } 5538 5539 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 5540 locationName := "Content-Md5" 5541 encoder.SetHeader(locationName).String(*v.ContentMD5) 5542 } 5543 5544 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5545 locationName := "X-Amz-Expected-Bucket-Owner" 5546 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5547 } 5548 5549 return nil 5550} 5551 5552type awsRestxml_serializeOpPutBucketEncryption struct { 5553} 5554 5555func (*awsRestxml_serializeOpPutBucketEncryption) ID() string { 5556 return "OperationSerializer" 5557} 5558 5559func (m *awsRestxml_serializeOpPutBucketEncryption) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5560 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5561) { 5562 request, ok := in.Request.(*smithyhttp.Request) 5563 if !ok { 5564 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5565 } 5566 5567 input, ok := in.Parameters.(*PutBucketEncryptionInput) 5568 _ = input 5569 if !ok { 5570 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5571 } 5572 5573 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?encryption") 5574 request.URL.Path = opPath 5575 if len(request.URL.RawQuery) > 0 { 5576 request.URL.RawQuery = "&" + opQuery 5577 } else { 5578 request.URL.RawQuery = opQuery 5579 } 5580 5581 request.Method = "PUT" 5582 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5583 if err != nil { 5584 return out, metadata, &smithy.SerializationError{Err: err} 5585 } 5586 5587 if err := awsRestxml_serializeOpHttpBindingsPutBucketEncryptionInput(input, restEncoder); err != nil { 5588 return out, metadata, &smithy.SerializationError{Err: err} 5589 } 5590 5591 if input.ServerSideEncryptionConfiguration != nil { 5592 if !restEncoder.HasHeader("Content-Type") { 5593 restEncoder.SetHeader("Content-Type").String("application/xml") 5594 } 5595 5596 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5597 payloadRootAttr := []smithyxml.Attr{} 5598 payloadRoot := smithyxml.StartElement{ 5599 Name: smithyxml.Name{ 5600 Local: "ServerSideEncryptionConfiguration", 5601 }, 5602 Attr: payloadRootAttr, 5603 } 5604 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5605 if err := awsRestxml_serializeDocumentServerSideEncryptionConfiguration(input.ServerSideEncryptionConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5606 return out, metadata, &smithy.SerializationError{Err: err} 5607 } 5608 payload := bytes.NewReader(xmlEncoder.Bytes()) 5609 if request, err = request.SetStream(payload); err != nil { 5610 return out, metadata, &smithy.SerializationError{Err: err} 5611 } 5612 } 5613 5614 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5615 return out, metadata, &smithy.SerializationError{Err: err} 5616 } 5617 in.Request = request 5618 5619 return next.HandleSerialize(ctx, in) 5620} 5621func awsRestxml_serializeOpHttpBindingsPutBucketEncryptionInput(v *PutBucketEncryptionInput, encoder *httpbinding.Encoder) error { 5622 if v == nil { 5623 return fmt.Errorf("unsupported serialization of nil %T", v) 5624 } 5625 5626 if v.Bucket == nil || len(*v.Bucket) == 0 { 5627 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5628 } 5629 if v.Bucket != nil { 5630 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5631 return err 5632 } 5633 } 5634 5635 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 5636 locationName := "Content-Md5" 5637 encoder.SetHeader(locationName).String(*v.ContentMD5) 5638 } 5639 5640 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5641 locationName := "X-Amz-Expected-Bucket-Owner" 5642 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5643 } 5644 5645 return nil 5646} 5647 5648type awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration struct { 5649} 5650 5651func (*awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) ID() string { 5652 return "OperationSerializer" 5653} 5654 5655func (m *awsRestxml_serializeOpPutBucketIntelligentTieringConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5656 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5657) { 5658 request, ok := in.Request.(*smithyhttp.Request) 5659 if !ok { 5660 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5661 } 5662 5663 input, ok := in.Parameters.(*PutBucketIntelligentTieringConfigurationInput) 5664 _ = input 5665 if !ok { 5666 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5667 } 5668 5669 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?intelligent-tiering") 5670 request.URL.Path = opPath 5671 if len(request.URL.RawQuery) > 0 { 5672 request.URL.RawQuery = "&" + opQuery 5673 } else { 5674 request.URL.RawQuery = opQuery 5675 } 5676 5677 request.Method = "PUT" 5678 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5679 if err != nil { 5680 return out, metadata, &smithy.SerializationError{Err: err} 5681 } 5682 5683 if err := awsRestxml_serializeOpHttpBindingsPutBucketIntelligentTieringConfigurationInput(input, restEncoder); err != nil { 5684 return out, metadata, &smithy.SerializationError{Err: err} 5685 } 5686 5687 if input.IntelligentTieringConfiguration != nil { 5688 if !restEncoder.HasHeader("Content-Type") { 5689 restEncoder.SetHeader("Content-Type").String("application/xml") 5690 } 5691 5692 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5693 payloadRootAttr := []smithyxml.Attr{} 5694 payloadRoot := smithyxml.StartElement{ 5695 Name: smithyxml.Name{ 5696 Local: "IntelligentTieringConfiguration", 5697 }, 5698 Attr: payloadRootAttr, 5699 } 5700 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5701 if err := awsRestxml_serializeDocumentIntelligentTieringConfiguration(input.IntelligentTieringConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5702 return out, metadata, &smithy.SerializationError{Err: err} 5703 } 5704 payload := bytes.NewReader(xmlEncoder.Bytes()) 5705 if request, err = request.SetStream(payload); err != nil { 5706 return out, metadata, &smithy.SerializationError{Err: err} 5707 } 5708 } 5709 5710 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5711 return out, metadata, &smithy.SerializationError{Err: err} 5712 } 5713 in.Request = request 5714 5715 return next.HandleSerialize(ctx, in) 5716} 5717func awsRestxml_serializeOpHttpBindingsPutBucketIntelligentTieringConfigurationInput(v *PutBucketIntelligentTieringConfigurationInput, encoder *httpbinding.Encoder) error { 5718 if v == nil { 5719 return fmt.Errorf("unsupported serialization of nil %T", v) 5720 } 5721 5722 if v.Bucket == nil || len(*v.Bucket) == 0 { 5723 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5724 } 5725 if v.Bucket != nil { 5726 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5727 return err 5728 } 5729 } 5730 5731 if v.Id != nil { 5732 encoder.SetQuery("id").String(*v.Id) 5733 } 5734 5735 return nil 5736} 5737 5738type awsRestxml_serializeOpPutBucketInventoryConfiguration struct { 5739} 5740 5741func (*awsRestxml_serializeOpPutBucketInventoryConfiguration) ID() string { 5742 return "OperationSerializer" 5743} 5744 5745func (m *awsRestxml_serializeOpPutBucketInventoryConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5746 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5747) { 5748 request, ok := in.Request.(*smithyhttp.Request) 5749 if !ok { 5750 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5751 } 5752 5753 input, ok := in.Parameters.(*PutBucketInventoryConfigurationInput) 5754 _ = input 5755 if !ok { 5756 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5757 } 5758 5759 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?inventory") 5760 request.URL.Path = opPath 5761 if len(request.URL.RawQuery) > 0 { 5762 request.URL.RawQuery = "&" + opQuery 5763 } else { 5764 request.URL.RawQuery = opQuery 5765 } 5766 5767 request.Method = "PUT" 5768 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5769 if err != nil { 5770 return out, metadata, &smithy.SerializationError{Err: err} 5771 } 5772 5773 if err := awsRestxml_serializeOpHttpBindingsPutBucketInventoryConfigurationInput(input, restEncoder); err != nil { 5774 return out, metadata, &smithy.SerializationError{Err: err} 5775 } 5776 5777 if input.InventoryConfiguration != nil { 5778 if !restEncoder.HasHeader("Content-Type") { 5779 restEncoder.SetHeader("Content-Type").String("application/xml") 5780 } 5781 5782 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5783 payloadRootAttr := []smithyxml.Attr{} 5784 payloadRoot := smithyxml.StartElement{ 5785 Name: smithyxml.Name{ 5786 Local: "InventoryConfiguration", 5787 }, 5788 Attr: payloadRootAttr, 5789 } 5790 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5791 if err := awsRestxml_serializeDocumentInventoryConfiguration(input.InventoryConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5792 return out, metadata, &smithy.SerializationError{Err: err} 5793 } 5794 payload := bytes.NewReader(xmlEncoder.Bytes()) 5795 if request, err = request.SetStream(payload); err != nil { 5796 return out, metadata, &smithy.SerializationError{Err: err} 5797 } 5798 } 5799 5800 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5801 return out, metadata, &smithy.SerializationError{Err: err} 5802 } 5803 in.Request = request 5804 5805 return next.HandleSerialize(ctx, in) 5806} 5807func awsRestxml_serializeOpHttpBindingsPutBucketInventoryConfigurationInput(v *PutBucketInventoryConfigurationInput, encoder *httpbinding.Encoder) error { 5808 if v == nil { 5809 return fmt.Errorf("unsupported serialization of nil %T", v) 5810 } 5811 5812 if v.Bucket == nil || len(*v.Bucket) == 0 { 5813 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5814 } 5815 if v.Bucket != nil { 5816 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5817 return err 5818 } 5819 } 5820 5821 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5822 locationName := "X-Amz-Expected-Bucket-Owner" 5823 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5824 } 5825 5826 if v.Id != nil { 5827 encoder.SetQuery("id").String(*v.Id) 5828 } 5829 5830 return nil 5831} 5832 5833type awsRestxml_serializeOpPutBucketLifecycleConfiguration struct { 5834} 5835 5836func (*awsRestxml_serializeOpPutBucketLifecycleConfiguration) ID() string { 5837 return "OperationSerializer" 5838} 5839 5840func (m *awsRestxml_serializeOpPutBucketLifecycleConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5841 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5842) { 5843 request, ok := in.Request.(*smithyhttp.Request) 5844 if !ok { 5845 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5846 } 5847 5848 input, ok := in.Parameters.(*PutBucketLifecycleConfigurationInput) 5849 _ = input 5850 if !ok { 5851 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5852 } 5853 5854 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?lifecycle") 5855 request.URL.Path = opPath 5856 if len(request.URL.RawQuery) > 0 { 5857 request.URL.RawQuery = "&" + opQuery 5858 } else { 5859 request.URL.RawQuery = opQuery 5860 } 5861 5862 request.Method = "PUT" 5863 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5864 if err != nil { 5865 return out, metadata, &smithy.SerializationError{Err: err} 5866 } 5867 5868 if err := awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(input, restEncoder); err != nil { 5869 return out, metadata, &smithy.SerializationError{Err: err} 5870 } 5871 5872 if input.LifecycleConfiguration != nil { 5873 if !restEncoder.HasHeader("Content-Type") { 5874 restEncoder.SetHeader("Content-Type").String("application/xml") 5875 } 5876 5877 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5878 payloadRootAttr := []smithyxml.Attr{} 5879 payloadRoot := smithyxml.StartElement{ 5880 Name: smithyxml.Name{ 5881 Local: "BucketLifecycleConfiguration", 5882 }, 5883 Attr: payloadRootAttr, 5884 } 5885 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5886 if err := awsRestxml_serializeDocumentBucketLifecycleConfiguration(input.LifecycleConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 5887 return out, metadata, &smithy.SerializationError{Err: err} 5888 } 5889 payload := bytes.NewReader(xmlEncoder.Bytes()) 5890 if request, err = request.SetStream(payload); err != nil { 5891 return out, metadata, &smithy.SerializationError{Err: err} 5892 } 5893 } 5894 5895 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5896 return out, metadata, &smithy.SerializationError{Err: err} 5897 } 5898 in.Request = request 5899 5900 return next.HandleSerialize(ctx, in) 5901} 5902func awsRestxml_serializeOpHttpBindingsPutBucketLifecycleConfigurationInput(v *PutBucketLifecycleConfigurationInput, encoder *httpbinding.Encoder) error { 5903 if v == nil { 5904 return fmt.Errorf("unsupported serialization of nil %T", v) 5905 } 5906 5907 if v.Bucket == nil || len(*v.Bucket) == 0 { 5908 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 5909 } 5910 if v.Bucket != nil { 5911 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 5912 return err 5913 } 5914 } 5915 5916 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 5917 locationName := "X-Amz-Expected-Bucket-Owner" 5918 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 5919 } 5920 5921 return nil 5922} 5923 5924type awsRestxml_serializeOpPutBucketLogging struct { 5925} 5926 5927func (*awsRestxml_serializeOpPutBucketLogging) ID() string { 5928 return "OperationSerializer" 5929} 5930 5931func (m *awsRestxml_serializeOpPutBucketLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 5932 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 5933) { 5934 request, ok := in.Request.(*smithyhttp.Request) 5935 if !ok { 5936 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 5937 } 5938 5939 input, ok := in.Parameters.(*PutBucketLoggingInput) 5940 _ = input 5941 if !ok { 5942 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 5943 } 5944 5945 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?logging") 5946 request.URL.Path = opPath 5947 if len(request.URL.RawQuery) > 0 { 5948 request.URL.RawQuery = "&" + opQuery 5949 } else { 5950 request.URL.RawQuery = opQuery 5951 } 5952 5953 request.Method = "PUT" 5954 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 5955 if err != nil { 5956 return out, metadata, &smithy.SerializationError{Err: err} 5957 } 5958 5959 if err := awsRestxml_serializeOpHttpBindingsPutBucketLoggingInput(input, restEncoder); err != nil { 5960 return out, metadata, &smithy.SerializationError{Err: err} 5961 } 5962 5963 if input.BucketLoggingStatus != nil { 5964 if !restEncoder.HasHeader("Content-Type") { 5965 restEncoder.SetHeader("Content-Type").String("application/xml") 5966 } 5967 5968 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 5969 payloadRootAttr := []smithyxml.Attr{} 5970 payloadRoot := smithyxml.StartElement{ 5971 Name: smithyxml.Name{ 5972 Local: "BucketLoggingStatus", 5973 }, 5974 Attr: payloadRootAttr, 5975 } 5976 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 5977 if err := awsRestxml_serializeDocumentBucketLoggingStatus(input.BucketLoggingStatus, xmlEncoder.RootElement(payloadRoot)); err != nil { 5978 return out, metadata, &smithy.SerializationError{Err: err} 5979 } 5980 payload := bytes.NewReader(xmlEncoder.Bytes()) 5981 if request, err = request.SetStream(payload); err != nil { 5982 return out, metadata, &smithy.SerializationError{Err: err} 5983 } 5984 } 5985 5986 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 5987 return out, metadata, &smithy.SerializationError{Err: err} 5988 } 5989 in.Request = request 5990 5991 return next.HandleSerialize(ctx, in) 5992} 5993func awsRestxml_serializeOpHttpBindingsPutBucketLoggingInput(v *PutBucketLoggingInput, encoder *httpbinding.Encoder) error { 5994 if v == nil { 5995 return fmt.Errorf("unsupported serialization of nil %T", v) 5996 } 5997 5998 if v.Bucket == nil || len(*v.Bucket) == 0 { 5999 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6000 } 6001 if v.Bucket != nil { 6002 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6003 return err 6004 } 6005 } 6006 6007 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6008 locationName := "Content-Md5" 6009 encoder.SetHeader(locationName).String(*v.ContentMD5) 6010 } 6011 6012 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6013 locationName := "X-Amz-Expected-Bucket-Owner" 6014 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6015 } 6016 6017 return nil 6018} 6019 6020type awsRestxml_serializeOpPutBucketMetricsConfiguration struct { 6021} 6022 6023func (*awsRestxml_serializeOpPutBucketMetricsConfiguration) ID() string { 6024 return "OperationSerializer" 6025} 6026 6027func (m *awsRestxml_serializeOpPutBucketMetricsConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6028 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6029) { 6030 request, ok := in.Request.(*smithyhttp.Request) 6031 if !ok { 6032 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6033 } 6034 6035 input, ok := in.Parameters.(*PutBucketMetricsConfigurationInput) 6036 _ = input 6037 if !ok { 6038 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6039 } 6040 6041 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?metrics") 6042 request.URL.Path = opPath 6043 if len(request.URL.RawQuery) > 0 { 6044 request.URL.RawQuery = "&" + opQuery 6045 } else { 6046 request.URL.RawQuery = opQuery 6047 } 6048 6049 request.Method = "PUT" 6050 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6051 if err != nil { 6052 return out, metadata, &smithy.SerializationError{Err: err} 6053 } 6054 6055 if err := awsRestxml_serializeOpHttpBindingsPutBucketMetricsConfigurationInput(input, restEncoder); err != nil { 6056 return out, metadata, &smithy.SerializationError{Err: err} 6057 } 6058 6059 if input.MetricsConfiguration != nil { 6060 if !restEncoder.HasHeader("Content-Type") { 6061 restEncoder.SetHeader("Content-Type").String("application/xml") 6062 } 6063 6064 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6065 payloadRootAttr := []smithyxml.Attr{} 6066 payloadRoot := smithyxml.StartElement{ 6067 Name: smithyxml.Name{ 6068 Local: "MetricsConfiguration", 6069 }, 6070 Attr: payloadRootAttr, 6071 } 6072 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6073 if err := awsRestxml_serializeDocumentMetricsConfiguration(input.MetricsConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 6074 return out, metadata, &smithy.SerializationError{Err: err} 6075 } 6076 payload := bytes.NewReader(xmlEncoder.Bytes()) 6077 if request, err = request.SetStream(payload); err != nil { 6078 return out, metadata, &smithy.SerializationError{Err: err} 6079 } 6080 } 6081 6082 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6083 return out, metadata, &smithy.SerializationError{Err: err} 6084 } 6085 in.Request = request 6086 6087 return next.HandleSerialize(ctx, in) 6088} 6089func awsRestxml_serializeOpHttpBindingsPutBucketMetricsConfigurationInput(v *PutBucketMetricsConfigurationInput, encoder *httpbinding.Encoder) error { 6090 if v == nil { 6091 return fmt.Errorf("unsupported serialization of nil %T", v) 6092 } 6093 6094 if v.Bucket == nil || len(*v.Bucket) == 0 { 6095 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6096 } 6097 if v.Bucket != nil { 6098 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6099 return err 6100 } 6101 } 6102 6103 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6104 locationName := "X-Amz-Expected-Bucket-Owner" 6105 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6106 } 6107 6108 if v.Id != nil { 6109 encoder.SetQuery("id").String(*v.Id) 6110 } 6111 6112 return nil 6113} 6114 6115type awsRestxml_serializeOpPutBucketNotificationConfiguration struct { 6116} 6117 6118func (*awsRestxml_serializeOpPutBucketNotificationConfiguration) ID() string { 6119 return "OperationSerializer" 6120} 6121 6122func (m *awsRestxml_serializeOpPutBucketNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6123 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6124) { 6125 request, ok := in.Request.(*smithyhttp.Request) 6126 if !ok { 6127 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6128 } 6129 6130 input, ok := in.Parameters.(*PutBucketNotificationConfigurationInput) 6131 _ = input 6132 if !ok { 6133 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6134 } 6135 6136 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?notification") 6137 request.URL.Path = opPath 6138 if len(request.URL.RawQuery) > 0 { 6139 request.URL.RawQuery = "&" + opQuery 6140 } else { 6141 request.URL.RawQuery = opQuery 6142 } 6143 6144 request.Method = "PUT" 6145 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6146 if err != nil { 6147 return out, metadata, &smithy.SerializationError{Err: err} 6148 } 6149 6150 if err := awsRestxml_serializeOpHttpBindingsPutBucketNotificationConfigurationInput(input, restEncoder); err != nil { 6151 return out, metadata, &smithy.SerializationError{Err: err} 6152 } 6153 6154 if input.NotificationConfiguration != nil { 6155 if !restEncoder.HasHeader("Content-Type") { 6156 restEncoder.SetHeader("Content-Type").String("application/xml") 6157 } 6158 6159 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6160 payloadRootAttr := []smithyxml.Attr{} 6161 payloadRoot := smithyxml.StartElement{ 6162 Name: smithyxml.Name{ 6163 Local: "NotificationConfiguration", 6164 }, 6165 Attr: payloadRootAttr, 6166 } 6167 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6168 if err := awsRestxml_serializeDocumentNotificationConfiguration(input.NotificationConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 6169 return out, metadata, &smithy.SerializationError{Err: err} 6170 } 6171 payload := bytes.NewReader(xmlEncoder.Bytes()) 6172 if request, err = request.SetStream(payload); err != nil { 6173 return out, metadata, &smithy.SerializationError{Err: err} 6174 } 6175 } 6176 6177 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6178 return out, metadata, &smithy.SerializationError{Err: err} 6179 } 6180 in.Request = request 6181 6182 return next.HandleSerialize(ctx, in) 6183} 6184func awsRestxml_serializeOpHttpBindingsPutBucketNotificationConfigurationInput(v *PutBucketNotificationConfigurationInput, encoder *httpbinding.Encoder) error { 6185 if v == nil { 6186 return fmt.Errorf("unsupported serialization of nil %T", v) 6187 } 6188 6189 if v.Bucket == nil || len(*v.Bucket) == 0 { 6190 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6191 } 6192 if v.Bucket != nil { 6193 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6194 return err 6195 } 6196 } 6197 6198 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6199 locationName := "X-Amz-Expected-Bucket-Owner" 6200 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6201 } 6202 6203 return nil 6204} 6205 6206type awsRestxml_serializeOpPutBucketOwnershipControls struct { 6207} 6208 6209func (*awsRestxml_serializeOpPutBucketOwnershipControls) ID() string { 6210 return "OperationSerializer" 6211} 6212 6213func (m *awsRestxml_serializeOpPutBucketOwnershipControls) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6214 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6215) { 6216 request, ok := in.Request.(*smithyhttp.Request) 6217 if !ok { 6218 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6219 } 6220 6221 input, ok := in.Parameters.(*PutBucketOwnershipControlsInput) 6222 _ = input 6223 if !ok { 6224 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6225 } 6226 6227 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?ownershipControls") 6228 request.URL.Path = opPath 6229 if len(request.URL.RawQuery) > 0 { 6230 request.URL.RawQuery = "&" + opQuery 6231 } else { 6232 request.URL.RawQuery = opQuery 6233 } 6234 6235 request.Method = "PUT" 6236 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6237 if err != nil { 6238 return out, metadata, &smithy.SerializationError{Err: err} 6239 } 6240 6241 if err := awsRestxml_serializeOpHttpBindingsPutBucketOwnershipControlsInput(input, restEncoder); err != nil { 6242 return out, metadata, &smithy.SerializationError{Err: err} 6243 } 6244 6245 if input.OwnershipControls != nil { 6246 if !restEncoder.HasHeader("Content-Type") { 6247 restEncoder.SetHeader("Content-Type").String("application/xml") 6248 } 6249 6250 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6251 payloadRootAttr := []smithyxml.Attr{} 6252 payloadRoot := smithyxml.StartElement{ 6253 Name: smithyxml.Name{ 6254 Local: "OwnershipControls", 6255 }, 6256 Attr: payloadRootAttr, 6257 } 6258 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6259 if err := awsRestxml_serializeDocumentOwnershipControls(input.OwnershipControls, xmlEncoder.RootElement(payloadRoot)); err != nil { 6260 return out, metadata, &smithy.SerializationError{Err: err} 6261 } 6262 payload := bytes.NewReader(xmlEncoder.Bytes()) 6263 if request, err = request.SetStream(payload); err != nil { 6264 return out, metadata, &smithy.SerializationError{Err: err} 6265 } 6266 } 6267 6268 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6269 return out, metadata, &smithy.SerializationError{Err: err} 6270 } 6271 in.Request = request 6272 6273 return next.HandleSerialize(ctx, in) 6274} 6275func awsRestxml_serializeOpHttpBindingsPutBucketOwnershipControlsInput(v *PutBucketOwnershipControlsInput, encoder *httpbinding.Encoder) error { 6276 if v == nil { 6277 return fmt.Errorf("unsupported serialization of nil %T", v) 6278 } 6279 6280 if v.Bucket == nil || len(*v.Bucket) == 0 { 6281 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6282 } 6283 if v.Bucket != nil { 6284 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6285 return err 6286 } 6287 } 6288 6289 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6290 locationName := "Content-Md5" 6291 encoder.SetHeader(locationName).String(*v.ContentMD5) 6292 } 6293 6294 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6295 locationName := "X-Amz-Expected-Bucket-Owner" 6296 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6297 } 6298 6299 return nil 6300} 6301 6302type awsRestxml_serializeOpPutBucketPolicy struct { 6303} 6304 6305func (*awsRestxml_serializeOpPutBucketPolicy) ID() string { 6306 return "OperationSerializer" 6307} 6308 6309func (m *awsRestxml_serializeOpPutBucketPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6310 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6311) { 6312 request, ok := in.Request.(*smithyhttp.Request) 6313 if !ok { 6314 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6315 } 6316 6317 input, ok := in.Parameters.(*PutBucketPolicyInput) 6318 _ = input 6319 if !ok { 6320 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6321 } 6322 6323 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?policy") 6324 request.URL.Path = opPath 6325 if len(request.URL.RawQuery) > 0 { 6326 request.URL.RawQuery = "&" + opQuery 6327 } else { 6328 request.URL.RawQuery = opQuery 6329 } 6330 6331 request.Method = "PUT" 6332 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6333 if err != nil { 6334 return out, metadata, &smithy.SerializationError{Err: err} 6335 } 6336 6337 if err := awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(input, restEncoder); err != nil { 6338 return out, metadata, &smithy.SerializationError{Err: err} 6339 } 6340 6341 if input.Policy != nil { 6342 if !restEncoder.HasHeader("Content-Type") { 6343 restEncoder.SetHeader("Content-Type").String("text/plain") 6344 } 6345 6346 payload := strings.NewReader(*input.Policy) 6347 if request, err = request.SetStream(payload); err != nil { 6348 return out, metadata, &smithy.SerializationError{Err: err} 6349 } 6350 } 6351 6352 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6353 return out, metadata, &smithy.SerializationError{Err: err} 6354 } 6355 in.Request = request 6356 6357 return next.HandleSerialize(ctx, in) 6358} 6359func awsRestxml_serializeOpHttpBindingsPutBucketPolicyInput(v *PutBucketPolicyInput, encoder *httpbinding.Encoder) error { 6360 if v == nil { 6361 return fmt.Errorf("unsupported serialization of nil %T", v) 6362 } 6363 6364 if v.Bucket == nil || len(*v.Bucket) == 0 { 6365 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6366 } 6367 if v.Bucket != nil { 6368 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6369 return err 6370 } 6371 } 6372 6373 if v.ConfirmRemoveSelfBucketAccess { 6374 locationName := "X-Amz-Confirm-Remove-Self-Bucket-Access" 6375 encoder.SetHeader(locationName).Boolean(v.ConfirmRemoveSelfBucketAccess) 6376 } 6377 6378 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6379 locationName := "Content-Md5" 6380 encoder.SetHeader(locationName).String(*v.ContentMD5) 6381 } 6382 6383 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6384 locationName := "X-Amz-Expected-Bucket-Owner" 6385 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6386 } 6387 6388 return nil 6389} 6390 6391type awsRestxml_serializeOpPutBucketReplication struct { 6392} 6393 6394func (*awsRestxml_serializeOpPutBucketReplication) ID() string { 6395 return "OperationSerializer" 6396} 6397 6398func (m *awsRestxml_serializeOpPutBucketReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6399 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6400) { 6401 request, ok := in.Request.(*smithyhttp.Request) 6402 if !ok { 6403 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6404 } 6405 6406 input, ok := in.Parameters.(*PutBucketReplicationInput) 6407 _ = input 6408 if !ok { 6409 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6410 } 6411 6412 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?replication") 6413 request.URL.Path = opPath 6414 if len(request.URL.RawQuery) > 0 { 6415 request.URL.RawQuery = "&" + opQuery 6416 } else { 6417 request.URL.RawQuery = opQuery 6418 } 6419 6420 request.Method = "PUT" 6421 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6422 if err != nil { 6423 return out, metadata, &smithy.SerializationError{Err: err} 6424 } 6425 6426 if err := awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(input, restEncoder); err != nil { 6427 return out, metadata, &smithy.SerializationError{Err: err} 6428 } 6429 6430 if input.ReplicationConfiguration != nil { 6431 if !restEncoder.HasHeader("Content-Type") { 6432 restEncoder.SetHeader("Content-Type").String("application/xml") 6433 } 6434 6435 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6436 payloadRootAttr := []smithyxml.Attr{} 6437 payloadRoot := smithyxml.StartElement{ 6438 Name: smithyxml.Name{ 6439 Local: "ReplicationConfiguration", 6440 }, 6441 Attr: payloadRootAttr, 6442 } 6443 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6444 if err := awsRestxml_serializeDocumentReplicationConfiguration(input.ReplicationConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 6445 return out, metadata, &smithy.SerializationError{Err: err} 6446 } 6447 payload := bytes.NewReader(xmlEncoder.Bytes()) 6448 if request, err = request.SetStream(payload); err != nil { 6449 return out, metadata, &smithy.SerializationError{Err: err} 6450 } 6451 } 6452 6453 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6454 return out, metadata, &smithy.SerializationError{Err: err} 6455 } 6456 in.Request = request 6457 6458 return next.HandleSerialize(ctx, in) 6459} 6460func awsRestxml_serializeOpHttpBindingsPutBucketReplicationInput(v *PutBucketReplicationInput, encoder *httpbinding.Encoder) error { 6461 if v == nil { 6462 return fmt.Errorf("unsupported serialization of nil %T", v) 6463 } 6464 6465 if v.Bucket == nil || len(*v.Bucket) == 0 { 6466 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6467 } 6468 if v.Bucket != nil { 6469 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6470 return err 6471 } 6472 } 6473 6474 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6475 locationName := "Content-Md5" 6476 encoder.SetHeader(locationName).String(*v.ContentMD5) 6477 } 6478 6479 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6480 locationName := "X-Amz-Expected-Bucket-Owner" 6481 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6482 } 6483 6484 if v.Token != nil && len(*v.Token) > 0 { 6485 locationName := "X-Amz-Bucket-Object-Lock-Token" 6486 encoder.SetHeader(locationName).String(*v.Token) 6487 } 6488 6489 return nil 6490} 6491 6492type awsRestxml_serializeOpPutBucketRequestPayment struct { 6493} 6494 6495func (*awsRestxml_serializeOpPutBucketRequestPayment) ID() string { 6496 return "OperationSerializer" 6497} 6498 6499func (m *awsRestxml_serializeOpPutBucketRequestPayment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6500 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6501) { 6502 request, ok := in.Request.(*smithyhttp.Request) 6503 if !ok { 6504 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6505 } 6506 6507 input, ok := in.Parameters.(*PutBucketRequestPaymentInput) 6508 _ = input 6509 if !ok { 6510 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6511 } 6512 6513 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?requestPayment") 6514 request.URL.Path = opPath 6515 if len(request.URL.RawQuery) > 0 { 6516 request.URL.RawQuery = "&" + opQuery 6517 } else { 6518 request.URL.RawQuery = opQuery 6519 } 6520 6521 request.Method = "PUT" 6522 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6523 if err != nil { 6524 return out, metadata, &smithy.SerializationError{Err: err} 6525 } 6526 6527 if err := awsRestxml_serializeOpHttpBindingsPutBucketRequestPaymentInput(input, restEncoder); err != nil { 6528 return out, metadata, &smithy.SerializationError{Err: err} 6529 } 6530 6531 if input.RequestPaymentConfiguration != nil { 6532 if !restEncoder.HasHeader("Content-Type") { 6533 restEncoder.SetHeader("Content-Type").String("application/xml") 6534 } 6535 6536 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6537 payloadRootAttr := []smithyxml.Attr{} 6538 payloadRoot := smithyxml.StartElement{ 6539 Name: smithyxml.Name{ 6540 Local: "RequestPaymentConfiguration", 6541 }, 6542 Attr: payloadRootAttr, 6543 } 6544 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6545 if err := awsRestxml_serializeDocumentRequestPaymentConfiguration(input.RequestPaymentConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 6546 return out, metadata, &smithy.SerializationError{Err: err} 6547 } 6548 payload := bytes.NewReader(xmlEncoder.Bytes()) 6549 if request, err = request.SetStream(payload); err != nil { 6550 return out, metadata, &smithy.SerializationError{Err: err} 6551 } 6552 } 6553 6554 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6555 return out, metadata, &smithy.SerializationError{Err: err} 6556 } 6557 in.Request = request 6558 6559 return next.HandleSerialize(ctx, in) 6560} 6561func awsRestxml_serializeOpHttpBindingsPutBucketRequestPaymentInput(v *PutBucketRequestPaymentInput, encoder *httpbinding.Encoder) error { 6562 if v == nil { 6563 return fmt.Errorf("unsupported serialization of nil %T", v) 6564 } 6565 6566 if v.Bucket == nil || len(*v.Bucket) == 0 { 6567 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6568 } 6569 if v.Bucket != nil { 6570 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6571 return err 6572 } 6573 } 6574 6575 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6576 locationName := "Content-Md5" 6577 encoder.SetHeader(locationName).String(*v.ContentMD5) 6578 } 6579 6580 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6581 locationName := "X-Amz-Expected-Bucket-Owner" 6582 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6583 } 6584 6585 return nil 6586} 6587 6588type awsRestxml_serializeOpPutBucketTagging struct { 6589} 6590 6591func (*awsRestxml_serializeOpPutBucketTagging) ID() string { 6592 return "OperationSerializer" 6593} 6594 6595func (m *awsRestxml_serializeOpPutBucketTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6596 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6597) { 6598 request, ok := in.Request.(*smithyhttp.Request) 6599 if !ok { 6600 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6601 } 6602 6603 input, ok := in.Parameters.(*PutBucketTaggingInput) 6604 _ = input 6605 if !ok { 6606 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6607 } 6608 6609 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?tagging") 6610 request.URL.Path = opPath 6611 if len(request.URL.RawQuery) > 0 { 6612 request.URL.RawQuery = "&" + opQuery 6613 } else { 6614 request.URL.RawQuery = opQuery 6615 } 6616 6617 request.Method = "PUT" 6618 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6619 if err != nil { 6620 return out, metadata, &smithy.SerializationError{Err: err} 6621 } 6622 6623 if err := awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(input, restEncoder); err != nil { 6624 return out, metadata, &smithy.SerializationError{Err: err} 6625 } 6626 6627 if input.Tagging != nil { 6628 if !restEncoder.HasHeader("Content-Type") { 6629 restEncoder.SetHeader("Content-Type").String("application/xml") 6630 } 6631 6632 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6633 payloadRootAttr := []smithyxml.Attr{} 6634 payloadRoot := smithyxml.StartElement{ 6635 Name: smithyxml.Name{ 6636 Local: "Tagging", 6637 }, 6638 Attr: payloadRootAttr, 6639 } 6640 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6641 if err := awsRestxml_serializeDocumentTagging(input.Tagging, xmlEncoder.RootElement(payloadRoot)); err != nil { 6642 return out, metadata, &smithy.SerializationError{Err: err} 6643 } 6644 payload := bytes.NewReader(xmlEncoder.Bytes()) 6645 if request, err = request.SetStream(payload); err != nil { 6646 return out, metadata, &smithy.SerializationError{Err: err} 6647 } 6648 } 6649 6650 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6651 return out, metadata, &smithy.SerializationError{Err: err} 6652 } 6653 in.Request = request 6654 6655 return next.HandleSerialize(ctx, in) 6656} 6657func awsRestxml_serializeOpHttpBindingsPutBucketTaggingInput(v *PutBucketTaggingInput, encoder *httpbinding.Encoder) error { 6658 if v == nil { 6659 return fmt.Errorf("unsupported serialization of nil %T", v) 6660 } 6661 6662 if v.Bucket == nil || len(*v.Bucket) == 0 { 6663 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6664 } 6665 if v.Bucket != nil { 6666 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6667 return err 6668 } 6669 } 6670 6671 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6672 locationName := "Content-Md5" 6673 encoder.SetHeader(locationName).String(*v.ContentMD5) 6674 } 6675 6676 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6677 locationName := "X-Amz-Expected-Bucket-Owner" 6678 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6679 } 6680 6681 return nil 6682} 6683 6684type awsRestxml_serializeOpPutBucketVersioning struct { 6685} 6686 6687func (*awsRestxml_serializeOpPutBucketVersioning) ID() string { 6688 return "OperationSerializer" 6689} 6690 6691func (m *awsRestxml_serializeOpPutBucketVersioning) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6692 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6693) { 6694 request, ok := in.Request.(*smithyhttp.Request) 6695 if !ok { 6696 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6697 } 6698 6699 input, ok := in.Parameters.(*PutBucketVersioningInput) 6700 _ = input 6701 if !ok { 6702 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6703 } 6704 6705 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?versioning") 6706 request.URL.Path = opPath 6707 if len(request.URL.RawQuery) > 0 { 6708 request.URL.RawQuery = "&" + opQuery 6709 } else { 6710 request.URL.RawQuery = opQuery 6711 } 6712 6713 request.Method = "PUT" 6714 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6715 if err != nil { 6716 return out, metadata, &smithy.SerializationError{Err: err} 6717 } 6718 6719 if err := awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(input, restEncoder); err != nil { 6720 return out, metadata, &smithy.SerializationError{Err: err} 6721 } 6722 6723 if input.VersioningConfiguration != nil { 6724 if !restEncoder.HasHeader("Content-Type") { 6725 restEncoder.SetHeader("Content-Type").String("application/xml") 6726 } 6727 6728 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6729 payloadRootAttr := []smithyxml.Attr{} 6730 payloadRoot := smithyxml.StartElement{ 6731 Name: smithyxml.Name{ 6732 Local: "VersioningConfiguration", 6733 }, 6734 Attr: payloadRootAttr, 6735 } 6736 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6737 if err := awsRestxml_serializeDocumentVersioningConfiguration(input.VersioningConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 6738 return out, metadata, &smithy.SerializationError{Err: err} 6739 } 6740 payload := bytes.NewReader(xmlEncoder.Bytes()) 6741 if request, err = request.SetStream(payload); err != nil { 6742 return out, metadata, &smithy.SerializationError{Err: err} 6743 } 6744 } 6745 6746 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6747 return out, metadata, &smithy.SerializationError{Err: err} 6748 } 6749 in.Request = request 6750 6751 return next.HandleSerialize(ctx, in) 6752} 6753func awsRestxml_serializeOpHttpBindingsPutBucketVersioningInput(v *PutBucketVersioningInput, encoder *httpbinding.Encoder) error { 6754 if v == nil { 6755 return fmt.Errorf("unsupported serialization of nil %T", v) 6756 } 6757 6758 if v.Bucket == nil || len(*v.Bucket) == 0 { 6759 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6760 } 6761 if v.Bucket != nil { 6762 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6763 return err 6764 } 6765 } 6766 6767 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6768 locationName := "Content-Md5" 6769 encoder.SetHeader(locationName).String(*v.ContentMD5) 6770 } 6771 6772 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6773 locationName := "X-Amz-Expected-Bucket-Owner" 6774 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6775 } 6776 6777 if v.MFA != nil && len(*v.MFA) > 0 { 6778 locationName := "X-Amz-Mfa" 6779 encoder.SetHeader(locationName).String(*v.MFA) 6780 } 6781 6782 return nil 6783} 6784 6785type awsRestxml_serializeOpPutBucketWebsite struct { 6786} 6787 6788func (*awsRestxml_serializeOpPutBucketWebsite) ID() string { 6789 return "OperationSerializer" 6790} 6791 6792func (m *awsRestxml_serializeOpPutBucketWebsite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6793 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6794) { 6795 request, ok := in.Request.(*smithyhttp.Request) 6796 if !ok { 6797 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6798 } 6799 6800 input, ok := in.Parameters.(*PutBucketWebsiteInput) 6801 _ = input 6802 if !ok { 6803 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6804 } 6805 6806 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?website") 6807 request.URL.Path = opPath 6808 if len(request.URL.RawQuery) > 0 { 6809 request.URL.RawQuery = "&" + opQuery 6810 } else { 6811 request.URL.RawQuery = opQuery 6812 } 6813 6814 request.Method = "PUT" 6815 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6816 if err != nil { 6817 return out, metadata, &smithy.SerializationError{Err: err} 6818 } 6819 6820 if err := awsRestxml_serializeOpHttpBindingsPutBucketWebsiteInput(input, restEncoder); err != nil { 6821 return out, metadata, &smithy.SerializationError{Err: err} 6822 } 6823 6824 if input.WebsiteConfiguration != nil { 6825 if !restEncoder.HasHeader("Content-Type") { 6826 restEncoder.SetHeader("Content-Type").String("application/xml") 6827 } 6828 6829 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 6830 payloadRootAttr := []smithyxml.Attr{} 6831 payloadRoot := smithyxml.StartElement{ 6832 Name: smithyxml.Name{ 6833 Local: "WebsiteConfiguration", 6834 }, 6835 Attr: payloadRootAttr, 6836 } 6837 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 6838 if err := awsRestxml_serializeDocumentWebsiteConfiguration(input.WebsiteConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 6839 return out, metadata, &smithy.SerializationError{Err: err} 6840 } 6841 payload := bytes.NewReader(xmlEncoder.Bytes()) 6842 if request, err = request.SetStream(payload); err != nil { 6843 return out, metadata, &smithy.SerializationError{Err: err} 6844 } 6845 } 6846 6847 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6848 return out, metadata, &smithy.SerializationError{Err: err} 6849 } 6850 in.Request = request 6851 6852 return next.HandleSerialize(ctx, in) 6853} 6854func awsRestxml_serializeOpHttpBindingsPutBucketWebsiteInput(v *PutBucketWebsiteInput, encoder *httpbinding.Encoder) error { 6855 if v == nil { 6856 return fmt.Errorf("unsupported serialization of nil %T", v) 6857 } 6858 6859 if v.Bucket == nil || len(*v.Bucket) == 0 { 6860 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6861 } 6862 if v.Bucket != nil { 6863 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6864 return err 6865 } 6866 } 6867 6868 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6869 locationName := "Content-Md5" 6870 encoder.SetHeader(locationName).String(*v.ContentMD5) 6871 } 6872 6873 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6874 locationName := "X-Amz-Expected-Bucket-Owner" 6875 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 6876 } 6877 6878 return nil 6879} 6880 6881type awsRestxml_serializeOpPutObject struct { 6882} 6883 6884func (*awsRestxml_serializeOpPutObject) ID() string { 6885 return "OperationSerializer" 6886} 6887 6888func (m *awsRestxml_serializeOpPutObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 6889 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 6890) { 6891 request, ok := in.Request.(*smithyhttp.Request) 6892 if !ok { 6893 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 6894 } 6895 6896 input, ok := in.Parameters.(*PutObjectInput) 6897 _ = input 6898 if !ok { 6899 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 6900 } 6901 6902 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=PutObject") 6903 request.URL.Path = opPath 6904 if len(request.URL.RawQuery) > 0 { 6905 request.URL.RawQuery = "&" + opQuery 6906 } else { 6907 request.URL.RawQuery = opQuery 6908 } 6909 6910 request.Method = "PUT" 6911 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 6912 if err != nil { 6913 return out, metadata, &smithy.SerializationError{Err: err} 6914 } 6915 6916 if err := awsRestxml_serializeOpHttpBindingsPutObjectInput(input, restEncoder); err != nil { 6917 return out, metadata, &smithy.SerializationError{Err: err} 6918 } 6919 6920 if input.Body != nil { 6921 if !restEncoder.HasHeader("Content-Type") { 6922 restEncoder.SetHeader("Content-Type").String("application/octet-stream") 6923 } 6924 6925 payload := input.Body 6926 if request, err = request.SetStream(payload); err != nil { 6927 return out, metadata, &smithy.SerializationError{Err: err} 6928 } 6929 } 6930 6931 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 6932 return out, metadata, &smithy.SerializationError{Err: err} 6933 } 6934 in.Request = request 6935 6936 return next.HandleSerialize(ctx, in) 6937} 6938func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder *httpbinding.Encoder) error { 6939 if v == nil { 6940 return fmt.Errorf("unsupported serialization of nil %T", v) 6941 } 6942 6943 if len(v.ACL) > 0 { 6944 locationName := "X-Amz-Acl" 6945 encoder.SetHeader(locationName).String(string(v.ACL)) 6946 } 6947 6948 if v.Bucket == nil || len(*v.Bucket) == 0 { 6949 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 6950 } 6951 if v.Bucket != nil { 6952 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 6953 return err 6954 } 6955 } 6956 6957 if v.BucketKeyEnabled { 6958 locationName := "X-Amz-Server-Side-Encryption-Bucket-Key-Enabled" 6959 encoder.SetHeader(locationName).Boolean(v.BucketKeyEnabled) 6960 } 6961 6962 if v.CacheControl != nil && len(*v.CacheControl) > 0 { 6963 locationName := "Cache-Control" 6964 encoder.SetHeader(locationName).String(*v.CacheControl) 6965 } 6966 6967 if v.ContentDisposition != nil && len(*v.ContentDisposition) > 0 { 6968 locationName := "Content-Disposition" 6969 encoder.SetHeader(locationName).String(*v.ContentDisposition) 6970 } 6971 6972 if v.ContentEncoding != nil && len(*v.ContentEncoding) > 0 { 6973 locationName := "Content-Encoding" 6974 encoder.SetHeader(locationName).String(*v.ContentEncoding) 6975 } 6976 6977 if v.ContentLanguage != nil && len(*v.ContentLanguage) > 0 { 6978 locationName := "Content-Language" 6979 encoder.SetHeader(locationName).String(*v.ContentLanguage) 6980 } 6981 6982 if v.ContentLength != 0 { 6983 locationName := "Content-Length" 6984 encoder.SetHeader(locationName).Long(v.ContentLength) 6985 } 6986 6987 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 6988 locationName := "Content-Md5" 6989 encoder.SetHeader(locationName).String(*v.ContentMD5) 6990 } 6991 6992 if v.ContentType != nil && len(*v.ContentType) > 0 { 6993 locationName := "Content-Type" 6994 encoder.SetHeader(locationName).String(*v.ContentType) 6995 } 6996 6997 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 6998 locationName := "X-Amz-Expected-Bucket-Owner" 6999 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7000 } 7001 7002 if v.Expires != nil { 7003 locationName := "Expires" 7004 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.Expires)) 7005 } 7006 7007 if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { 7008 locationName := "X-Amz-Grant-Full-Control" 7009 encoder.SetHeader(locationName).String(*v.GrantFullControl) 7010 } 7011 7012 if v.GrantRead != nil && len(*v.GrantRead) > 0 { 7013 locationName := "X-Amz-Grant-Read" 7014 encoder.SetHeader(locationName).String(*v.GrantRead) 7015 } 7016 7017 if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { 7018 locationName := "X-Amz-Grant-Read-Acp" 7019 encoder.SetHeader(locationName).String(*v.GrantReadACP) 7020 } 7021 7022 if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { 7023 locationName := "X-Amz-Grant-Write-Acp" 7024 encoder.SetHeader(locationName).String(*v.GrantWriteACP) 7025 } 7026 7027 if v.Key == nil || len(*v.Key) == 0 { 7028 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7029 } 7030 if v.Key != nil { 7031 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 7032 return err 7033 } 7034 } 7035 7036 if v.Metadata != nil { 7037 hv := encoder.Headers("X-Amz-Meta-") 7038 for mapKey, mapVal := range v.Metadata { 7039 if len(mapVal) > 0 { 7040 hv.SetHeader(http.CanonicalHeaderKey(mapKey)).String(mapVal) 7041 } 7042 } 7043 } 7044 7045 if len(v.ObjectLockLegalHoldStatus) > 0 { 7046 locationName := "X-Amz-Object-Lock-Legal-Hold" 7047 encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus)) 7048 } 7049 7050 if len(v.ObjectLockMode) > 0 { 7051 locationName := "X-Amz-Object-Lock-Mode" 7052 encoder.SetHeader(locationName).String(string(v.ObjectLockMode)) 7053 } 7054 7055 if v.ObjectLockRetainUntilDate != nil { 7056 locationName := "X-Amz-Object-Lock-Retain-Until-Date" 7057 encoder.SetHeader(locationName).String(smithytime.FormatDateTime(*v.ObjectLockRetainUntilDate)) 7058 } 7059 7060 if len(v.RequestPayer) > 0 { 7061 locationName := "X-Amz-Request-Payer" 7062 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 7063 } 7064 7065 if len(v.ServerSideEncryption) > 0 { 7066 locationName := "X-Amz-Server-Side-Encryption" 7067 encoder.SetHeader(locationName).String(string(v.ServerSideEncryption)) 7068 } 7069 7070 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 7071 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 7072 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 7073 } 7074 7075 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 7076 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 7077 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 7078 } 7079 7080 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 7081 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 7082 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 7083 } 7084 7085 if v.SSEKMSEncryptionContext != nil && len(*v.SSEKMSEncryptionContext) > 0 { 7086 locationName := "X-Amz-Server-Side-Encryption-Context" 7087 encoder.SetHeader(locationName).String(*v.SSEKMSEncryptionContext) 7088 } 7089 7090 if v.SSEKMSKeyId != nil && len(*v.SSEKMSKeyId) > 0 { 7091 locationName := "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id" 7092 encoder.SetHeader(locationName).String(*v.SSEKMSKeyId) 7093 } 7094 7095 if len(v.StorageClass) > 0 { 7096 locationName := "X-Amz-Storage-Class" 7097 encoder.SetHeader(locationName).String(string(v.StorageClass)) 7098 } 7099 7100 if v.Tagging != nil && len(*v.Tagging) > 0 { 7101 locationName := "X-Amz-Tagging" 7102 encoder.SetHeader(locationName).String(*v.Tagging) 7103 } 7104 7105 if v.WebsiteRedirectLocation != nil && len(*v.WebsiteRedirectLocation) > 0 { 7106 locationName := "X-Amz-Website-Redirect-Location" 7107 encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) 7108 } 7109 7110 return nil 7111} 7112 7113type awsRestxml_serializeOpPutObjectAcl struct { 7114} 7115 7116func (*awsRestxml_serializeOpPutObjectAcl) ID() string { 7117 return "OperationSerializer" 7118} 7119 7120func (m *awsRestxml_serializeOpPutObjectAcl) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7121 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7122) { 7123 request, ok := in.Request.(*smithyhttp.Request) 7124 if !ok { 7125 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7126 } 7127 7128 input, ok := in.Parameters.(*PutObjectAclInput) 7129 _ = input 7130 if !ok { 7131 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7132 } 7133 7134 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?acl") 7135 request.URL.Path = opPath 7136 if len(request.URL.RawQuery) > 0 { 7137 request.URL.RawQuery = "&" + opQuery 7138 } else { 7139 request.URL.RawQuery = opQuery 7140 } 7141 7142 request.Method = "PUT" 7143 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7144 if err != nil { 7145 return out, metadata, &smithy.SerializationError{Err: err} 7146 } 7147 7148 if err := awsRestxml_serializeOpHttpBindingsPutObjectAclInput(input, restEncoder); err != nil { 7149 return out, metadata, &smithy.SerializationError{Err: err} 7150 } 7151 7152 if input.AccessControlPolicy != nil { 7153 if !restEncoder.HasHeader("Content-Type") { 7154 restEncoder.SetHeader("Content-Type").String("application/xml") 7155 } 7156 7157 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7158 payloadRootAttr := []smithyxml.Attr{} 7159 payloadRoot := smithyxml.StartElement{ 7160 Name: smithyxml.Name{ 7161 Local: "AccessControlPolicy", 7162 }, 7163 Attr: payloadRootAttr, 7164 } 7165 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7166 if err := awsRestxml_serializeDocumentAccessControlPolicy(input.AccessControlPolicy, xmlEncoder.RootElement(payloadRoot)); err != nil { 7167 return out, metadata, &smithy.SerializationError{Err: err} 7168 } 7169 payload := bytes.NewReader(xmlEncoder.Bytes()) 7170 if request, err = request.SetStream(payload); err != nil { 7171 return out, metadata, &smithy.SerializationError{Err: err} 7172 } 7173 } 7174 7175 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7176 return out, metadata, &smithy.SerializationError{Err: err} 7177 } 7178 in.Request = request 7179 7180 return next.HandleSerialize(ctx, in) 7181} 7182func awsRestxml_serializeOpHttpBindingsPutObjectAclInput(v *PutObjectAclInput, encoder *httpbinding.Encoder) error { 7183 if v == nil { 7184 return fmt.Errorf("unsupported serialization of nil %T", v) 7185 } 7186 7187 if len(v.ACL) > 0 { 7188 locationName := "X-Amz-Acl" 7189 encoder.SetHeader(locationName).String(string(v.ACL)) 7190 } 7191 7192 if v.Bucket == nil || len(*v.Bucket) == 0 { 7193 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7194 } 7195 if v.Bucket != nil { 7196 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7197 return err 7198 } 7199 } 7200 7201 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7202 locationName := "Content-Md5" 7203 encoder.SetHeader(locationName).String(*v.ContentMD5) 7204 } 7205 7206 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7207 locationName := "X-Amz-Expected-Bucket-Owner" 7208 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7209 } 7210 7211 if v.GrantFullControl != nil && len(*v.GrantFullControl) > 0 { 7212 locationName := "X-Amz-Grant-Full-Control" 7213 encoder.SetHeader(locationName).String(*v.GrantFullControl) 7214 } 7215 7216 if v.GrantRead != nil && len(*v.GrantRead) > 0 { 7217 locationName := "X-Amz-Grant-Read" 7218 encoder.SetHeader(locationName).String(*v.GrantRead) 7219 } 7220 7221 if v.GrantReadACP != nil && len(*v.GrantReadACP) > 0 { 7222 locationName := "X-Amz-Grant-Read-Acp" 7223 encoder.SetHeader(locationName).String(*v.GrantReadACP) 7224 } 7225 7226 if v.GrantWrite != nil && len(*v.GrantWrite) > 0 { 7227 locationName := "X-Amz-Grant-Write" 7228 encoder.SetHeader(locationName).String(*v.GrantWrite) 7229 } 7230 7231 if v.GrantWriteACP != nil && len(*v.GrantWriteACP) > 0 { 7232 locationName := "X-Amz-Grant-Write-Acp" 7233 encoder.SetHeader(locationName).String(*v.GrantWriteACP) 7234 } 7235 7236 if v.Key == nil || len(*v.Key) == 0 { 7237 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7238 } 7239 if v.Key != nil { 7240 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 7241 return err 7242 } 7243 } 7244 7245 if len(v.RequestPayer) > 0 { 7246 locationName := "X-Amz-Request-Payer" 7247 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 7248 } 7249 7250 if v.VersionId != nil { 7251 encoder.SetQuery("versionId").String(*v.VersionId) 7252 } 7253 7254 return nil 7255} 7256 7257type awsRestxml_serializeOpPutObjectLegalHold struct { 7258} 7259 7260func (*awsRestxml_serializeOpPutObjectLegalHold) ID() string { 7261 return "OperationSerializer" 7262} 7263 7264func (m *awsRestxml_serializeOpPutObjectLegalHold) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7265 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7266) { 7267 request, ok := in.Request.(*smithyhttp.Request) 7268 if !ok { 7269 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7270 } 7271 7272 input, ok := in.Parameters.(*PutObjectLegalHoldInput) 7273 _ = input 7274 if !ok { 7275 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7276 } 7277 7278 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?legal-hold") 7279 request.URL.Path = opPath 7280 if len(request.URL.RawQuery) > 0 { 7281 request.URL.RawQuery = "&" + opQuery 7282 } else { 7283 request.URL.RawQuery = opQuery 7284 } 7285 7286 request.Method = "PUT" 7287 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7288 if err != nil { 7289 return out, metadata, &smithy.SerializationError{Err: err} 7290 } 7291 7292 if err := awsRestxml_serializeOpHttpBindingsPutObjectLegalHoldInput(input, restEncoder); err != nil { 7293 return out, metadata, &smithy.SerializationError{Err: err} 7294 } 7295 7296 if input.LegalHold != nil { 7297 if !restEncoder.HasHeader("Content-Type") { 7298 restEncoder.SetHeader("Content-Type").String("application/xml") 7299 } 7300 7301 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7302 payloadRootAttr := []smithyxml.Attr{} 7303 payloadRoot := smithyxml.StartElement{ 7304 Name: smithyxml.Name{ 7305 Local: "ObjectLockLegalHold", 7306 }, 7307 Attr: payloadRootAttr, 7308 } 7309 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7310 if err := awsRestxml_serializeDocumentObjectLockLegalHold(input.LegalHold, xmlEncoder.RootElement(payloadRoot)); err != nil { 7311 return out, metadata, &smithy.SerializationError{Err: err} 7312 } 7313 payload := bytes.NewReader(xmlEncoder.Bytes()) 7314 if request, err = request.SetStream(payload); err != nil { 7315 return out, metadata, &smithy.SerializationError{Err: err} 7316 } 7317 } 7318 7319 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7320 return out, metadata, &smithy.SerializationError{Err: err} 7321 } 7322 in.Request = request 7323 7324 return next.HandleSerialize(ctx, in) 7325} 7326func awsRestxml_serializeOpHttpBindingsPutObjectLegalHoldInput(v *PutObjectLegalHoldInput, encoder *httpbinding.Encoder) error { 7327 if v == nil { 7328 return fmt.Errorf("unsupported serialization of nil %T", v) 7329 } 7330 7331 if v.Bucket == nil || len(*v.Bucket) == 0 { 7332 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7333 } 7334 if v.Bucket != nil { 7335 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7336 return err 7337 } 7338 } 7339 7340 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7341 locationName := "Content-Md5" 7342 encoder.SetHeader(locationName).String(*v.ContentMD5) 7343 } 7344 7345 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7346 locationName := "X-Amz-Expected-Bucket-Owner" 7347 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7348 } 7349 7350 if v.Key == nil || len(*v.Key) == 0 { 7351 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7352 } 7353 if v.Key != nil { 7354 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 7355 return err 7356 } 7357 } 7358 7359 if len(v.RequestPayer) > 0 { 7360 locationName := "X-Amz-Request-Payer" 7361 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 7362 } 7363 7364 if v.VersionId != nil { 7365 encoder.SetQuery("versionId").String(*v.VersionId) 7366 } 7367 7368 return nil 7369} 7370 7371type awsRestxml_serializeOpPutObjectLockConfiguration struct { 7372} 7373 7374func (*awsRestxml_serializeOpPutObjectLockConfiguration) ID() string { 7375 return "OperationSerializer" 7376} 7377 7378func (m *awsRestxml_serializeOpPutObjectLockConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7379 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7380) { 7381 request, ok := in.Request.(*smithyhttp.Request) 7382 if !ok { 7383 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7384 } 7385 7386 input, ok := in.Parameters.(*PutObjectLockConfigurationInput) 7387 _ = input 7388 if !ok { 7389 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7390 } 7391 7392 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?object-lock") 7393 request.URL.Path = opPath 7394 if len(request.URL.RawQuery) > 0 { 7395 request.URL.RawQuery = "&" + opQuery 7396 } else { 7397 request.URL.RawQuery = opQuery 7398 } 7399 7400 request.Method = "PUT" 7401 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7402 if err != nil { 7403 return out, metadata, &smithy.SerializationError{Err: err} 7404 } 7405 7406 if err := awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(input, restEncoder); err != nil { 7407 return out, metadata, &smithy.SerializationError{Err: err} 7408 } 7409 7410 if input.ObjectLockConfiguration != nil { 7411 if !restEncoder.HasHeader("Content-Type") { 7412 restEncoder.SetHeader("Content-Type").String("application/xml") 7413 } 7414 7415 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7416 payloadRootAttr := []smithyxml.Attr{} 7417 payloadRoot := smithyxml.StartElement{ 7418 Name: smithyxml.Name{ 7419 Local: "ObjectLockConfiguration", 7420 }, 7421 Attr: payloadRootAttr, 7422 } 7423 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7424 if err := awsRestxml_serializeDocumentObjectLockConfiguration(input.ObjectLockConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 7425 return out, metadata, &smithy.SerializationError{Err: err} 7426 } 7427 payload := bytes.NewReader(xmlEncoder.Bytes()) 7428 if request, err = request.SetStream(payload); err != nil { 7429 return out, metadata, &smithy.SerializationError{Err: err} 7430 } 7431 } 7432 7433 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7434 return out, metadata, &smithy.SerializationError{Err: err} 7435 } 7436 in.Request = request 7437 7438 return next.HandleSerialize(ctx, in) 7439} 7440func awsRestxml_serializeOpHttpBindingsPutObjectLockConfigurationInput(v *PutObjectLockConfigurationInput, encoder *httpbinding.Encoder) error { 7441 if v == nil { 7442 return fmt.Errorf("unsupported serialization of nil %T", v) 7443 } 7444 7445 if v.Bucket == nil || len(*v.Bucket) == 0 { 7446 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7447 } 7448 if v.Bucket != nil { 7449 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7450 return err 7451 } 7452 } 7453 7454 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7455 locationName := "Content-Md5" 7456 encoder.SetHeader(locationName).String(*v.ContentMD5) 7457 } 7458 7459 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7460 locationName := "X-Amz-Expected-Bucket-Owner" 7461 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7462 } 7463 7464 if len(v.RequestPayer) > 0 { 7465 locationName := "X-Amz-Request-Payer" 7466 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 7467 } 7468 7469 if v.Token != nil && len(*v.Token) > 0 { 7470 locationName := "X-Amz-Bucket-Object-Lock-Token" 7471 encoder.SetHeader(locationName).String(*v.Token) 7472 } 7473 7474 return nil 7475} 7476 7477type awsRestxml_serializeOpPutObjectRetention struct { 7478} 7479 7480func (*awsRestxml_serializeOpPutObjectRetention) ID() string { 7481 return "OperationSerializer" 7482} 7483 7484func (m *awsRestxml_serializeOpPutObjectRetention) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7485 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7486) { 7487 request, ok := in.Request.(*smithyhttp.Request) 7488 if !ok { 7489 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7490 } 7491 7492 input, ok := in.Parameters.(*PutObjectRetentionInput) 7493 _ = input 7494 if !ok { 7495 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7496 } 7497 7498 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?retention") 7499 request.URL.Path = opPath 7500 if len(request.URL.RawQuery) > 0 { 7501 request.URL.RawQuery = "&" + opQuery 7502 } else { 7503 request.URL.RawQuery = opQuery 7504 } 7505 7506 request.Method = "PUT" 7507 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7508 if err != nil { 7509 return out, metadata, &smithy.SerializationError{Err: err} 7510 } 7511 7512 if err := awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(input, restEncoder); err != nil { 7513 return out, metadata, &smithy.SerializationError{Err: err} 7514 } 7515 7516 if input.Retention != nil { 7517 if !restEncoder.HasHeader("Content-Type") { 7518 restEncoder.SetHeader("Content-Type").String("application/xml") 7519 } 7520 7521 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7522 payloadRootAttr := []smithyxml.Attr{} 7523 payloadRoot := smithyxml.StartElement{ 7524 Name: smithyxml.Name{ 7525 Local: "ObjectLockRetention", 7526 }, 7527 Attr: payloadRootAttr, 7528 } 7529 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7530 if err := awsRestxml_serializeDocumentObjectLockRetention(input.Retention, xmlEncoder.RootElement(payloadRoot)); err != nil { 7531 return out, metadata, &smithy.SerializationError{Err: err} 7532 } 7533 payload := bytes.NewReader(xmlEncoder.Bytes()) 7534 if request, err = request.SetStream(payload); err != nil { 7535 return out, metadata, &smithy.SerializationError{Err: err} 7536 } 7537 } 7538 7539 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7540 return out, metadata, &smithy.SerializationError{Err: err} 7541 } 7542 in.Request = request 7543 7544 return next.HandleSerialize(ctx, in) 7545} 7546func awsRestxml_serializeOpHttpBindingsPutObjectRetentionInput(v *PutObjectRetentionInput, encoder *httpbinding.Encoder) error { 7547 if v == nil { 7548 return fmt.Errorf("unsupported serialization of nil %T", v) 7549 } 7550 7551 if v.Bucket == nil || len(*v.Bucket) == 0 { 7552 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7553 } 7554 if v.Bucket != nil { 7555 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7556 return err 7557 } 7558 } 7559 7560 if v.BypassGovernanceRetention { 7561 locationName := "X-Amz-Bypass-Governance-Retention" 7562 encoder.SetHeader(locationName).Boolean(v.BypassGovernanceRetention) 7563 } 7564 7565 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7566 locationName := "Content-Md5" 7567 encoder.SetHeader(locationName).String(*v.ContentMD5) 7568 } 7569 7570 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7571 locationName := "X-Amz-Expected-Bucket-Owner" 7572 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7573 } 7574 7575 if v.Key == nil || len(*v.Key) == 0 { 7576 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7577 } 7578 if v.Key != nil { 7579 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 7580 return err 7581 } 7582 } 7583 7584 if len(v.RequestPayer) > 0 { 7585 locationName := "X-Amz-Request-Payer" 7586 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 7587 } 7588 7589 if v.VersionId != nil { 7590 encoder.SetQuery("versionId").String(*v.VersionId) 7591 } 7592 7593 return nil 7594} 7595 7596type awsRestxml_serializeOpPutObjectTagging struct { 7597} 7598 7599func (*awsRestxml_serializeOpPutObjectTagging) ID() string { 7600 return "OperationSerializer" 7601} 7602 7603func (m *awsRestxml_serializeOpPutObjectTagging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7604 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7605) { 7606 request, ok := in.Request.(*smithyhttp.Request) 7607 if !ok { 7608 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7609 } 7610 7611 input, ok := in.Parameters.(*PutObjectTaggingInput) 7612 _ = input 7613 if !ok { 7614 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7615 } 7616 7617 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?tagging") 7618 request.URL.Path = opPath 7619 if len(request.URL.RawQuery) > 0 { 7620 request.URL.RawQuery = "&" + opQuery 7621 } else { 7622 request.URL.RawQuery = opQuery 7623 } 7624 7625 request.Method = "PUT" 7626 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7627 if err != nil { 7628 return out, metadata, &smithy.SerializationError{Err: err} 7629 } 7630 7631 if err := awsRestxml_serializeOpHttpBindingsPutObjectTaggingInput(input, restEncoder); err != nil { 7632 return out, metadata, &smithy.SerializationError{Err: err} 7633 } 7634 7635 if input.Tagging != nil { 7636 if !restEncoder.HasHeader("Content-Type") { 7637 restEncoder.SetHeader("Content-Type").String("application/xml") 7638 } 7639 7640 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7641 payloadRootAttr := []smithyxml.Attr{} 7642 payloadRoot := smithyxml.StartElement{ 7643 Name: smithyxml.Name{ 7644 Local: "Tagging", 7645 }, 7646 Attr: payloadRootAttr, 7647 } 7648 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7649 if err := awsRestxml_serializeDocumentTagging(input.Tagging, xmlEncoder.RootElement(payloadRoot)); err != nil { 7650 return out, metadata, &smithy.SerializationError{Err: err} 7651 } 7652 payload := bytes.NewReader(xmlEncoder.Bytes()) 7653 if request, err = request.SetStream(payload); err != nil { 7654 return out, metadata, &smithy.SerializationError{Err: err} 7655 } 7656 } 7657 7658 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7659 return out, metadata, &smithy.SerializationError{Err: err} 7660 } 7661 in.Request = request 7662 7663 return next.HandleSerialize(ctx, in) 7664} 7665func awsRestxml_serializeOpHttpBindingsPutObjectTaggingInput(v *PutObjectTaggingInput, encoder *httpbinding.Encoder) error { 7666 if v == nil { 7667 return fmt.Errorf("unsupported serialization of nil %T", v) 7668 } 7669 7670 if v.Bucket == nil || len(*v.Bucket) == 0 { 7671 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7672 } 7673 if v.Bucket != nil { 7674 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7675 return err 7676 } 7677 } 7678 7679 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7680 locationName := "Content-Md5" 7681 encoder.SetHeader(locationName).String(*v.ContentMD5) 7682 } 7683 7684 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7685 locationName := "X-Amz-Expected-Bucket-Owner" 7686 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7687 } 7688 7689 if v.Key == nil || len(*v.Key) == 0 { 7690 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7691 } 7692 if v.Key != nil { 7693 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 7694 return err 7695 } 7696 } 7697 7698 if v.VersionId != nil { 7699 encoder.SetQuery("versionId").String(*v.VersionId) 7700 } 7701 7702 return nil 7703} 7704 7705type awsRestxml_serializeOpPutPublicAccessBlock struct { 7706} 7707 7708func (*awsRestxml_serializeOpPutPublicAccessBlock) ID() string { 7709 return "OperationSerializer" 7710} 7711 7712func (m *awsRestxml_serializeOpPutPublicAccessBlock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7713 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7714) { 7715 request, ok := in.Request.(*smithyhttp.Request) 7716 if !ok { 7717 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7718 } 7719 7720 input, ok := in.Parameters.(*PutPublicAccessBlockInput) 7721 _ = input 7722 if !ok { 7723 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7724 } 7725 7726 opPath, opQuery := httpbinding.SplitURI("/{Bucket}?publicAccessBlock") 7727 request.URL.Path = opPath 7728 if len(request.URL.RawQuery) > 0 { 7729 request.URL.RawQuery = "&" + opQuery 7730 } else { 7731 request.URL.RawQuery = opQuery 7732 } 7733 7734 request.Method = "PUT" 7735 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7736 if err != nil { 7737 return out, metadata, &smithy.SerializationError{Err: err} 7738 } 7739 7740 if err := awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(input, restEncoder); err != nil { 7741 return out, metadata, &smithy.SerializationError{Err: err} 7742 } 7743 7744 if input.PublicAccessBlockConfiguration != nil { 7745 if !restEncoder.HasHeader("Content-Type") { 7746 restEncoder.SetHeader("Content-Type").String("application/xml") 7747 } 7748 7749 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7750 payloadRootAttr := []smithyxml.Attr{} 7751 payloadRoot := smithyxml.StartElement{ 7752 Name: smithyxml.Name{ 7753 Local: "PublicAccessBlockConfiguration", 7754 }, 7755 Attr: payloadRootAttr, 7756 } 7757 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7758 if err := awsRestxml_serializeDocumentPublicAccessBlockConfiguration(input.PublicAccessBlockConfiguration, xmlEncoder.RootElement(payloadRoot)); err != nil { 7759 return out, metadata, &smithy.SerializationError{Err: err} 7760 } 7761 payload := bytes.NewReader(xmlEncoder.Bytes()) 7762 if request, err = request.SetStream(payload); err != nil { 7763 return out, metadata, &smithy.SerializationError{Err: err} 7764 } 7765 } 7766 7767 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7768 return out, metadata, &smithy.SerializationError{Err: err} 7769 } 7770 in.Request = request 7771 7772 return next.HandleSerialize(ctx, in) 7773} 7774func awsRestxml_serializeOpHttpBindingsPutPublicAccessBlockInput(v *PutPublicAccessBlockInput, encoder *httpbinding.Encoder) error { 7775 if v == nil { 7776 return fmt.Errorf("unsupported serialization of nil %T", v) 7777 } 7778 7779 if v.Bucket == nil || len(*v.Bucket) == 0 { 7780 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7781 } 7782 if v.Bucket != nil { 7783 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7784 return err 7785 } 7786 } 7787 7788 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7789 locationName := "Content-Md5" 7790 encoder.SetHeader(locationName).String(*v.ContentMD5) 7791 } 7792 7793 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7794 locationName := "X-Amz-Expected-Bucket-Owner" 7795 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7796 } 7797 7798 return nil 7799} 7800 7801type awsRestxml_serializeOpRestoreObject struct { 7802} 7803 7804func (*awsRestxml_serializeOpRestoreObject) ID() string { 7805 return "OperationSerializer" 7806} 7807 7808func (m *awsRestxml_serializeOpRestoreObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7809 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7810) { 7811 request, ok := in.Request.(*smithyhttp.Request) 7812 if !ok { 7813 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7814 } 7815 7816 input, ok := in.Parameters.(*RestoreObjectInput) 7817 _ = input 7818 if !ok { 7819 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7820 } 7821 7822 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?restore") 7823 request.URL.Path = opPath 7824 if len(request.URL.RawQuery) > 0 { 7825 request.URL.RawQuery = "&" + opQuery 7826 } else { 7827 request.URL.RawQuery = opQuery 7828 } 7829 7830 request.Method = "POST" 7831 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7832 if err != nil { 7833 return out, metadata, &smithy.SerializationError{Err: err} 7834 } 7835 7836 if err := awsRestxml_serializeOpHttpBindingsRestoreObjectInput(input, restEncoder); err != nil { 7837 return out, metadata, &smithy.SerializationError{Err: err} 7838 } 7839 7840 if input.RestoreRequest != nil { 7841 if !restEncoder.HasHeader("Content-Type") { 7842 restEncoder.SetHeader("Content-Type").String("application/xml") 7843 } 7844 7845 xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) 7846 payloadRootAttr := []smithyxml.Attr{} 7847 payloadRoot := smithyxml.StartElement{ 7848 Name: smithyxml.Name{ 7849 Local: "RestoreRequest", 7850 }, 7851 Attr: payloadRootAttr, 7852 } 7853 payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://s3.amazonaws.com/doc/2006-03-01/")) 7854 if err := awsRestxml_serializeDocumentRestoreRequest(input.RestoreRequest, xmlEncoder.RootElement(payloadRoot)); err != nil { 7855 return out, metadata, &smithy.SerializationError{Err: err} 7856 } 7857 payload := bytes.NewReader(xmlEncoder.Bytes()) 7858 if request, err = request.SetStream(payload); err != nil { 7859 return out, metadata, &smithy.SerializationError{Err: err} 7860 } 7861 } 7862 7863 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7864 return out, metadata, &smithy.SerializationError{Err: err} 7865 } 7866 in.Request = request 7867 7868 return next.HandleSerialize(ctx, in) 7869} 7870func awsRestxml_serializeOpHttpBindingsRestoreObjectInput(v *RestoreObjectInput, encoder *httpbinding.Encoder) error { 7871 if v == nil { 7872 return fmt.Errorf("unsupported serialization of nil %T", v) 7873 } 7874 7875 if v.Bucket == nil || len(*v.Bucket) == 0 { 7876 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7877 } 7878 if v.Bucket != nil { 7879 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7880 return err 7881 } 7882 } 7883 7884 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7885 locationName := "X-Amz-Expected-Bucket-Owner" 7886 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7887 } 7888 7889 if v.Key == nil || len(*v.Key) == 0 { 7890 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7891 } 7892 if v.Key != nil { 7893 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 7894 return err 7895 } 7896 } 7897 7898 if len(v.RequestPayer) > 0 { 7899 locationName := "X-Amz-Request-Payer" 7900 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 7901 } 7902 7903 if v.VersionId != nil { 7904 encoder.SetQuery("versionId").String(*v.VersionId) 7905 } 7906 7907 return nil 7908} 7909 7910type awsRestxml_serializeOpUploadPart struct { 7911} 7912 7913func (*awsRestxml_serializeOpUploadPart) ID() string { 7914 return "OperationSerializer" 7915} 7916 7917func (m *awsRestxml_serializeOpUploadPart) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 7918 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 7919) { 7920 request, ok := in.Request.(*smithyhttp.Request) 7921 if !ok { 7922 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 7923 } 7924 7925 input, ok := in.Parameters.(*UploadPartInput) 7926 _ = input 7927 if !ok { 7928 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 7929 } 7930 7931 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=UploadPart") 7932 request.URL.Path = opPath 7933 if len(request.URL.RawQuery) > 0 { 7934 request.URL.RawQuery = "&" + opQuery 7935 } else { 7936 request.URL.RawQuery = opQuery 7937 } 7938 7939 request.Method = "PUT" 7940 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 7941 if err != nil { 7942 return out, metadata, &smithy.SerializationError{Err: err} 7943 } 7944 7945 if err := awsRestxml_serializeOpHttpBindingsUploadPartInput(input, restEncoder); err != nil { 7946 return out, metadata, &smithy.SerializationError{Err: err} 7947 } 7948 7949 if input.Body != nil { 7950 if !restEncoder.HasHeader("Content-Type") { 7951 restEncoder.SetHeader("Content-Type").String("application/octet-stream") 7952 } 7953 7954 payload := input.Body 7955 if request, err = request.SetStream(payload); err != nil { 7956 return out, metadata, &smithy.SerializationError{Err: err} 7957 } 7958 } 7959 7960 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 7961 return out, metadata, &smithy.SerializationError{Err: err} 7962 } 7963 in.Request = request 7964 7965 return next.HandleSerialize(ctx, in) 7966} 7967func awsRestxml_serializeOpHttpBindingsUploadPartInput(v *UploadPartInput, encoder *httpbinding.Encoder) error { 7968 if v == nil { 7969 return fmt.Errorf("unsupported serialization of nil %T", v) 7970 } 7971 7972 if v.Bucket == nil || len(*v.Bucket) == 0 { 7973 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 7974 } 7975 if v.Bucket != nil { 7976 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 7977 return err 7978 } 7979 } 7980 7981 if v.ContentLength != 0 { 7982 locationName := "Content-Length" 7983 encoder.SetHeader(locationName).Long(v.ContentLength) 7984 } 7985 7986 if v.ContentMD5 != nil && len(*v.ContentMD5) > 0 { 7987 locationName := "Content-Md5" 7988 encoder.SetHeader(locationName).String(*v.ContentMD5) 7989 } 7990 7991 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 7992 locationName := "X-Amz-Expected-Bucket-Owner" 7993 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 7994 } 7995 7996 if v.Key == nil || len(*v.Key) == 0 { 7997 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 7998 } 7999 if v.Key != nil { 8000 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 8001 return err 8002 } 8003 } 8004 8005 if v.PartNumber != 0 { 8006 encoder.SetQuery("partNumber").Integer(v.PartNumber) 8007 } 8008 8009 if len(v.RequestPayer) > 0 { 8010 locationName := "X-Amz-Request-Payer" 8011 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 8012 } 8013 8014 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 8015 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 8016 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 8017 } 8018 8019 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 8020 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 8021 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 8022 } 8023 8024 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 8025 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 8026 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 8027 } 8028 8029 if v.UploadId != nil { 8030 encoder.SetQuery("uploadId").String(*v.UploadId) 8031 } 8032 8033 return nil 8034} 8035 8036type awsRestxml_serializeOpUploadPartCopy struct { 8037} 8038 8039func (*awsRestxml_serializeOpUploadPartCopy) ID() string { 8040 return "OperationSerializer" 8041} 8042 8043func (m *awsRestxml_serializeOpUploadPartCopy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( 8044 out middleware.SerializeOutput, metadata middleware.Metadata, err error, 8045) { 8046 request, ok := in.Request.(*smithyhttp.Request) 8047 if !ok { 8048 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} 8049 } 8050 8051 input, ok := in.Parameters.(*UploadPartCopyInput) 8052 _ = input 8053 if !ok { 8054 return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} 8055 } 8056 8057 opPath, opQuery := httpbinding.SplitURI("/{Bucket}/{Key+}?x-id=UploadPartCopy") 8058 request.URL.Path = opPath 8059 if len(request.URL.RawQuery) > 0 { 8060 request.URL.RawQuery = "&" + opQuery 8061 } else { 8062 request.URL.RawQuery = opQuery 8063 } 8064 8065 request.Method = "PUT" 8066 restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) 8067 if err != nil { 8068 return out, metadata, &smithy.SerializationError{Err: err} 8069 } 8070 8071 if err := awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(input, restEncoder); err != nil { 8072 return out, metadata, &smithy.SerializationError{Err: err} 8073 } 8074 8075 if request.Request, err = restEncoder.Encode(request.Request); err != nil { 8076 return out, metadata, &smithy.SerializationError{Err: err} 8077 } 8078 in.Request = request 8079 8080 return next.HandleSerialize(ctx, in) 8081} 8082func awsRestxml_serializeOpHttpBindingsUploadPartCopyInput(v *UploadPartCopyInput, encoder *httpbinding.Encoder) error { 8083 if v == nil { 8084 return fmt.Errorf("unsupported serialization of nil %T", v) 8085 } 8086 8087 if v.Bucket == nil || len(*v.Bucket) == 0 { 8088 return &smithy.SerializationError{Err: fmt.Errorf("input member Bucket must not be empty")} 8089 } 8090 if v.Bucket != nil { 8091 if err := encoder.SetURI("Bucket").String(*v.Bucket); err != nil { 8092 return err 8093 } 8094 } 8095 8096 if v.CopySource != nil && len(*v.CopySource) > 0 { 8097 locationName := "X-Amz-Copy-Source" 8098 encoder.SetHeader(locationName).String(*v.CopySource) 8099 } 8100 8101 if v.CopySourceIfMatch != nil && len(*v.CopySourceIfMatch) > 0 { 8102 locationName := "X-Amz-Copy-Source-If-Match" 8103 encoder.SetHeader(locationName).String(*v.CopySourceIfMatch) 8104 } 8105 8106 if v.CopySourceIfModifiedSince != nil { 8107 locationName := "X-Amz-Copy-Source-If-Modified-Since" 8108 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfModifiedSince)) 8109 } 8110 8111 if v.CopySourceIfNoneMatch != nil && len(*v.CopySourceIfNoneMatch) > 0 { 8112 locationName := "X-Amz-Copy-Source-If-None-Match" 8113 encoder.SetHeader(locationName).String(*v.CopySourceIfNoneMatch) 8114 } 8115 8116 if v.CopySourceIfUnmodifiedSince != nil { 8117 locationName := "X-Amz-Copy-Source-If-Unmodified-Since" 8118 encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.CopySourceIfUnmodifiedSince)) 8119 } 8120 8121 if v.CopySourceRange != nil && len(*v.CopySourceRange) > 0 { 8122 locationName := "X-Amz-Copy-Source-Range" 8123 encoder.SetHeader(locationName).String(*v.CopySourceRange) 8124 } 8125 8126 if v.CopySourceSSECustomerAlgorithm != nil && len(*v.CopySourceSSECustomerAlgorithm) > 0 { 8127 locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm" 8128 encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerAlgorithm) 8129 } 8130 8131 if v.CopySourceSSECustomerKey != nil && len(*v.CopySourceSSECustomerKey) > 0 { 8132 locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key" 8133 encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKey) 8134 } 8135 8136 if v.CopySourceSSECustomerKeyMD5 != nil && len(*v.CopySourceSSECustomerKeyMD5) > 0 { 8137 locationName := "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5" 8138 encoder.SetHeader(locationName).String(*v.CopySourceSSECustomerKeyMD5) 8139 } 8140 8141 if v.ExpectedBucketOwner != nil && len(*v.ExpectedBucketOwner) > 0 { 8142 locationName := "X-Amz-Expected-Bucket-Owner" 8143 encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) 8144 } 8145 8146 if v.ExpectedSourceBucketOwner != nil && len(*v.ExpectedSourceBucketOwner) > 0 { 8147 locationName := "X-Amz-Source-Expected-Bucket-Owner" 8148 encoder.SetHeader(locationName).String(*v.ExpectedSourceBucketOwner) 8149 } 8150 8151 if v.Key == nil || len(*v.Key) == 0 { 8152 return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} 8153 } 8154 if v.Key != nil { 8155 if err := encoder.SetURI("Key").String(*v.Key); err != nil { 8156 return err 8157 } 8158 } 8159 8160 if v.PartNumber != 0 { 8161 encoder.SetQuery("partNumber").Integer(v.PartNumber) 8162 } 8163 8164 if len(v.RequestPayer) > 0 { 8165 locationName := "X-Amz-Request-Payer" 8166 encoder.SetHeader(locationName).String(string(v.RequestPayer)) 8167 } 8168 8169 if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { 8170 locationName := "X-Amz-Server-Side-Encryption-Customer-Algorithm" 8171 encoder.SetHeader(locationName).String(*v.SSECustomerAlgorithm) 8172 } 8173 8174 if v.SSECustomerKey != nil && len(*v.SSECustomerKey) > 0 { 8175 locationName := "X-Amz-Server-Side-Encryption-Customer-Key" 8176 encoder.SetHeader(locationName).String(*v.SSECustomerKey) 8177 } 8178 8179 if v.SSECustomerKeyMD5 != nil && len(*v.SSECustomerKeyMD5) > 0 { 8180 locationName := "X-Amz-Server-Side-Encryption-Customer-Key-Md5" 8181 encoder.SetHeader(locationName).String(*v.SSECustomerKeyMD5) 8182 } 8183 8184 if v.UploadId != nil { 8185 encoder.SetQuery("uploadId").String(*v.UploadId) 8186 } 8187 8188 return nil 8189} 8190 8191func awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v *types.AbortIncompleteMultipartUpload, value smithyxml.Value) error { 8192 defer value.Close() 8193 if v.DaysAfterInitiation != 0 { 8194 rootAttr := []smithyxml.Attr{} 8195 root := smithyxml.StartElement{ 8196 Name: smithyxml.Name{ 8197 Local: "DaysAfterInitiation", 8198 }, 8199 Attr: rootAttr, 8200 } 8201 el := value.MemberElement(root) 8202 el.Integer(v.DaysAfterInitiation) 8203 } 8204 return nil 8205} 8206 8207func awsRestxml_serializeDocumentAccelerateConfiguration(v *types.AccelerateConfiguration, value smithyxml.Value) error { 8208 defer value.Close() 8209 if len(v.Status) > 0 { 8210 rootAttr := []smithyxml.Attr{} 8211 root := smithyxml.StartElement{ 8212 Name: smithyxml.Name{ 8213 Local: "Status", 8214 }, 8215 Attr: rootAttr, 8216 } 8217 el := value.MemberElement(root) 8218 el.String(string(v.Status)) 8219 } 8220 return nil 8221} 8222 8223func awsRestxml_serializeDocumentAccessControlPolicy(v *types.AccessControlPolicy, value smithyxml.Value) error { 8224 defer value.Close() 8225 if v.Grants != nil { 8226 rootAttr := []smithyxml.Attr{} 8227 root := smithyxml.StartElement{ 8228 Name: smithyxml.Name{ 8229 Local: "AccessControlList", 8230 }, 8231 Attr: rootAttr, 8232 } 8233 el := value.MemberElement(root) 8234 if err := awsRestxml_serializeDocumentGrants(v.Grants, el); err != nil { 8235 return err 8236 } 8237 } 8238 if v.Owner != nil { 8239 rootAttr := []smithyxml.Attr{} 8240 root := smithyxml.StartElement{ 8241 Name: smithyxml.Name{ 8242 Local: "Owner", 8243 }, 8244 Attr: rootAttr, 8245 } 8246 el := value.MemberElement(root) 8247 if err := awsRestxml_serializeDocumentOwner(v.Owner, el); err != nil { 8248 return err 8249 } 8250 } 8251 return nil 8252} 8253 8254func awsRestxml_serializeDocumentAccessControlTranslation(v *types.AccessControlTranslation, value smithyxml.Value) error { 8255 defer value.Close() 8256 if len(v.Owner) > 0 { 8257 rootAttr := []smithyxml.Attr{} 8258 root := smithyxml.StartElement{ 8259 Name: smithyxml.Name{ 8260 Local: "Owner", 8261 }, 8262 Attr: rootAttr, 8263 } 8264 el := value.MemberElement(root) 8265 el.String(string(v.Owner)) 8266 } 8267 return nil 8268} 8269 8270func awsRestxml_serializeDocumentAllowedHeaders(v []string, value smithyxml.Value) error { 8271 var array *smithyxml.Array 8272 if !value.IsFlattened() { 8273 defer value.Close() 8274 } 8275 array = value.Array() 8276 for i := range v { 8277 am := array.Member() 8278 am.String(v[i]) 8279 } 8280 return nil 8281} 8282 8283func awsRestxml_serializeDocumentAllowedMethods(v []string, value smithyxml.Value) error { 8284 var array *smithyxml.Array 8285 if !value.IsFlattened() { 8286 defer value.Close() 8287 } 8288 array = value.Array() 8289 for i := range v { 8290 am := array.Member() 8291 am.String(v[i]) 8292 } 8293 return nil 8294} 8295 8296func awsRestxml_serializeDocumentAllowedOrigins(v []string, value smithyxml.Value) error { 8297 var array *smithyxml.Array 8298 if !value.IsFlattened() { 8299 defer value.Close() 8300 } 8301 array = value.Array() 8302 for i := range v { 8303 am := array.Member() 8304 am.String(v[i]) 8305 } 8306 return nil 8307} 8308 8309func awsRestxml_serializeDocumentAnalyticsAndOperator(v *types.AnalyticsAndOperator, value smithyxml.Value) error { 8310 defer value.Close() 8311 if v.Prefix != nil { 8312 rootAttr := []smithyxml.Attr{} 8313 root := smithyxml.StartElement{ 8314 Name: smithyxml.Name{ 8315 Local: "Prefix", 8316 }, 8317 Attr: rootAttr, 8318 } 8319 el := value.MemberElement(root) 8320 el.String(*v.Prefix) 8321 } 8322 if v.Tags != nil { 8323 rootAttr := []smithyxml.Attr{} 8324 root := smithyxml.StartElement{ 8325 Name: smithyxml.Name{ 8326 Local: "Tag", 8327 }, 8328 Attr: rootAttr, 8329 } 8330 el := value.FlattenedElement(root) 8331 if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil { 8332 return err 8333 } 8334 } 8335 return nil 8336} 8337 8338func awsRestxml_serializeDocumentAnalyticsConfiguration(v *types.AnalyticsConfiguration, value smithyxml.Value) error { 8339 defer value.Close() 8340 if v.Filter != nil { 8341 rootAttr := []smithyxml.Attr{} 8342 root := smithyxml.StartElement{ 8343 Name: smithyxml.Name{ 8344 Local: "Filter", 8345 }, 8346 Attr: rootAttr, 8347 } 8348 el := value.MemberElement(root) 8349 if err := awsRestxml_serializeDocumentAnalyticsFilter(v.Filter, el); err != nil { 8350 return err 8351 } 8352 } 8353 if v.Id != nil { 8354 rootAttr := []smithyxml.Attr{} 8355 root := smithyxml.StartElement{ 8356 Name: smithyxml.Name{ 8357 Local: "Id", 8358 }, 8359 Attr: rootAttr, 8360 } 8361 el := value.MemberElement(root) 8362 el.String(*v.Id) 8363 } 8364 if v.StorageClassAnalysis != nil { 8365 rootAttr := []smithyxml.Attr{} 8366 root := smithyxml.StartElement{ 8367 Name: smithyxml.Name{ 8368 Local: "StorageClassAnalysis", 8369 }, 8370 Attr: rootAttr, 8371 } 8372 el := value.MemberElement(root) 8373 if err := awsRestxml_serializeDocumentStorageClassAnalysis(v.StorageClassAnalysis, el); err != nil { 8374 return err 8375 } 8376 } 8377 return nil 8378} 8379 8380func awsRestxml_serializeDocumentAnalyticsExportDestination(v *types.AnalyticsExportDestination, value smithyxml.Value) error { 8381 defer value.Close() 8382 if v.S3BucketDestination != nil { 8383 rootAttr := []smithyxml.Attr{} 8384 root := smithyxml.StartElement{ 8385 Name: smithyxml.Name{ 8386 Local: "S3BucketDestination", 8387 }, 8388 Attr: rootAttr, 8389 } 8390 el := value.MemberElement(root) 8391 if err := awsRestxml_serializeDocumentAnalyticsS3BucketDestination(v.S3BucketDestination, el); err != nil { 8392 return err 8393 } 8394 } 8395 return nil 8396} 8397 8398func awsRestxml_serializeDocumentAnalyticsFilter(v types.AnalyticsFilter, value smithyxml.Value) error { 8399 defer value.Close() 8400 switch uv := v.(type) { 8401 case *types.AnalyticsFilterMemberAnd: 8402 customMemberNameAttr := []smithyxml.Attr{} 8403 customMemberName := smithyxml.StartElement{ 8404 Name: smithyxml.Name{ 8405 Local: "And", 8406 }, 8407 Attr: customMemberNameAttr, 8408 } 8409 av := value.MemberElement(customMemberName) 8410 if err := awsRestxml_serializeDocumentAnalyticsAndOperator(&uv.Value, av); err != nil { 8411 return err 8412 } 8413 8414 case *types.AnalyticsFilterMemberPrefix: 8415 customMemberNameAttr := []smithyxml.Attr{} 8416 customMemberName := smithyxml.StartElement{ 8417 Name: smithyxml.Name{ 8418 Local: "Prefix", 8419 }, 8420 Attr: customMemberNameAttr, 8421 } 8422 av := value.MemberElement(customMemberName) 8423 av.String(uv.Value) 8424 8425 case *types.AnalyticsFilterMemberTag: 8426 customMemberNameAttr := []smithyxml.Attr{} 8427 customMemberName := smithyxml.StartElement{ 8428 Name: smithyxml.Name{ 8429 Local: "Tag", 8430 }, 8431 Attr: customMemberNameAttr, 8432 } 8433 av := value.MemberElement(customMemberName) 8434 if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil { 8435 return err 8436 } 8437 8438 default: 8439 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 8440 8441 } 8442 return nil 8443} 8444 8445func awsRestxml_serializeDocumentAnalyticsS3BucketDestination(v *types.AnalyticsS3BucketDestination, value smithyxml.Value) error { 8446 defer value.Close() 8447 if v.Bucket != nil { 8448 rootAttr := []smithyxml.Attr{} 8449 root := smithyxml.StartElement{ 8450 Name: smithyxml.Name{ 8451 Local: "Bucket", 8452 }, 8453 Attr: rootAttr, 8454 } 8455 el := value.MemberElement(root) 8456 el.String(*v.Bucket) 8457 } 8458 if v.BucketAccountId != nil { 8459 rootAttr := []smithyxml.Attr{} 8460 root := smithyxml.StartElement{ 8461 Name: smithyxml.Name{ 8462 Local: "BucketAccountId", 8463 }, 8464 Attr: rootAttr, 8465 } 8466 el := value.MemberElement(root) 8467 el.String(*v.BucketAccountId) 8468 } 8469 if len(v.Format) > 0 { 8470 rootAttr := []smithyxml.Attr{} 8471 root := smithyxml.StartElement{ 8472 Name: smithyxml.Name{ 8473 Local: "Format", 8474 }, 8475 Attr: rootAttr, 8476 } 8477 el := value.MemberElement(root) 8478 el.String(string(v.Format)) 8479 } 8480 if v.Prefix != nil { 8481 rootAttr := []smithyxml.Attr{} 8482 root := smithyxml.StartElement{ 8483 Name: smithyxml.Name{ 8484 Local: "Prefix", 8485 }, 8486 Attr: rootAttr, 8487 } 8488 el := value.MemberElement(root) 8489 el.String(*v.Prefix) 8490 } 8491 return nil 8492} 8493 8494func awsRestxml_serializeDocumentBucketLifecycleConfiguration(v *types.BucketLifecycleConfiguration, value smithyxml.Value) error { 8495 defer value.Close() 8496 if v.Rules != nil { 8497 rootAttr := []smithyxml.Attr{} 8498 root := smithyxml.StartElement{ 8499 Name: smithyxml.Name{ 8500 Local: "Rule", 8501 }, 8502 Attr: rootAttr, 8503 } 8504 el := value.FlattenedElement(root) 8505 if err := awsRestxml_serializeDocumentLifecycleRules(v.Rules, el); err != nil { 8506 return err 8507 } 8508 } 8509 return nil 8510} 8511 8512func awsRestxml_serializeDocumentBucketLoggingStatus(v *types.BucketLoggingStatus, value smithyxml.Value) error { 8513 defer value.Close() 8514 if v.LoggingEnabled != nil { 8515 rootAttr := []smithyxml.Attr{} 8516 root := smithyxml.StartElement{ 8517 Name: smithyxml.Name{ 8518 Local: "LoggingEnabled", 8519 }, 8520 Attr: rootAttr, 8521 } 8522 el := value.MemberElement(root) 8523 if err := awsRestxml_serializeDocumentLoggingEnabled(v.LoggingEnabled, el); err != nil { 8524 return err 8525 } 8526 } 8527 return nil 8528} 8529 8530func awsRestxml_serializeDocumentCompletedMultipartUpload(v *types.CompletedMultipartUpload, value smithyxml.Value) error { 8531 defer value.Close() 8532 if v.Parts != nil { 8533 rootAttr := []smithyxml.Attr{} 8534 root := smithyxml.StartElement{ 8535 Name: smithyxml.Name{ 8536 Local: "Part", 8537 }, 8538 Attr: rootAttr, 8539 } 8540 el := value.FlattenedElement(root) 8541 if err := awsRestxml_serializeDocumentCompletedPartList(v.Parts, el); err != nil { 8542 return err 8543 } 8544 } 8545 return nil 8546} 8547 8548func awsRestxml_serializeDocumentCompletedPart(v *types.CompletedPart, value smithyxml.Value) error { 8549 defer value.Close() 8550 if v.ETag != nil { 8551 rootAttr := []smithyxml.Attr{} 8552 root := smithyxml.StartElement{ 8553 Name: smithyxml.Name{ 8554 Local: "ETag", 8555 }, 8556 Attr: rootAttr, 8557 } 8558 el := value.MemberElement(root) 8559 el.String(*v.ETag) 8560 } 8561 if v.PartNumber != 0 { 8562 rootAttr := []smithyxml.Attr{} 8563 root := smithyxml.StartElement{ 8564 Name: smithyxml.Name{ 8565 Local: "PartNumber", 8566 }, 8567 Attr: rootAttr, 8568 } 8569 el := value.MemberElement(root) 8570 el.Integer(v.PartNumber) 8571 } 8572 return nil 8573} 8574 8575func awsRestxml_serializeDocumentCompletedPartList(v []types.CompletedPart, value smithyxml.Value) error { 8576 var array *smithyxml.Array 8577 if !value.IsFlattened() { 8578 defer value.Close() 8579 } 8580 array = value.Array() 8581 for i := range v { 8582 am := array.Member() 8583 if err := awsRestxml_serializeDocumentCompletedPart(&v[i], am); err != nil { 8584 return err 8585 } 8586 } 8587 return nil 8588} 8589 8590func awsRestxml_serializeDocumentCondition(v *types.Condition, value smithyxml.Value) error { 8591 defer value.Close() 8592 if v.HttpErrorCodeReturnedEquals != nil { 8593 rootAttr := []smithyxml.Attr{} 8594 root := smithyxml.StartElement{ 8595 Name: smithyxml.Name{ 8596 Local: "HttpErrorCodeReturnedEquals", 8597 }, 8598 Attr: rootAttr, 8599 } 8600 el := value.MemberElement(root) 8601 el.String(*v.HttpErrorCodeReturnedEquals) 8602 } 8603 if v.KeyPrefixEquals != nil { 8604 rootAttr := []smithyxml.Attr{} 8605 root := smithyxml.StartElement{ 8606 Name: smithyxml.Name{ 8607 Local: "KeyPrefixEquals", 8608 }, 8609 Attr: rootAttr, 8610 } 8611 el := value.MemberElement(root) 8612 el.String(*v.KeyPrefixEquals) 8613 } 8614 return nil 8615} 8616 8617func awsRestxml_serializeDocumentCORSConfiguration(v *types.CORSConfiguration, value smithyxml.Value) error { 8618 defer value.Close() 8619 if v.CORSRules != nil { 8620 rootAttr := []smithyxml.Attr{} 8621 root := smithyxml.StartElement{ 8622 Name: smithyxml.Name{ 8623 Local: "CORSRule", 8624 }, 8625 Attr: rootAttr, 8626 } 8627 el := value.FlattenedElement(root) 8628 if err := awsRestxml_serializeDocumentCORSRules(v.CORSRules, el); err != nil { 8629 return err 8630 } 8631 } 8632 return nil 8633} 8634 8635func awsRestxml_serializeDocumentCORSRule(v *types.CORSRule, value smithyxml.Value) error { 8636 defer value.Close() 8637 if v.AllowedHeaders != nil { 8638 rootAttr := []smithyxml.Attr{} 8639 root := smithyxml.StartElement{ 8640 Name: smithyxml.Name{ 8641 Local: "AllowedHeader", 8642 }, 8643 Attr: rootAttr, 8644 } 8645 el := value.FlattenedElement(root) 8646 if err := awsRestxml_serializeDocumentAllowedHeaders(v.AllowedHeaders, el); err != nil { 8647 return err 8648 } 8649 } 8650 if v.AllowedMethods != nil { 8651 rootAttr := []smithyxml.Attr{} 8652 root := smithyxml.StartElement{ 8653 Name: smithyxml.Name{ 8654 Local: "AllowedMethod", 8655 }, 8656 Attr: rootAttr, 8657 } 8658 el := value.FlattenedElement(root) 8659 if err := awsRestxml_serializeDocumentAllowedMethods(v.AllowedMethods, el); err != nil { 8660 return err 8661 } 8662 } 8663 if v.AllowedOrigins != nil { 8664 rootAttr := []smithyxml.Attr{} 8665 root := smithyxml.StartElement{ 8666 Name: smithyxml.Name{ 8667 Local: "AllowedOrigin", 8668 }, 8669 Attr: rootAttr, 8670 } 8671 el := value.FlattenedElement(root) 8672 if err := awsRestxml_serializeDocumentAllowedOrigins(v.AllowedOrigins, el); err != nil { 8673 return err 8674 } 8675 } 8676 if v.ExposeHeaders != nil { 8677 rootAttr := []smithyxml.Attr{} 8678 root := smithyxml.StartElement{ 8679 Name: smithyxml.Name{ 8680 Local: "ExposeHeader", 8681 }, 8682 Attr: rootAttr, 8683 } 8684 el := value.FlattenedElement(root) 8685 if err := awsRestxml_serializeDocumentExposeHeaders(v.ExposeHeaders, el); err != nil { 8686 return err 8687 } 8688 } 8689 if v.MaxAgeSeconds != 0 { 8690 rootAttr := []smithyxml.Attr{} 8691 root := smithyxml.StartElement{ 8692 Name: smithyxml.Name{ 8693 Local: "MaxAgeSeconds", 8694 }, 8695 Attr: rootAttr, 8696 } 8697 el := value.MemberElement(root) 8698 el.Integer(v.MaxAgeSeconds) 8699 } 8700 return nil 8701} 8702 8703func awsRestxml_serializeDocumentCORSRules(v []types.CORSRule, value smithyxml.Value) error { 8704 var array *smithyxml.Array 8705 if !value.IsFlattened() { 8706 defer value.Close() 8707 } 8708 array = value.Array() 8709 for i := range v { 8710 am := array.Member() 8711 if err := awsRestxml_serializeDocumentCORSRule(&v[i], am); err != nil { 8712 return err 8713 } 8714 } 8715 return nil 8716} 8717 8718func awsRestxml_serializeDocumentCreateBucketConfiguration(v *types.CreateBucketConfiguration, value smithyxml.Value) error { 8719 defer value.Close() 8720 if len(v.LocationConstraint) > 0 { 8721 rootAttr := []smithyxml.Attr{} 8722 root := smithyxml.StartElement{ 8723 Name: smithyxml.Name{ 8724 Local: "LocationConstraint", 8725 }, 8726 Attr: rootAttr, 8727 } 8728 el := value.MemberElement(root) 8729 el.String(string(v.LocationConstraint)) 8730 } 8731 return nil 8732} 8733 8734func awsRestxml_serializeDocumentCSVInput(v *types.CSVInput, value smithyxml.Value) error { 8735 defer value.Close() 8736 if v.AllowQuotedRecordDelimiter { 8737 rootAttr := []smithyxml.Attr{} 8738 root := smithyxml.StartElement{ 8739 Name: smithyxml.Name{ 8740 Local: "AllowQuotedRecordDelimiter", 8741 }, 8742 Attr: rootAttr, 8743 } 8744 el := value.MemberElement(root) 8745 el.Boolean(v.AllowQuotedRecordDelimiter) 8746 } 8747 if v.Comments != nil { 8748 rootAttr := []smithyxml.Attr{} 8749 root := smithyxml.StartElement{ 8750 Name: smithyxml.Name{ 8751 Local: "Comments", 8752 }, 8753 Attr: rootAttr, 8754 } 8755 el := value.MemberElement(root) 8756 el.String(*v.Comments) 8757 } 8758 if v.FieldDelimiter != nil { 8759 rootAttr := []smithyxml.Attr{} 8760 root := smithyxml.StartElement{ 8761 Name: smithyxml.Name{ 8762 Local: "FieldDelimiter", 8763 }, 8764 Attr: rootAttr, 8765 } 8766 el := value.MemberElement(root) 8767 el.String(*v.FieldDelimiter) 8768 } 8769 if len(v.FileHeaderInfo) > 0 { 8770 rootAttr := []smithyxml.Attr{} 8771 root := smithyxml.StartElement{ 8772 Name: smithyxml.Name{ 8773 Local: "FileHeaderInfo", 8774 }, 8775 Attr: rootAttr, 8776 } 8777 el := value.MemberElement(root) 8778 el.String(string(v.FileHeaderInfo)) 8779 } 8780 if v.QuoteCharacter != nil { 8781 rootAttr := []smithyxml.Attr{} 8782 root := smithyxml.StartElement{ 8783 Name: smithyxml.Name{ 8784 Local: "QuoteCharacter", 8785 }, 8786 Attr: rootAttr, 8787 } 8788 el := value.MemberElement(root) 8789 el.String(*v.QuoteCharacter) 8790 } 8791 if v.QuoteEscapeCharacter != nil { 8792 rootAttr := []smithyxml.Attr{} 8793 root := smithyxml.StartElement{ 8794 Name: smithyxml.Name{ 8795 Local: "QuoteEscapeCharacter", 8796 }, 8797 Attr: rootAttr, 8798 } 8799 el := value.MemberElement(root) 8800 el.String(*v.QuoteEscapeCharacter) 8801 } 8802 if v.RecordDelimiter != nil { 8803 rootAttr := []smithyxml.Attr{} 8804 root := smithyxml.StartElement{ 8805 Name: smithyxml.Name{ 8806 Local: "RecordDelimiter", 8807 }, 8808 Attr: rootAttr, 8809 } 8810 el := value.MemberElement(root) 8811 el.String(*v.RecordDelimiter) 8812 } 8813 return nil 8814} 8815 8816func awsRestxml_serializeDocumentCSVOutput(v *types.CSVOutput, value smithyxml.Value) error { 8817 defer value.Close() 8818 if v.FieldDelimiter != nil { 8819 rootAttr := []smithyxml.Attr{} 8820 root := smithyxml.StartElement{ 8821 Name: smithyxml.Name{ 8822 Local: "FieldDelimiter", 8823 }, 8824 Attr: rootAttr, 8825 } 8826 el := value.MemberElement(root) 8827 el.String(*v.FieldDelimiter) 8828 } 8829 if v.QuoteCharacter != nil { 8830 rootAttr := []smithyxml.Attr{} 8831 root := smithyxml.StartElement{ 8832 Name: smithyxml.Name{ 8833 Local: "QuoteCharacter", 8834 }, 8835 Attr: rootAttr, 8836 } 8837 el := value.MemberElement(root) 8838 el.String(*v.QuoteCharacter) 8839 } 8840 if v.QuoteEscapeCharacter != nil { 8841 rootAttr := []smithyxml.Attr{} 8842 root := smithyxml.StartElement{ 8843 Name: smithyxml.Name{ 8844 Local: "QuoteEscapeCharacter", 8845 }, 8846 Attr: rootAttr, 8847 } 8848 el := value.MemberElement(root) 8849 el.String(*v.QuoteEscapeCharacter) 8850 } 8851 if len(v.QuoteFields) > 0 { 8852 rootAttr := []smithyxml.Attr{} 8853 root := smithyxml.StartElement{ 8854 Name: smithyxml.Name{ 8855 Local: "QuoteFields", 8856 }, 8857 Attr: rootAttr, 8858 } 8859 el := value.MemberElement(root) 8860 el.String(string(v.QuoteFields)) 8861 } 8862 if v.RecordDelimiter != nil { 8863 rootAttr := []smithyxml.Attr{} 8864 root := smithyxml.StartElement{ 8865 Name: smithyxml.Name{ 8866 Local: "RecordDelimiter", 8867 }, 8868 Attr: rootAttr, 8869 } 8870 el := value.MemberElement(root) 8871 el.String(*v.RecordDelimiter) 8872 } 8873 return nil 8874} 8875 8876func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, value smithyxml.Value) error { 8877 defer value.Close() 8878 if v.Days != 0 { 8879 rootAttr := []smithyxml.Attr{} 8880 root := smithyxml.StartElement{ 8881 Name: smithyxml.Name{ 8882 Local: "Days", 8883 }, 8884 Attr: rootAttr, 8885 } 8886 el := value.MemberElement(root) 8887 el.Integer(v.Days) 8888 } 8889 if len(v.Mode) > 0 { 8890 rootAttr := []smithyxml.Attr{} 8891 root := smithyxml.StartElement{ 8892 Name: smithyxml.Name{ 8893 Local: "Mode", 8894 }, 8895 Attr: rootAttr, 8896 } 8897 el := value.MemberElement(root) 8898 el.String(string(v.Mode)) 8899 } 8900 if v.Years != 0 { 8901 rootAttr := []smithyxml.Attr{} 8902 root := smithyxml.StartElement{ 8903 Name: smithyxml.Name{ 8904 Local: "Years", 8905 }, 8906 Attr: rootAttr, 8907 } 8908 el := value.MemberElement(root) 8909 el.Integer(v.Years) 8910 } 8911 return nil 8912} 8913 8914func awsRestxml_serializeDocumentDelete(v *types.Delete, value smithyxml.Value) error { 8915 defer value.Close() 8916 if v.Objects != nil { 8917 rootAttr := []smithyxml.Attr{} 8918 root := smithyxml.StartElement{ 8919 Name: smithyxml.Name{ 8920 Local: "Object", 8921 }, 8922 Attr: rootAttr, 8923 } 8924 el := value.FlattenedElement(root) 8925 if err := awsRestxml_serializeDocumentObjectIdentifierList(v.Objects, el); err != nil { 8926 return err 8927 } 8928 } 8929 if v.Quiet { 8930 rootAttr := []smithyxml.Attr{} 8931 root := smithyxml.StartElement{ 8932 Name: smithyxml.Name{ 8933 Local: "Quiet", 8934 }, 8935 Attr: rootAttr, 8936 } 8937 el := value.MemberElement(root) 8938 el.Boolean(v.Quiet) 8939 } 8940 return nil 8941} 8942 8943func awsRestxml_serializeDocumentDeleteMarkerReplication(v *types.DeleteMarkerReplication, value smithyxml.Value) error { 8944 defer value.Close() 8945 if len(v.Status) > 0 { 8946 rootAttr := []smithyxml.Attr{} 8947 root := smithyxml.StartElement{ 8948 Name: smithyxml.Name{ 8949 Local: "Status", 8950 }, 8951 Attr: rootAttr, 8952 } 8953 el := value.MemberElement(root) 8954 el.String(string(v.Status)) 8955 } 8956 return nil 8957} 8958 8959func awsRestxml_serializeDocumentDestination(v *types.Destination, value smithyxml.Value) error { 8960 defer value.Close() 8961 if v.AccessControlTranslation != nil { 8962 rootAttr := []smithyxml.Attr{} 8963 root := smithyxml.StartElement{ 8964 Name: smithyxml.Name{ 8965 Local: "AccessControlTranslation", 8966 }, 8967 Attr: rootAttr, 8968 } 8969 el := value.MemberElement(root) 8970 if err := awsRestxml_serializeDocumentAccessControlTranslation(v.AccessControlTranslation, el); err != nil { 8971 return err 8972 } 8973 } 8974 if v.Account != nil { 8975 rootAttr := []smithyxml.Attr{} 8976 root := smithyxml.StartElement{ 8977 Name: smithyxml.Name{ 8978 Local: "Account", 8979 }, 8980 Attr: rootAttr, 8981 } 8982 el := value.MemberElement(root) 8983 el.String(*v.Account) 8984 } 8985 if v.Bucket != nil { 8986 rootAttr := []smithyxml.Attr{} 8987 root := smithyxml.StartElement{ 8988 Name: smithyxml.Name{ 8989 Local: "Bucket", 8990 }, 8991 Attr: rootAttr, 8992 } 8993 el := value.MemberElement(root) 8994 el.String(*v.Bucket) 8995 } 8996 if v.EncryptionConfiguration != nil { 8997 rootAttr := []smithyxml.Attr{} 8998 root := smithyxml.StartElement{ 8999 Name: smithyxml.Name{ 9000 Local: "EncryptionConfiguration", 9001 }, 9002 Attr: rootAttr, 9003 } 9004 el := value.MemberElement(root) 9005 if err := awsRestxml_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, el); err != nil { 9006 return err 9007 } 9008 } 9009 if v.Metrics != nil { 9010 rootAttr := []smithyxml.Attr{} 9011 root := smithyxml.StartElement{ 9012 Name: smithyxml.Name{ 9013 Local: "Metrics", 9014 }, 9015 Attr: rootAttr, 9016 } 9017 el := value.MemberElement(root) 9018 if err := awsRestxml_serializeDocumentMetrics(v.Metrics, el); err != nil { 9019 return err 9020 } 9021 } 9022 if v.ReplicationTime != nil { 9023 rootAttr := []smithyxml.Attr{} 9024 root := smithyxml.StartElement{ 9025 Name: smithyxml.Name{ 9026 Local: "ReplicationTime", 9027 }, 9028 Attr: rootAttr, 9029 } 9030 el := value.MemberElement(root) 9031 if err := awsRestxml_serializeDocumentReplicationTime(v.ReplicationTime, el); err != nil { 9032 return err 9033 } 9034 } 9035 if len(v.StorageClass) > 0 { 9036 rootAttr := []smithyxml.Attr{} 9037 root := smithyxml.StartElement{ 9038 Name: smithyxml.Name{ 9039 Local: "StorageClass", 9040 }, 9041 Attr: rootAttr, 9042 } 9043 el := value.MemberElement(root) 9044 el.String(string(v.StorageClass)) 9045 } 9046 return nil 9047} 9048 9049func awsRestxml_serializeDocumentEncryption(v *types.Encryption, value smithyxml.Value) error { 9050 defer value.Close() 9051 if len(v.EncryptionType) > 0 { 9052 rootAttr := []smithyxml.Attr{} 9053 root := smithyxml.StartElement{ 9054 Name: smithyxml.Name{ 9055 Local: "EncryptionType", 9056 }, 9057 Attr: rootAttr, 9058 } 9059 el := value.MemberElement(root) 9060 el.String(string(v.EncryptionType)) 9061 } 9062 if v.KMSContext != nil { 9063 rootAttr := []smithyxml.Attr{} 9064 root := smithyxml.StartElement{ 9065 Name: smithyxml.Name{ 9066 Local: "KMSContext", 9067 }, 9068 Attr: rootAttr, 9069 } 9070 el := value.MemberElement(root) 9071 el.String(*v.KMSContext) 9072 } 9073 if v.KMSKeyId != nil { 9074 rootAttr := []smithyxml.Attr{} 9075 root := smithyxml.StartElement{ 9076 Name: smithyxml.Name{ 9077 Local: "KMSKeyId", 9078 }, 9079 Attr: rootAttr, 9080 } 9081 el := value.MemberElement(root) 9082 el.String(*v.KMSKeyId) 9083 } 9084 return nil 9085} 9086 9087func awsRestxml_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyxml.Value) error { 9088 defer value.Close() 9089 if v.ReplicaKmsKeyID != nil { 9090 rootAttr := []smithyxml.Attr{} 9091 root := smithyxml.StartElement{ 9092 Name: smithyxml.Name{ 9093 Local: "ReplicaKmsKeyID", 9094 }, 9095 Attr: rootAttr, 9096 } 9097 el := value.MemberElement(root) 9098 el.String(*v.ReplicaKmsKeyID) 9099 } 9100 return nil 9101} 9102 9103func awsRestxml_serializeDocumentErrorDocument(v *types.ErrorDocument, value smithyxml.Value) error { 9104 defer value.Close() 9105 if v.Key != nil { 9106 rootAttr := []smithyxml.Attr{} 9107 root := smithyxml.StartElement{ 9108 Name: smithyxml.Name{ 9109 Local: "Key", 9110 }, 9111 Attr: rootAttr, 9112 } 9113 el := value.MemberElement(root) 9114 el.String(*v.Key) 9115 } 9116 return nil 9117} 9118 9119func awsRestxml_serializeDocumentEventList(v []types.Event, value smithyxml.Value) error { 9120 var array *smithyxml.Array 9121 if !value.IsFlattened() { 9122 defer value.Close() 9123 } 9124 array = value.Array() 9125 for i := range v { 9126 am := array.Member() 9127 am.String(string(v[i])) 9128 } 9129 return nil 9130} 9131 9132func awsRestxml_serializeDocumentExistingObjectReplication(v *types.ExistingObjectReplication, value smithyxml.Value) error { 9133 defer value.Close() 9134 if len(v.Status) > 0 { 9135 rootAttr := []smithyxml.Attr{} 9136 root := smithyxml.StartElement{ 9137 Name: smithyxml.Name{ 9138 Local: "Status", 9139 }, 9140 Attr: rootAttr, 9141 } 9142 el := value.MemberElement(root) 9143 el.String(string(v.Status)) 9144 } 9145 return nil 9146} 9147 9148func awsRestxml_serializeDocumentExposeHeaders(v []string, value smithyxml.Value) error { 9149 var array *smithyxml.Array 9150 if !value.IsFlattened() { 9151 defer value.Close() 9152 } 9153 array = value.Array() 9154 for i := range v { 9155 am := array.Member() 9156 am.String(v[i]) 9157 } 9158 return nil 9159} 9160 9161func awsRestxml_serializeDocumentFilterRule(v *types.FilterRule, value smithyxml.Value) error { 9162 defer value.Close() 9163 if len(v.Name) > 0 { 9164 rootAttr := []smithyxml.Attr{} 9165 root := smithyxml.StartElement{ 9166 Name: smithyxml.Name{ 9167 Local: "Name", 9168 }, 9169 Attr: rootAttr, 9170 } 9171 el := value.MemberElement(root) 9172 el.String(string(v.Name)) 9173 } 9174 if v.Value != nil { 9175 rootAttr := []smithyxml.Attr{} 9176 root := smithyxml.StartElement{ 9177 Name: smithyxml.Name{ 9178 Local: "Value", 9179 }, 9180 Attr: rootAttr, 9181 } 9182 el := value.MemberElement(root) 9183 el.String(*v.Value) 9184 } 9185 return nil 9186} 9187 9188func awsRestxml_serializeDocumentFilterRuleList(v []types.FilterRule, value smithyxml.Value) error { 9189 var array *smithyxml.Array 9190 if !value.IsFlattened() { 9191 defer value.Close() 9192 } 9193 array = value.Array() 9194 for i := range v { 9195 am := array.Member() 9196 if err := awsRestxml_serializeDocumentFilterRule(&v[i], am); err != nil { 9197 return err 9198 } 9199 } 9200 return nil 9201} 9202 9203func awsRestxml_serializeDocumentGlacierJobParameters(v *types.GlacierJobParameters, value smithyxml.Value) error { 9204 defer value.Close() 9205 if len(v.Tier) > 0 { 9206 rootAttr := []smithyxml.Attr{} 9207 root := smithyxml.StartElement{ 9208 Name: smithyxml.Name{ 9209 Local: "Tier", 9210 }, 9211 Attr: rootAttr, 9212 } 9213 el := value.MemberElement(root) 9214 el.String(string(v.Tier)) 9215 } 9216 return nil 9217} 9218 9219func awsRestxml_serializeDocumentGrant(v *types.Grant, value smithyxml.Value) error { 9220 defer value.Close() 9221 if v.Grantee != nil { 9222 rootAttr := []smithyxml.Attr{} 9223 root := smithyxml.StartElement{ 9224 Name: smithyxml.Name{ 9225 Local: "Grantee", 9226 }, 9227 Attr: rootAttr, 9228 } 9229 el := value.MemberElement(root) 9230 if err := awsRestxml_serializeDocumentGrantee(v.Grantee, el); err != nil { 9231 return err 9232 } 9233 } 9234 if len(v.Permission) > 0 { 9235 rootAttr := []smithyxml.Attr{} 9236 root := smithyxml.StartElement{ 9237 Name: smithyxml.Name{ 9238 Local: "Permission", 9239 }, 9240 Attr: rootAttr, 9241 } 9242 el := value.MemberElement(root) 9243 el.String(string(v.Permission)) 9244 } 9245 return nil 9246} 9247 9248func awsRestxml_serializeDocumentGrantee(v *types.Grantee, value smithyxml.Value) error { 9249 defer value.Close() 9250 if v.DisplayName != nil { 9251 rootAttr := []smithyxml.Attr{} 9252 root := smithyxml.StartElement{ 9253 Name: smithyxml.Name{ 9254 Local: "DisplayName", 9255 }, 9256 Attr: rootAttr, 9257 } 9258 el := value.MemberElement(root) 9259 el.String(*v.DisplayName) 9260 } 9261 if v.EmailAddress != nil { 9262 rootAttr := []smithyxml.Attr{} 9263 root := smithyxml.StartElement{ 9264 Name: smithyxml.Name{ 9265 Local: "EmailAddress", 9266 }, 9267 Attr: rootAttr, 9268 } 9269 el := value.MemberElement(root) 9270 el.String(*v.EmailAddress) 9271 } 9272 if v.ID != nil { 9273 rootAttr := []smithyxml.Attr{} 9274 root := smithyxml.StartElement{ 9275 Name: smithyxml.Name{ 9276 Local: "ID", 9277 }, 9278 Attr: rootAttr, 9279 } 9280 el := value.MemberElement(root) 9281 el.String(*v.ID) 9282 } 9283 if v.URI != nil { 9284 rootAttr := []smithyxml.Attr{} 9285 root := smithyxml.StartElement{ 9286 Name: smithyxml.Name{ 9287 Local: "URI", 9288 }, 9289 Attr: rootAttr, 9290 } 9291 el := value.MemberElement(root) 9292 el.String(*v.URI) 9293 } 9294 return nil 9295} 9296 9297func awsRestxml_serializeDocumentGrants(v []types.Grant, value smithyxml.Value) error { 9298 var array *smithyxml.Array 9299 if !value.IsFlattened() { 9300 defer value.Close() 9301 } 9302 customMemberNameAttr := []smithyxml.Attr{} 9303 customMemberName := smithyxml.StartElement{ 9304 Name: smithyxml.Name{ 9305 Local: "Grant", 9306 }, 9307 Attr: customMemberNameAttr, 9308 } 9309 array = value.ArrayWithCustomName(customMemberName) 9310 for i := range v { 9311 am := array.Member() 9312 if err := awsRestxml_serializeDocumentGrant(&v[i], am); err != nil { 9313 return err 9314 } 9315 } 9316 return nil 9317} 9318 9319func awsRestxml_serializeDocumentIndexDocument(v *types.IndexDocument, value smithyxml.Value) error { 9320 defer value.Close() 9321 if v.Suffix != nil { 9322 rootAttr := []smithyxml.Attr{} 9323 root := smithyxml.StartElement{ 9324 Name: smithyxml.Name{ 9325 Local: "Suffix", 9326 }, 9327 Attr: rootAttr, 9328 } 9329 el := value.MemberElement(root) 9330 el.String(*v.Suffix) 9331 } 9332 return nil 9333} 9334 9335func awsRestxml_serializeDocumentInputSerialization(v *types.InputSerialization, value smithyxml.Value) error { 9336 defer value.Close() 9337 if len(v.CompressionType) > 0 { 9338 rootAttr := []smithyxml.Attr{} 9339 root := smithyxml.StartElement{ 9340 Name: smithyxml.Name{ 9341 Local: "CompressionType", 9342 }, 9343 Attr: rootAttr, 9344 } 9345 el := value.MemberElement(root) 9346 el.String(string(v.CompressionType)) 9347 } 9348 if v.CSV != nil { 9349 rootAttr := []smithyxml.Attr{} 9350 root := smithyxml.StartElement{ 9351 Name: smithyxml.Name{ 9352 Local: "CSV", 9353 }, 9354 Attr: rootAttr, 9355 } 9356 el := value.MemberElement(root) 9357 if err := awsRestxml_serializeDocumentCSVInput(v.CSV, el); err != nil { 9358 return err 9359 } 9360 } 9361 if v.JSON != nil { 9362 rootAttr := []smithyxml.Attr{} 9363 root := smithyxml.StartElement{ 9364 Name: smithyxml.Name{ 9365 Local: "JSON", 9366 }, 9367 Attr: rootAttr, 9368 } 9369 el := value.MemberElement(root) 9370 if err := awsRestxml_serializeDocumentJSONInput(v.JSON, el); err != nil { 9371 return err 9372 } 9373 } 9374 if v.Parquet != nil { 9375 rootAttr := []smithyxml.Attr{} 9376 root := smithyxml.StartElement{ 9377 Name: smithyxml.Name{ 9378 Local: "Parquet", 9379 }, 9380 Attr: rootAttr, 9381 } 9382 el := value.MemberElement(root) 9383 if err := awsRestxml_serializeDocumentParquetInput(v.Parquet, el); err != nil { 9384 return err 9385 } 9386 } 9387 return nil 9388} 9389 9390func awsRestxml_serializeDocumentIntelligentTieringAndOperator(v *types.IntelligentTieringAndOperator, value smithyxml.Value) error { 9391 defer value.Close() 9392 if v.Prefix != nil { 9393 rootAttr := []smithyxml.Attr{} 9394 root := smithyxml.StartElement{ 9395 Name: smithyxml.Name{ 9396 Local: "Prefix", 9397 }, 9398 Attr: rootAttr, 9399 } 9400 el := value.MemberElement(root) 9401 el.String(*v.Prefix) 9402 } 9403 if v.Tags != nil { 9404 rootAttr := []smithyxml.Attr{} 9405 root := smithyxml.StartElement{ 9406 Name: smithyxml.Name{ 9407 Local: "Tag", 9408 }, 9409 Attr: rootAttr, 9410 } 9411 el := value.FlattenedElement(root) 9412 if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil { 9413 return err 9414 } 9415 } 9416 return nil 9417} 9418 9419func awsRestxml_serializeDocumentIntelligentTieringConfiguration(v *types.IntelligentTieringConfiguration, value smithyxml.Value) error { 9420 defer value.Close() 9421 if v.Filter != nil { 9422 rootAttr := []smithyxml.Attr{} 9423 root := smithyxml.StartElement{ 9424 Name: smithyxml.Name{ 9425 Local: "Filter", 9426 }, 9427 Attr: rootAttr, 9428 } 9429 el := value.MemberElement(root) 9430 if err := awsRestxml_serializeDocumentIntelligentTieringFilter(v.Filter, el); err != nil { 9431 return err 9432 } 9433 } 9434 if v.Id != nil { 9435 rootAttr := []smithyxml.Attr{} 9436 root := smithyxml.StartElement{ 9437 Name: smithyxml.Name{ 9438 Local: "Id", 9439 }, 9440 Attr: rootAttr, 9441 } 9442 el := value.MemberElement(root) 9443 el.String(*v.Id) 9444 } 9445 if len(v.Status) > 0 { 9446 rootAttr := []smithyxml.Attr{} 9447 root := smithyxml.StartElement{ 9448 Name: smithyxml.Name{ 9449 Local: "Status", 9450 }, 9451 Attr: rootAttr, 9452 } 9453 el := value.MemberElement(root) 9454 el.String(string(v.Status)) 9455 } 9456 if v.Tierings != nil { 9457 rootAttr := []smithyxml.Attr{} 9458 root := smithyxml.StartElement{ 9459 Name: smithyxml.Name{ 9460 Local: "Tiering", 9461 }, 9462 Attr: rootAttr, 9463 } 9464 el := value.FlattenedElement(root) 9465 if err := awsRestxml_serializeDocumentTieringList(v.Tierings, el); err != nil { 9466 return err 9467 } 9468 } 9469 return nil 9470} 9471 9472func awsRestxml_serializeDocumentIntelligentTieringFilter(v *types.IntelligentTieringFilter, value smithyxml.Value) error { 9473 defer value.Close() 9474 if v.And != nil { 9475 rootAttr := []smithyxml.Attr{} 9476 root := smithyxml.StartElement{ 9477 Name: smithyxml.Name{ 9478 Local: "And", 9479 }, 9480 Attr: rootAttr, 9481 } 9482 el := value.MemberElement(root) 9483 if err := awsRestxml_serializeDocumentIntelligentTieringAndOperator(v.And, el); err != nil { 9484 return err 9485 } 9486 } 9487 if v.Prefix != nil { 9488 rootAttr := []smithyxml.Attr{} 9489 root := smithyxml.StartElement{ 9490 Name: smithyxml.Name{ 9491 Local: "Prefix", 9492 }, 9493 Attr: rootAttr, 9494 } 9495 el := value.MemberElement(root) 9496 el.String(*v.Prefix) 9497 } 9498 if v.Tag != nil { 9499 rootAttr := []smithyxml.Attr{} 9500 root := smithyxml.StartElement{ 9501 Name: smithyxml.Name{ 9502 Local: "Tag", 9503 }, 9504 Attr: rootAttr, 9505 } 9506 el := value.MemberElement(root) 9507 if err := awsRestxml_serializeDocumentTag(v.Tag, el); err != nil { 9508 return err 9509 } 9510 } 9511 return nil 9512} 9513 9514func awsRestxml_serializeDocumentInventoryConfiguration(v *types.InventoryConfiguration, value smithyxml.Value) error { 9515 defer value.Close() 9516 if v.Destination != nil { 9517 rootAttr := []smithyxml.Attr{} 9518 root := smithyxml.StartElement{ 9519 Name: smithyxml.Name{ 9520 Local: "Destination", 9521 }, 9522 Attr: rootAttr, 9523 } 9524 el := value.MemberElement(root) 9525 if err := awsRestxml_serializeDocumentInventoryDestination(v.Destination, el); err != nil { 9526 return err 9527 } 9528 } 9529 if v.Filter != nil { 9530 rootAttr := []smithyxml.Attr{} 9531 root := smithyxml.StartElement{ 9532 Name: smithyxml.Name{ 9533 Local: "Filter", 9534 }, 9535 Attr: rootAttr, 9536 } 9537 el := value.MemberElement(root) 9538 if err := awsRestxml_serializeDocumentInventoryFilter(v.Filter, el); err != nil { 9539 return err 9540 } 9541 } 9542 if v.Id != nil { 9543 rootAttr := []smithyxml.Attr{} 9544 root := smithyxml.StartElement{ 9545 Name: smithyxml.Name{ 9546 Local: "Id", 9547 }, 9548 Attr: rootAttr, 9549 } 9550 el := value.MemberElement(root) 9551 el.String(*v.Id) 9552 } 9553 if len(v.IncludedObjectVersions) > 0 { 9554 rootAttr := []smithyxml.Attr{} 9555 root := smithyxml.StartElement{ 9556 Name: smithyxml.Name{ 9557 Local: "IncludedObjectVersions", 9558 }, 9559 Attr: rootAttr, 9560 } 9561 el := value.MemberElement(root) 9562 el.String(string(v.IncludedObjectVersions)) 9563 } 9564 if v.IsEnabled { 9565 rootAttr := []smithyxml.Attr{} 9566 root := smithyxml.StartElement{ 9567 Name: smithyxml.Name{ 9568 Local: "IsEnabled", 9569 }, 9570 Attr: rootAttr, 9571 } 9572 el := value.MemberElement(root) 9573 el.Boolean(v.IsEnabled) 9574 } 9575 if v.OptionalFields != nil { 9576 rootAttr := []smithyxml.Attr{} 9577 root := smithyxml.StartElement{ 9578 Name: smithyxml.Name{ 9579 Local: "OptionalFields", 9580 }, 9581 Attr: rootAttr, 9582 } 9583 el := value.MemberElement(root) 9584 if err := awsRestxml_serializeDocumentInventoryOptionalFields(v.OptionalFields, el); err != nil { 9585 return err 9586 } 9587 } 9588 if v.Schedule != nil { 9589 rootAttr := []smithyxml.Attr{} 9590 root := smithyxml.StartElement{ 9591 Name: smithyxml.Name{ 9592 Local: "Schedule", 9593 }, 9594 Attr: rootAttr, 9595 } 9596 el := value.MemberElement(root) 9597 if err := awsRestxml_serializeDocumentInventorySchedule(v.Schedule, el); err != nil { 9598 return err 9599 } 9600 } 9601 return nil 9602} 9603 9604func awsRestxml_serializeDocumentInventoryDestination(v *types.InventoryDestination, value smithyxml.Value) error { 9605 defer value.Close() 9606 if v.S3BucketDestination != nil { 9607 rootAttr := []smithyxml.Attr{} 9608 root := smithyxml.StartElement{ 9609 Name: smithyxml.Name{ 9610 Local: "S3BucketDestination", 9611 }, 9612 Attr: rootAttr, 9613 } 9614 el := value.MemberElement(root) 9615 if err := awsRestxml_serializeDocumentInventoryS3BucketDestination(v.S3BucketDestination, el); err != nil { 9616 return err 9617 } 9618 } 9619 return nil 9620} 9621 9622func awsRestxml_serializeDocumentInventoryEncryption(v *types.InventoryEncryption, value smithyxml.Value) error { 9623 defer value.Close() 9624 if v.SSEKMS != nil { 9625 rootAttr := []smithyxml.Attr{} 9626 root := smithyxml.StartElement{ 9627 Name: smithyxml.Name{ 9628 Local: "SSE-KMS", 9629 }, 9630 Attr: rootAttr, 9631 } 9632 el := value.MemberElement(root) 9633 if err := awsRestxml_serializeDocumentSSEKMS(v.SSEKMS, el); err != nil { 9634 return err 9635 } 9636 } 9637 if v.SSES3 != nil { 9638 rootAttr := []smithyxml.Attr{} 9639 root := smithyxml.StartElement{ 9640 Name: smithyxml.Name{ 9641 Local: "SSE-S3", 9642 }, 9643 Attr: rootAttr, 9644 } 9645 el := value.MemberElement(root) 9646 if err := awsRestxml_serializeDocumentSSES3(v.SSES3, el); err != nil { 9647 return err 9648 } 9649 } 9650 return nil 9651} 9652 9653func awsRestxml_serializeDocumentInventoryFilter(v *types.InventoryFilter, value smithyxml.Value) error { 9654 defer value.Close() 9655 if v.Prefix != nil { 9656 rootAttr := []smithyxml.Attr{} 9657 root := smithyxml.StartElement{ 9658 Name: smithyxml.Name{ 9659 Local: "Prefix", 9660 }, 9661 Attr: rootAttr, 9662 } 9663 el := value.MemberElement(root) 9664 el.String(*v.Prefix) 9665 } 9666 return nil 9667} 9668 9669func awsRestxml_serializeDocumentInventoryOptionalFields(v []types.InventoryOptionalField, value smithyxml.Value) error { 9670 var array *smithyxml.Array 9671 if !value.IsFlattened() { 9672 defer value.Close() 9673 } 9674 customMemberNameAttr := []smithyxml.Attr{} 9675 customMemberName := smithyxml.StartElement{ 9676 Name: smithyxml.Name{ 9677 Local: "Field", 9678 }, 9679 Attr: customMemberNameAttr, 9680 } 9681 array = value.ArrayWithCustomName(customMemberName) 9682 for i := range v { 9683 am := array.Member() 9684 am.String(string(v[i])) 9685 } 9686 return nil 9687} 9688 9689func awsRestxml_serializeDocumentInventoryS3BucketDestination(v *types.InventoryS3BucketDestination, value smithyxml.Value) error { 9690 defer value.Close() 9691 if v.AccountId != nil { 9692 rootAttr := []smithyxml.Attr{} 9693 root := smithyxml.StartElement{ 9694 Name: smithyxml.Name{ 9695 Local: "AccountId", 9696 }, 9697 Attr: rootAttr, 9698 } 9699 el := value.MemberElement(root) 9700 el.String(*v.AccountId) 9701 } 9702 if v.Bucket != nil { 9703 rootAttr := []smithyxml.Attr{} 9704 root := smithyxml.StartElement{ 9705 Name: smithyxml.Name{ 9706 Local: "Bucket", 9707 }, 9708 Attr: rootAttr, 9709 } 9710 el := value.MemberElement(root) 9711 el.String(*v.Bucket) 9712 } 9713 if v.Encryption != nil { 9714 rootAttr := []smithyxml.Attr{} 9715 root := smithyxml.StartElement{ 9716 Name: smithyxml.Name{ 9717 Local: "Encryption", 9718 }, 9719 Attr: rootAttr, 9720 } 9721 el := value.MemberElement(root) 9722 if err := awsRestxml_serializeDocumentInventoryEncryption(v.Encryption, el); err != nil { 9723 return err 9724 } 9725 } 9726 if len(v.Format) > 0 { 9727 rootAttr := []smithyxml.Attr{} 9728 root := smithyxml.StartElement{ 9729 Name: smithyxml.Name{ 9730 Local: "Format", 9731 }, 9732 Attr: rootAttr, 9733 } 9734 el := value.MemberElement(root) 9735 el.String(string(v.Format)) 9736 } 9737 if v.Prefix != nil { 9738 rootAttr := []smithyxml.Attr{} 9739 root := smithyxml.StartElement{ 9740 Name: smithyxml.Name{ 9741 Local: "Prefix", 9742 }, 9743 Attr: rootAttr, 9744 } 9745 el := value.MemberElement(root) 9746 el.String(*v.Prefix) 9747 } 9748 return nil 9749} 9750 9751func awsRestxml_serializeDocumentInventorySchedule(v *types.InventorySchedule, value smithyxml.Value) error { 9752 defer value.Close() 9753 if len(v.Frequency) > 0 { 9754 rootAttr := []smithyxml.Attr{} 9755 root := smithyxml.StartElement{ 9756 Name: smithyxml.Name{ 9757 Local: "Frequency", 9758 }, 9759 Attr: rootAttr, 9760 } 9761 el := value.MemberElement(root) 9762 el.String(string(v.Frequency)) 9763 } 9764 return nil 9765} 9766 9767func awsRestxml_serializeDocumentJSONInput(v *types.JSONInput, value smithyxml.Value) error { 9768 defer value.Close() 9769 if len(v.Type) > 0 { 9770 rootAttr := []smithyxml.Attr{} 9771 root := smithyxml.StartElement{ 9772 Name: smithyxml.Name{ 9773 Local: "Type", 9774 }, 9775 Attr: rootAttr, 9776 } 9777 el := value.MemberElement(root) 9778 el.String(string(v.Type)) 9779 } 9780 return nil 9781} 9782 9783func awsRestxml_serializeDocumentJSONOutput(v *types.JSONOutput, value smithyxml.Value) error { 9784 defer value.Close() 9785 if v.RecordDelimiter != nil { 9786 rootAttr := []smithyxml.Attr{} 9787 root := smithyxml.StartElement{ 9788 Name: smithyxml.Name{ 9789 Local: "RecordDelimiter", 9790 }, 9791 Attr: rootAttr, 9792 } 9793 el := value.MemberElement(root) 9794 el.String(*v.RecordDelimiter) 9795 } 9796 return nil 9797} 9798 9799func awsRestxml_serializeDocumentLambdaFunctionConfiguration(v *types.LambdaFunctionConfiguration, value smithyxml.Value) error { 9800 defer value.Close() 9801 if v.Events != nil { 9802 rootAttr := []smithyxml.Attr{} 9803 root := smithyxml.StartElement{ 9804 Name: smithyxml.Name{ 9805 Local: "Event", 9806 }, 9807 Attr: rootAttr, 9808 } 9809 el := value.FlattenedElement(root) 9810 if err := awsRestxml_serializeDocumentEventList(v.Events, el); err != nil { 9811 return err 9812 } 9813 } 9814 if v.Filter != nil { 9815 rootAttr := []smithyxml.Attr{} 9816 root := smithyxml.StartElement{ 9817 Name: smithyxml.Name{ 9818 Local: "Filter", 9819 }, 9820 Attr: rootAttr, 9821 } 9822 el := value.MemberElement(root) 9823 if err := awsRestxml_serializeDocumentNotificationConfigurationFilter(v.Filter, el); err != nil { 9824 return err 9825 } 9826 } 9827 if v.Id != nil { 9828 rootAttr := []smithyxml.Attr{} 9829 root := smithyxml.StartElement{ 9830 Name: smithyxml.Name{ 9831 Local: "Id", 9832 }, 9833 Attr: rootAttr, 9834 } 9835 el := value.MemberElement(root) 9836 el.String(*v.Id) 9837 } 9838 if v.LambdaFunctionArn != nil { 9839 rootAttr := []smithyxml.Attr{} 9840 root := smithyxml.StartElement{ 9841 Name: smithyxml.Name{ 9842 Local: "CloudFunction", 9843 }, 9844 Attr: rootAttr, 9845 } 9846 el := value.MemberElement(root) 9847 el.String(*v.LambdaFunctionArn) 9848 } 9849 return nil 9850} 9851 9852func awsRestxml_serializeDocumentLambdaFunctionConfigurationList(v []types.LambdaFunctionConfiguration, value smithyxml.Value) error { 9853 var array *smithyxml.Array 9854 if !value.IsFlattened() { 9855 defer value.Close() 9856 } 9857 array = value.Array() 9858 for i := range v { 9859 am := array.Member() 9860 if err := awsRestxml_serializeDocumentLambdaFunctionConfiguration(&v[i], am); err != nil { 9861 return err 9862 } 9863 } 9864 return nil 9865} 9866 9867func awsRestxml_serializeDocumentLifecycleExpiration(v *types.LifecycleExpiration, value smithyxml.Value) error { 9868 defer value.Close() 9869 if v.Date != nil { 9870 rootAttr := []smithyxml.Attr{} 9871 root := smithyxml.StartElement{ 9872 Name: smithyxml.Name{ 9873 Local: "Date", 9874 }, 9875 Attr: rootAttr, 9876 } 9877 el := value.MemberElement(root) 9878 el.String(smithytime.FormatDateTime(*v.Date)) 9879 } 9880 if v.Days != 0 { 9881 rootAttr := []smithyxml.Attr{} 9882 root := smithyxml.StartElement{ 9883 Name: smithyxml.Name{ 9884 Local: "Days", 9885 }, 9886 Attr: rootAttr, 9887 } 9888 el := value.MemberElement(root) 9889 el.Integer(v.Days) 9890 } 9891 if v.ExpiredObjectDeleteMarker { 9892 rootAttr := []smithyxml.Attr{} 9893 root := smithyxml.StartElement{ 9894 Name: smithyxml.Name{ 9895 Local: "ExpiredObjectDeleteMarker", 9896 }, 9897 Attr: rootAttr, 9898 } 9899 el := value.MemberElement(root) 9900 el.Boolean(v.ExpiredObjectDeleteMarker) 9901 } 9902 return nil 9903} 9904 9905func awsRestxml_serializeDocumentLifecycleRule(v *types.LifecycleRule, value smithyxml.Value) error { 9906 defer value.Close() 9907 if v.AbortIncompleteMultipartUpload != nil { 9908 rootAttr := []smithyxml.Attr{} 9909 root := smithyxml.StartElement{ 9910 Name: smithyxml.Name{ 9911 Local: "AbortIncompleteMultipartUpload", 9912 }, 9913 Attr: rootAttr, 9914 } 9915 el := value.MemberElement(root) 9916 if err := awsRestxml_serializeDocumentAbortIncompleteMultipartUpload(v.AbortIncompleteMultipartUpload, el); err != nil { 9917 return err 9918 } 9919 } 9920 if v.Expiration != nil { 9921 rootAttr := []smithyxml.Attr{} 9922 root := smithyxml.StartElement{ 9923 Name: smithyxml.Name{ 9924 Local: "Expiration", 9925 }, 9926 Attr: rootAttr, 9927 } 9928 el := value.MemberElement(root) 9929 if err := awsRestxml_serializeDocumentLifecycleExpiration(v.Expiration, el); err != nil { 9930 return err 9931 } 9932 } 9933 if v.Filter != nil { 9934 rootAttr := []smithyxml.Attr{} 9935 root := smithyxml.StartElement{ 9936 Name: smithyxml.Name{ 9937 Local: "Filter", 9938 }, 9939 Attr: rootAttr, 9940 } 9941 el := value.MemberElement(root) 9942 if err := awsRestxml_serializeDocumentLifecycleRuleFilter(v.Filter, el); err != nil { 9943 return err 9944 } 9945 } 9946 if v.ID != nil { 9947 rootAttr := []smithyxml.Attr{} 9948 root := smithyxml.StartElement{ 9949 Name: smithyxml.Name{ 9950 Local: "ID", 9951 }, 9952 Attr: rootAttr, 9953 } 9954 el := value.MemberElement(root) 9955 el.String(*v.ID) 9956 } 9957 if v.NoncurrentVersionExpiration != nil { 9958 rootAttr := []smithyxml.Attr{} 9959 root := smithyxml.StartElement{ 9960 Name: smithyxml.Name{ 9961 Local: "NoncurrentVersionExpiration", 9962 }, 9963 Attr: rootAttr, 9964 } 9965 el := value.MemberElement(root) 9966 if err := awsRestxml_serializeDocumentNoncurrentVersionExpiration(v.NoncurrentVersionExpiration, el); err != nil { 9967 return err 9968 } 9969 } 9970 if v.NoncurrentVersionTransitions != nil { 9971 rootAttr := []smithyxml.Attr{} 9972 root := smithyxml.StartElement{ 9973 Name: smithyxml.Name{ 9974 Local: "NoncurrentVersionTransition", 9975 }, 9976 Attr: rootAttr, 9977 } 9978 el := value.FlattenedElement(root) 9979 if err := awsRestxml_serializeDocumentNoncurrentVersionTransitionList(v.NoncurrentVersionTransitions, el); err != nil { 9980 return err 9981 } 9982 } 9983 if v.Prefix != nil { 9984 rootAttr := []smithyxml.Attr{} 9985 root := smithyxml.StartElement{ 9986 Name: smithyxml.Name{ 9987 Local: "Prefix", 9988 }, 9989 Attr: rootAttr, 9990 } 9991 el := value.MemberElement(root) 9992 el.String(*v.Prefix) 9993 } 9994 if len(v.Status) > 0 { 9995 rootAttr := []smithyxml.Attr{} 9996 root := smithyxml.StartElement{ 9997 Name: smithyxml.Name{ 9998 Local: "Status", 9999 }, 10000 Attr: rootAttr, 10001 } 10002 el := value.MemberElement(root) 10003 el.String(string(v.Status)) 10004 } 10005 if v.Transitions != nil { 10006 rootAttr := []smithyxml.Attr{} 10007 root := smithyxml.StartElement{ 10008 Name: smithyxml.Name{ 10009 Local: "Transition", 10010 }, 10011 Attr: rootAttr, 10012 } 10013 el := value.FlattenedElement(root) 10014 if err := awsRestxml_serializeDocumentTransitionList(v.Transitions, el); err != nil { 10015 return err 10016 } 10017 } 10018 return nil 10019} 10020 10021func awsRestxml_serializeDocumentLifecycleRuleAndOperator(v *types.LifecycleRuleAndOperator, value smithyxml.Value) error { 10022 defer value.Close() 10023 if v.Prefix != nil { 10024 rootAttr := []smithyxml.Attr{} 10025 root := smithyxml.StartElement{ 10026 Name: smithyxml.Name{ 10027 Local: "Prefix", 10028 }, 10029 Attr: rootAttr, 10030 } 10031 el := value.MemberElement(root) 10032 el.String(*v.Prefix) 10033 } 10034 if v.Tags != nil { 10035 rootAttr := []smithyxml.Attr{} 10036 root := smithyxml.StartElement{ 10037 Name: smithyxml.Name{ 10038 Local: "Tag", 10039 }, 10040 Attr: rootAttr, 10041 } 10042 el := value.FlattenedElement(root) 10043 if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil { 10044 return err 10045 } 10046 } 10047 return nil 10048} 10049 10050func awsRestxml_serializeDocumentLifecycleRuleFilter(v types.LifecycleRuleFilter, value smithyxml.Value) error { 10051 defer value.Close() 10052 switch uv := v.(type) { 10053 case *types.LifecycleRuleFilterMemberAnd: 10054 customMemberNameAttr := []smithyxml.Attr{} 10055 customMemberName := smithyxml.StartElement{ 10056 Name: smithyxml.Name{ 10057 Local: "And", 10058 }, 10059 Attr: customMemberNameAttr, 10060 } 10061 av := value.MemberElement(customMemberName) 10062 if err := awsRestxml_serializeDocumentLifecycleRuleAndOperator(&uv.Value, av); err != nil { 10063 return err 10064 } 10065 10066 case *types.LifecycleRuleFilterMemberPrefix: 10067 customMemberNameAttr := []smithyxml.Attr{} 10068 customMemberName := smithyxml.StartElement{ 10069 Name: smithyxml.Name{ 10070 Local: "Prefix", 10071 }, 10072 Attr: customMemberNameAttr, 10073 } 10074 av := value.MemberElement(customMemberName) 10075 av.String(uv.Value) 10076 10077 case *types.LifecycleRuleFilterMemberTag: 10078 customMemberNameAttr := []smithyxml.Attr{} 10079 customMemberName := smithyxml.StartElement{ 10080 Name: smithyxml.Name{ 10081 Local: "Tag", 10082 }, 10083 Attr: customMemberNameAttr, 10084 } 10085 av := value.MemberElement(customMemberName) 10086 if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil { 10087 return err 10088 } 10089 10090 default: 10091 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 10092 10093 } 10094 return nil 10095} 10096 10097func awsRestxml_serializeDocumentLifecycleRules(v []types.LifecycleRule, value smithyxml.Value) error { 10098 var array *smithyxml.Array 10099 if !value.IsFlattened() { 10100 defer value.Close() 10101 } 10102 array = value.Array() 10103 for i := range v { 10104 am := array.Member() 10105 if err := awsRestxml_serializeDocumentLifecycleRule(&v[i], am); err != nil { 10106 return err 10107 } 10108 } 10109 return nil 10110} 10111 10112func awsRestxml_serializeDocumentLoggingEnabled(v *types.LoggingEnabled, value smithyxml.Value) error { 10113 defer value.Close() 10114 if v.TargetBucket != nil { 10115 rootAttr := []smithyxml.Attr{} 10116 root := smithyxml.StartElement{ 10117 Name: smithyxml.Name{ 10118 Local: "TargetBucket", 10119 }, 10120 Attr: rootAttr, 10121 } 10122 el := value.MemberElement(root) 10123 el.String(*v.TargetBucket) 10124 } 10125 if v.TargetGrants != nil { 10126 rootAttr := []smithyxml.Attr{} 10127 root := smithyxml.StartElement{ 10128 Name: smithyxml.Name{ 10129 Local: "TargetGrants", 10130 }, 10131 Attr: rootAttr, 10132 } 10133 el := value.MemberElement(root) 10134 if err := awsRestxml_serializeDocumentTargetGrants(v.TargetGrants, el); err != nil { 10135 return err 10136 } 10137 } 10138 if v.TargetPrefix != nil { 10139 rootAttr := []smithyxml.Attr{} 10140 root := smithyxml.StartElement{ 10141 Name: smithyxml.Name{ 10142 Local: "TargetPrefix", 10143 }, 10144 Attr: rootAttr, 10145 } 10146 el := value.MemberElement(root) 10147 el.String(*v.TargetPrefix) 10148 } 10149 return nil 10150} 10151 10152func awsRestxml_serializeDocumentMetadataEntry(v *types.MetadataEntry, value smithyxml.Value) error { 10153 defer value.Close() 10154 if v.Name != nil { 10155 rootAttr := []smithyxml.Attr{} 10156 root := smithyxml.StartElement{ 10157 Name: smithyxml.Name{ 10158 Local: "Name", 10159 }, 10160 Attr: rootAttr, 10161 } 10162 el := value.MemberElement(root) 10163 el.String(*v.Name) 10164 } 10165 if v.Value != nil { 10166 rootAttr := []smithyxml.Attr{} 10167 root := smithyxml.StartElement{ 10168 Name: smithyxml.Name{ 10169 Local: "Value", 10170 }, 10171 Attr: rootAttr, 10172 } 10173 el := value.MemberElement(root) 10174 el.String(*v.Value) 10175 } 10176 return nil 10177} 10178 10179func awsRestxml_serializeDocumentMetrics(v *types.Metrics, value smithyxml.Value) error { 10180 defer value.Close() 10181 if v.EventThreshold != nil { 10182 rootAttr := []smithyxml.Attr{} 10183 root := smithyxml.StartElement{ 10184 Name: smithyxml.Name{ 10185 Local: "EventThreshold", 10186 }, 10187 Attr: rootAttr, 10188 } 10189 el := value.MemberElement(root) 10190 if err := awsRestxml_serializeDocumentReplicationTimeValue(v.EventThreshold, el); err != nil { 10191 return err 10192 } 10193 } 10194 if len(v.Status) > 0 { 10195 rootAttr := []smithyxml.Attr{} 10196 root := smithyxml.StartElement{ 10197 Name: smithyxml.Name{ 10198 Local: "Status", 10199 }, 10200 Attr: rootAttr, 10201 } 10202 el := value.MemberElement(root) 10203 el.String(string(v.Status)) 10204 } 10205 return nil 10206} 10207 10208func awsRestxml_serializeDocumentMetricsAndOperator(v *types.MetricsAndOperator, value smithyxml.Value) error { 10209 defer value.Close() 10210 if v.Prefix != nil { 10211 rootAttr := []smithyxml.Attr{} 10212 root := smithyxml.StartElement{ 10213 Name: smithyxml.Name{ 10214 Local: "Prefix", 10215 }, 10216 Attr: rootAttr, 10217 } 10218 el := value.MemberElement(root) 10219 el.String(*v.Prefix) 10220 } 10221 if v.Tags != nil { 10222 rootAttr := []smithyxml.Attr{} 10223 root := smithyxml.StartElement{ 10224 Name: smithyxml.Name{ 10225 Local: "Tag", 10226 }, 10227 Attr: rootAttr, 10228 } 10229 el := value.FlattenedElement(root) 10230 if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil { 10231 return err 10232 } 10233 } 10234 return nil 10235} 10236 10237func awsRestxml_serializeDocumentMetricsConfiguration(v *types.MetricsConfiguration, value smithyxml.Value) error { 10238 defer value.Close() 10239 if v.Filter != nil { 10240 rootAttr := []smithyxml.Attr{} 10241 root := smithyxml.StartElement{ 10242 Name: smithyxml.Name{ 10243 Local: "Filter", 10244 }, 10245 Attr: rootAttr, 10246 } 10247 el := value.MemberElement(root) 10248 if err := awsRestxml_serializeDocumentMetricsFilter(v.Filter, el); err != nil { 10249 return err 10250 } 10251 } 10252 if v.Id != nil { 10253 rootAttr := []smithyxml.Attr{} 10254 root := smithyxml.StartElement{ 10255 Name: smithyxml.Name{ 10256 Local: "Id", 10257 }, 10258 Attr: rootAttr, 10259 } 10260 el := value.MemberElement(root) 10261 el.String(*v.Id) 10262 } 10263 return nil 10264} 10265 10266func awsRestxml_serializeDocumentMetricsFilter(v types.MetricsFilter, value smithyxml.Value) error { 10267 defer value.Close() 10268 switch uv := v.(type) { 10269 case *types.MetricsFilterMemberAnd: 10270 customMemberNameAttr := []smithyxml.Attr{} 10271 customMemberName := smithyxml.StartElement{ 10272 Name: smithyxml.Name{ 10273 Local: "And", 10274 }, 10275 Attr: customMemberNameAttr, 10276 } 10277 av := value.MemberElement(customMemberName) 10278 if err := awsRestxml_serializeDocumentMetricsAndOperator(&uv.Value, av); err != nil { 10279 return err 10280 } 10281 10282 case *types.MetricsFilterMemberPrefix: 10283 customMemberNameAttr := []smithyxml.Attr{} 10284 customMemberName := smithyxml.StartElement{ 10285 Name: smithyxml.Name{ 10286 Local: "Prefix", 10287 }, 10288 Attr: customMemberNameAttr, 10289 } 10290 av := value.MemberElement(customMemberName) 10291 av.String(uv.Value) 10292 10293 case *types.MetricsFilterMemberTag: 10294 customMemberNameAttr := []smithyxml.Attr{} 10295 customMemberName := smithyxml.StartElement{ 10296 Name: smithyxml.Name{ 10297 Local: "Tag", 10298 }, 10299 Attr: customMemberNameAttr, 10300 } 10301 av := value.MemberElement(customMemberName) 10302 if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil { 10303 return err 10304 } 10305 10306 default: 10307 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 10308 10309 } 10310 return nil 10311} 10312 10313func awsRestxml_serializeDocumentNoncurrentVersionExpiration(v *types.NoncurrentVersionExpiration, value smithyxml.Value) error { 10314 defer value.Close() 10315 if v.NoncurrentDays != 0 { 10316 rootAttr := []smithyxml.Attr{} 10317 root := smithyxml.StartElement{ 10318 Name: smithyxml.Name{ 10319 Local: "NoncurrentDays", 10320 }, 10321 Attr: rootAttr, 10322 } 10323 el := value.MemberElement(root) 10324 el.Integer(v.NoncurrentDays) 10325 } 10326 return nil 10327} 10328 10329func awsRestxml_serializeDocumentNoncurrentVersionTransition(v *types.NoncurrentVersionTransition, value smithyxml.Value) error { 10330 defer value.Close() 10331 if v.NoncurrentDays != 0 { 10332 rootAttr := []smithyxml.Attr{} 10333 root := smithyxml.StartElement{ 10334 Name: smithyxml.Name{ 10335 Local: "NoncurrentDays", 10336 }, 10337 Attr: rootAttr, 10338 } 10339 el := value.MemberElement(root) 10340 el.Integer(v.NoncurrentDays) 10341 } 10342 if len(v.StorageClass) > 0 { 10343 rootAttr := []smithyxml.Attr{} 10344 root := smithyxml.StartElement{ 10345 Name: smithyxml.Name{ 10346 Local: "StorageClass", 10347 }, 10348 Attr: rootAttr, 10349 } 10350 el := value.MemberElement(root) 10351 el.String(string(v.StorageClass)) 10352 } 10353 return nil 10354} 10355 10356func awsRestxml_serializeDocumentNoncurrentVersionTransitionList(v []types.NoncurrentVersionTransition, value smithyxml.Value) error { 10357 var array *smithyxml.Array 10358 if !value.IsFlattened() { 10359 defer value.Close() 10360 } 10361 array = value.Array() 10362 for i := range v { 10363 am := array.Member() 10364 if err := awsRestxml_serializeDocumentNoncurrentVersionTransition(&v[i], am); err != nil { 10365 return err 10366 } 10367 } 10368 return nil 10369} 10370 10371func awsRestxml_serializeDocumentNotificationConfiguration(v *types.NotificationConfiguration, value smithyxml.Value) error { 10372 defer value.Close() 10373 if v.LambdaFunctionConfigurations != nil { 10374 rootAttr := []smithyxml.Attr{} 10375 root := smithyxml.StartElement{ 10376 Name: smithyxml.Name{ 10377 Local: "CloudFunctionConfiguration", 10378 }, 10379 Attr: rootAttr, 10380 } 10381 el := value.FlattenedElement(root) 10382 if err := awsRestxml_serializeDocumentLambdaFunctionConfigurationList(v.LambdaFunctionConfigurations, el); err != nil { 10383 return err 10384 } 10385 } 10386 if v.QueueConfigurations != nil { 10387 rootAttr := []smithyxml.Attr{} 10388 root := smithyxml.StartElement{ 10389 Name: smithyxml.Name{ 10390 Local: "QueueConfiguration", 10391 }, 10392 Attr: rootAttr, 10393 } 10394 el := value.FlattenedElement(root) 10395 if err := awsRestxml_serializeDocumentQueueConfigurationList(v.QueueConfigurations, el); err != nil { 10396 return err 10397 } 10398 } 10399 if v.TopicConfigurations != nil { 10400 rootAttr := []smithyxml.Attr{} 10401 root := smithyxml.StartElement{ 10402 Name: smithyxml.Name{ 10403 Local: "TopicConfiguration", 10404 }, 10405 Attr: rootAttr, 10406 } 10407 el := value.FlattenedElement(root) 10408 if err := awsRestxml_serializeDocumentTopicConfigurationList(v.TopicConfigurations, el); err != nil { 10409 return err 10410 } 10411 } 10412 return nil 10413} 10414 10415func awsRestxml_serializeDocumentNotificationConfigurationFilter(v *types.NotificationConfigurationFilter, value smithyxml.Value) error { 10416 defer value.Close() 10417 if v.Key != nil { 10418 rootAttr := []smithyxml.Attr{} 10419 root := smithyxml.StartElement{ 10420 Name: smithyxml.Name{ 10421 Local: "S3Key", 10422 }, 10423 Attr: rootAttr, 10424 } 10425 el := value.MemberElement(root) 10426 if err := awsRestxml_serializeDocumentS3KeyFilter(v.Key, el); err != nil { 10427 return err 10428 } 10429 } 10430 return nil 10431} 10432 10433func awsRestxml_serializeDocumentObjectIdentifier(v *types.ObjectIdentifier, value smithyxml.Value) error { 10434 defer value.Close() 10435 if v.Key != nil { 10436 rootAttr := []smithyxml.Attr{} 10437 root := smithyxml.StartElement{ 10438 Name: smithyxml.Name{ 10439 Local: "Key", 10440 }, 10441 Attr: rootAttr, 10442 } 10443 el := value.MemberElement(root) 10444 el.String(*v.Key) 10445 } 10446 if v.VersionId != nil { 10447 rootAttr := []smithyxml.Attr{} 10448 root := smithyxml.StartElement{ 10449 Name: smithyxml.Name{ 10450 Local: "VersionId", 10451 }, 10452 Attr: rootAttr, 10453 } 10454 el := value.MemberElement(root) 10455 el.String(*v.VersionId) 10456 } 10457 return nil 10458} 10459 10460func awsRestxml_serializeDocumentObjectIdentifierList(v []types.ObjectIdentifier, value smithyxml.Value) error { 10461 var array *smithyxml.Array 10462 if !value.IsFlattened() { 10463 defer value.Close() 10464 } 10465 array = value.Array() 10466 for i := range v { 10467 am := array.Member() 10468 if err := awsRestxml_serializeDocumentObjectIdentifier(&v[i], am); err != nil { 10469 return err 10470 } 10471 } 10472 return nil 10473} 10474 10475func awsRestxml_serializeDocumentObjectLockConfiguration(v *types.ObjectLockConfiguration, value smithyxml.Value) error { 10476 defer value.Close() 10477 if len(v.ObjectLockEnabled) > 0 { 10478 rootAttr := []smithyxml.Attr{} 10479 root := smithyxml.StartElement{ 10480 Name: smithyxml.Name{ 10481 Local: "ObjectLockEnabled", 10482 }, 10483 Attr: rootAttr, 10484 } 10485 el := value.MemberElement(root) 10486 el.String(string(v.ObjectLockEnabled)) 10487 } 10488 if v.Rule != nil { 10489 rootAttr := []smithyxml.Attr{} 10490 root := smithyxml.StartElement{ 10491 Name: smithyxml.Name{ 10492 Local: "Rule", 10493 }, 10494 Attr: rootAttr, 10495 } 10496 el := value.MemberElement(root) 10497 if err := awsRestxml_serializeDocumentObjectLockRule(v.Rule, el); err != nil { 10498 return err 10499 } 10500 } 10501 return nil 10502} 10503 10504func awsRestxml_serializeDocumentObjectLockLegalHold(v *types.ObjectLockLegalHold, value smithyxml.Value) error { 10505 defer value.Close() 10506 if len(v.Status) > 0 { 10507 rootAttr := []smithyxml.Attr{} 10508 root := smithyxml.StartElement{ 10509 Name: smithyxml.Name{ 10510 Local: "Status", 10511 }, 10512 Attr: rootAttr, 10513 } 10514 el := value.MemberElement(root) 10515 el.String(string(v.Status)) 10516 } 10517 return nil 10518} 10519 10520func awsRestxml_serializeDocumentObjectLockRetention(v *types.ObjectLockRetention, value smithyxml.Value) error { 10521 defer value.Close() 10522 if len(v.Mode) > 0 { 10523 rootAttr := []smithyxml.Attr{} 10524 root := smithyxml.StartElement{ 10525 Name: smithyxml.Name{ 10526 Local: "Mode", 10527 }, 10528 Attr: rootAttr, 10529 } 10530 el := value.MemberElement(root) 10531 el.String(string(v.Mode)) 10532 } 10533 if v.RetainUntilDate != nil { 10534 rootAttr := []smithyxml.Attr{} 10535 root := smithyxml.StartElement{ 10536 Name: smithyxml.Name{ 10537 Local: "RetainUntilDate", 10538 }, 10539 Attr: rootAttr, 10540 } 10541 el := value.MemberElement(root) 10542 el.String(smithytime.FormatDateTime(*v.RetainUntilDate)) 10543 } 10544 return nil 10545} 10546 10547func awsRestxml_serializeDocumentObjectLockRule(v *types.ObjectLockRule, value smithyxml.Value) error { 10548 defer value.Close() 10549 if v.DefaultRetention != nil { 10550 rootAttr := []smithyxml.Attr{} 10551 root := smithyxml.StartElement{ 10552 Name: smithyxml.Name{ 10553 Local: "DefaultRetention", 10554 }, 10555 Attr: rootAttr, 10556 } 10557 el := value.MemberElement(root) 10558 if err := awsRestxml_serializeDocumentDefaultRetention(v.DefaultRetention, el); err != nil { 10559 return err 10560 } 10561 } 10562 return nil 10563} 10564 10565func awsRestxml_serializeDocumentOutputLocation(v *types.OutputLocation, value smithyxml.Value) error { 10566 defer value.Close() 10567 if v.S3 != nil { 10568 rootAttr := []smithyxml.Attr{} 10569 root := smithyxml.StartElement{ 10570 Name: smithyxml.Name{ 10571 Local: "S3", 10572 }, 10573 Attr: rootAttr, 10574 } 10575 el := value.MemberElement(root) 10576 if err := awsRestxml_serializeDocumentS3Location(v.S3, el); err != nil { 10577 return err 10578 } 10579 } 10580 return nil 10581} 10582 10583func awsRestxml_serializeDocumentOutputSerialization(v *types.OutputSerialization, value smithyxml.Value) error { 10584 defer value.Close() 10585 if v.CSV != nil { 10586 rootAttr := []smithyxml.Attr{} 10587 root := smithyxml.StartElement{ 10588 Name: smithyxml.Name{ 10589 Local: "CSV", 10590 }, 10591 Attr: rootAttr, 10592 } 10593 el := value.MemberElement(root) 10594 if err := awsRestxml_serializeDocumentCSVOutput(v.CSV, el); err != nil { 10595 return err 10596 } 10597 } 10598 if v.JSON != nil { 10599 rootAttr := []smithyxml.Attr{} 10600 root := smithyxml.StartElement{ 10601 Name: smithyxml.Name{ 10602 Local: "JSON", 10603 }, 10604 Attr: rootAttr, 10605 } 10606 el := value.MemberElement(root) 10607 if err := awsRestxml_serializeDocumentJSONOutput(v.JSON, el); err != nil { 10608 return err 10609 } 10610 } 10611 return nil 10612} 10613 10614func awsRestxml_serializeDocumentOwner(v *types.Owner, value smithyxml.Value) error { 10615 defer value.Close() 10616 if v.DisplayName != nil { 10617 rootAttr := []smithyxml.Attr{} 10618 root := smithyxml.StartElement{ 10619 Name: smithyxml.Name{ 10620 Local: "DisplayName", 10621 }, 10622 Attr: rootAttr, 10623 } 10624 el := value.MemberElement(root) 10625 el.String(*v.DisplayName) 10626 } 10627 if v.ID != nil { 10628 rootAttr := []smithyxml.Attr{} 10629 root := smithyxml.StartElement{ 10630 Name: smithyxml.Name{ 10631 Local: "ID", 10632 }, 10633 Attr: rootAttr, 10634 } 10635 el := value.MemberElement(root) 10636 el.String(*v.ID) 10637 } 10638 return nil 10639} 10640 10641func awsRestxml_serializeDocumentOwnershipControls(v *types.OwnershipControls, value smithyxml.Value) error { 10642 defer value.Close() 10643 if v.Rules != nil { 10644 rootAttr := []smithyxml.Attr{} 10645 root := smithyxml.StartElement{ 10646 Name: smithyxml.Name{ 10647 Local: "Rule", 10648 }, 10649 Attr: rootAttr, 10650 } 10651 el := value.FlattenedElement(root) 10652 if err := awsRestxml_serializeDocumentOwnershipControlsRules(v.Rules, el); err != nil { 10653 return err 10654 } 10655 } 10656 return nil 10657} 10658 10659func awsRestxml_serializeDocumentOwnershipControlsRule(v *types.OwnershipControlsRule, value smithyxml.Value) error { 10660 defer value.Close() 10661 if len(v.ObjectOwnership) > 0 { 10662 rootAttr := []smithyxml.Attr{} 10663 root := smithyxml.StartElement{ 10664 Name: smithyxml.Name{ 10665 Local: "ObjectOwnership", 10666 }, 10667 Attr: rootAttr, 10668 } 10669 el := value.MemberElement(root) 10670 el.String(string(v.ObjectOwnership)) 10671 } 10672 return nil 10673} 10674 10675func awsRestxml_serializeDocumentOwnershipControlsRules(v []types.OwnershipControlsRule, value smithyxml.Value) error { 10676 var array *smithyxml.Array 10677 if !value.IsFlattened() { 10678 defer value.Close() 10679 } 10680 array = value.Array() 10681 for i := range v { 10682 am := array.Member() 10683 if err := awsRestxml_serializeDocumentOwnershipControlsRule(&v[i], am); err != nil { 10684 return err 10685 } 10686 } 10687 return nil 10688} 10689 10690func awsRestxml_serializeDocumentParquetInput(v *types.ParquetInput, value smithyxml.Value) error { 10691 defer value.Close() 10692 return nil 10693} 10694 10695func awsRestxml_serializeDocumentPublicAccessBlockConfiguration(v *types.PublicAccessBlockConfiguration, value smithyxml.Value) error { 10696 defer value.Close() 10697 if v.BlockPublicAcls { 10698 rootAttr := []smithyxml.Attr{} 10699 root := smithyxml.StartElement{ 10700 Name: smithyxml.Name{ 10701 Local: "BlockPublicAcls", 10702 }, 10703 Attr: rootAttr, 10704 } 10705 el := value.MemberElement(root) 10706 el.Boolean(v.BlockPublicAcls) 10707 } 10708 if v.BlockPublicPolicy { 10709 rootAttr := []smithyxml.Attr{} 10710 root := smithyxml.StartElement{ 10711 Name: smithyxml.Name{ 10712 Local: "BlockPublicPolicy", 10713 }, 10714 Attr: rootAttr, 10715 } 10716 el := value.MemberElement(root) 10717 el.Boolean(v.BlockPublicPolicy) 10718 } 10719 if v.IgnorePublicAcls { 10720 rootAttr := []smithyxml.Attr{} 10721 root := smithyxml.StartElement{ 10722 Name: smithyxml.Name{ 10723 Local: "IgnorePublicAcls", 10724 }, 10725 Attr: rootAttr, 10726 } 10727 el := value.MemberElement(root) 10728 el.Boolean(v.IgnorePublicAcls) 10729 } 10730 if v.RestrictPublicBuckets { 10731 rootAttr := []smithyxml.Attr{} 10732 root := smithyxml.StartElement{ 10733 Name: smithyxml.Name{ 10734 Local: "RestrictPublicBuckets", 10735 }, 10736 Attr: rootAttr, 10737 } 10738 el := value.MemberElement(root) 10739 el.Boolean(v.RestrictPublicBuckets) 10740 } 10741 return nil 10742} 10743 10744func awsRestxml_serializeDocumentQueueConfiguration(v *types.QueueConfiguration, value smithyxml.Value) error { 10745 defer value.Close() 10746 if v.Events != nil { 10747 rootAttr := []smithyxml.Attr{} 10748 root := smithyxml.StartElement{ 10749 Name: smithyxml.Name{ 10750 Local: "Event", 10751 }, 10752 Attr: rootAttr, 10753 } 10754 el := value.FlattenedElement(root) 10755 if err := awsRestxml_serializeDocumentEventList(v.Events, el); err != nil { 10756 return err 10757 } 10758 } 10759 if v.Filter != nil { 10760 rootAttr := []smithyxml.Attr{} 10761 root := smithyxml.StartElement{ 10762 Name: smithyxml.Name{ 10763 Local: "Filter", 10764 }, 10765 Attr: rootAttr, 10766 } 10767 el := value.MemberElement(root) 10768 if err := awsRestxml_serializeDocumentNotificationConfigurationFilter(v.Filter, el); err != nil { 10769 return err 10770 } 10771 } 10772 if v.Id != nil { 10773 rootAttr := []smithyxml.Attr{} 10774 root := smithyxml.StartElement{ 10775 Name: smithyxml.Name{ 10776 Local: "Id", 10777 }, 10778 Attr: rootAttr, 10779 } 10780 el := value.MemberElement(root) 10781 el.String(*v.Id) 10782 } 10783 if v.QueueArn != nil { 10784 rootAttr := []smithyxml.Attr{} 10785 root := smithyxml.StartElement{ 10786 Name: smithyxml.Name{ 10787 Local: "Queue", 10788 }, 10789 Attr: rootAttr, 10790 } 10791 el := value.MemberElement(root) 10792 el.String(*v.QueueArn) 10793 } 10794 return nil 10795} 10796 10797func awsRestxml_serializeDocumentQueueConfigurationList(v []types.QueueConfiguration, value smithyxml.Value) error { 10798 var array *smithyxml.Array 10799 if !value.IsFlattened() { 10800 defer value.Close() 10801 } 10802 array = value.Array() 10803 for i := range v { 10804 am := array.Member() 10805 if err := awsRestxml_serializeDocumentQueueConfiguration(&v[i], am); err != nil { 10806 return err 10807 } 10808 } 10809 return nil 10810} 10811 10812func awsRestxml_serializeDocumentRedirect(v *types.Redirect, value smithyxml.Value) error { 10813 defer value.Close() 10814 if v.HostName != nil { 10815 rootAttr := []smithyxml.Attr{} 10816 root := smithyxml.StartElement{ 10817 Name: smithyxml.Name{ 10818 Local: "HostName", 10819 }, 10820 Attr: rootAttr, 10821 } 10822 el := value.MemberElement(root) 10823 el.String(*v.HostName) 10824 } 10825 if v.HttpRedirectCode != nil { 10826 rootAttr := []smithyxml.Attr{} 10827 root := smithyxml.StartElement{ 10828 Name: smithyxml.Name{ 10829 Local: "HttpRedirectCode", 10830 }, 10831 Attr: rootAttr, 10832 } 10833 el := value.MemberElement(root) 10834 el.String(*v.HttpRedirectCode) 10835 } 10836 if len(v.Protocol) > 0 { 10837 rootAttr := []smithyxml.Attr{} 10838 root := smithyxml.StartElement{ 10839 Name: smithyxml.Name{ 10840 Local: "Protocol", 10841 }, 10842 Attr: rootAttr, 10843 } 10844 el := value.MemberElement(root) 10845 el.String(string(v.Protocol)) 10846 } 10847 if v.ReplaceKeyPrefixWith != nil { 10848 rootAttr := []smithyxml.Attr{} 10849 root := smithyxml.StartElement{ 10850 Name: smithyxml.Name{ 10851 Local: "ReplaceKeyPrefixWith", 10852 }, 10853 Attr: rootAttr, 10854 } 10855 el := value.MemberElement(root) 10856 el.String(*v.ReplaceKeyPrefixWith) 10857 } 10858 if v.ReplaceKeyWith != nil { 10859 rootAttr := []smithyxml.Attr{} 10860 root := smithyxml.StartElement{ 10861 Name: smithyxml.Name{ 10862 Local: "ReplaceKeyWith", 10863 }, 10864 Attr: rootAttr, 10865 } 10866 el := value.MemberElement(root) 10867 el.String(*v.ReplaceKeyWith) 10868 } 10869 return nil 10870} 10871 10872func awsRestxml_serializeDocumentRedirectAllRequestsTo(v *types.RedirectAllRequestsTo, value smithyxml.Value) error { 10873 defer value.Close() 10874 if v.HostName != nil { 10875 rootAttr := []smithyxml.Attr{} 10876 root := smithyxml.StartElement{ 10877 Name: smithyxml.Name{ 10878 Local: "HostName", 10879 }, 10880 Attr: rootAttr, 10881 } 10882 el := value.MemberElement(root) 10883 el.String(*v.HostName) 10884 } 10885 if len(v.Protocol) > 0 { 10886 rootAttr := []smithyxml.Attr{} 10887 root := smithyxml.StartElement{ 10888 Name: smithyxml.Name{ 10889 Local: "Protocol", 10890 }, 10891 Attr: rootAttr, 10892 } 10893 el := value.MemberElement(root) 10894 el.String(string(v.Protocol)) 10895 } 10896 return nil 10897} 10898 10899func awsRestxml_serializeDocumentReplicaModifications(v *types.ReplicaModifications, value smithyxml.Value) error { 10900 defer value.Close() 10901 if len(v.Status) > 0 { 10902 rootAttr := []smithyxml.Attr{} 10903 root := smithyxml.StartElement{ 10904 Name: smithyxml.Name{ 10905 Local: "Status", 10906 }, 10907 Attr: rootAttr, 10908 } 10909 el := value.MemberElement(root) 10910 el.String(string(v.Status)) 10911 } 10912 return nil 10913} 10914 10915func awsRestxml_serializeDocumentReplicationConfiguration(v *types.ReplicationConfiguration, value smithyxml.Value) error { 10916 defer value.Close() 10917 if v.Role != nil { 10918 rootAttr := []smithyxml.Attr{} 10919 root := smithyxml.StartElement{ 10920 Name: smithyxml.Name{ 10921 Local: "Role", 10922 }, 10923 Attr: rootAttr, 10924 } 10925 el := value.MemberElement(root) 10926 el.String(*v.Role) 10927 } 10928 if v.Rules != nil { 10929 rootAttr := []smithyxml.Attr{} 10930 root := smithyxml.StartElement{ 10931 Name: smithyxml.Name{ 10932 Local: "Rule", 10933 }, 10934 Attr: rootAttr, 10935 } 10936 el := value.FlattenedElement(root) 10937 if err := awsRestxml_serializeDocumentReplicationRules(v.Rules, el); err != nil { 10938 return err 10939 } 10940 } 10941 return nil 10942} 10943 10944func awsRestxml_serializeDocumentReplicationRule(v *types.ReplicationRule, value smithyxml.Value) error { 10945 defer value.Close() 10946 if v.DeleteMarkerReplication != nil { 10947 rootAttr := []smithyxml.Attr{} 10948 root := smithyxml.StartElement{ 10949 Name: smithyxml.Name{ 10950 Local: "DeleteMarkerReplication", 10951 }, 10952 Attr: rootAttr, 10953 } 10954 el := value.MemberElement(root) 10955 if err := awsRestxml_serializeDocumentDeleteMarkerReplication(v.DeleteMarkerReplication, el); err != nil { 10956 return err 10957 } 10958 } 10959 if v.Destination != nil { 10960 rootAttr := []smithyxml.Attr{} 10961 root := smithyxml.StartElement{ 10962 Name: smithyxml.Name{ 10963 Local: "Destination", 10964 }, 10965 Attr: rootAttr, 10966 } 10967 el := value.MemberElement(root) 10968 if err := awsRestxml_serializeDocumentDestination(v.Destination, el); err != nil { 10969 return err 10970 } 10971 } 10972 if v.ExistingObjectReplication != nil { 10973 rootAttr := []smithyxml.Attr{} 10974 root := smithyxml.StartElement{ 10975 Name: smithyxml.Name{ 10976 Local: "ExistingObjectReplication", 10977 }, 10978 Attr: rootAttr, 10979 } 10980 el := value.MemberElement(root) 10981 if err := awsRestxml_serializeDocumentExistingObjectReplication(v.ExistingObjectReplication, el); err != nil { 10982 return err 10983 } 10984 } 10985 if v.Filter != nil { 10986 rootAttr := []smithyxml.Attr{} 10987 root := smithyxml.StartElement{ 10988 Name: smithyxml.Name{ 10989 Local: "Filter", 10990 }, 10991 Attr: rootAttr, 10992 } 10993 el := value.MemberElement(root) 10994 if err := awsRestxml_serializeDocumentReplicationRuleFilter(v.Filter, el); err != nil { 10995 return err 10996 } 10997 } 10998 if v.ID != nil { 10999 rootAttr := []smithyxml.Attr{} 11000 root := smithyxml.StartElement{ 11001 Name: smithyxml.Name{ 11002 Local: "ID", 11003 }, 11004 Attr: rootAttr, 11005 } 11006 el := value.MemberElement(root) 11007 el.String(*v.ID) 11008 } 11009 if v.Prefix != nil { 11010 rootAttr := []smithyxml.Attr{} 11011 root := smithyxml.StartElement{ 11012 Name: smithyxml.Name{ 11013 Local: "Prefix", 11014 }, 11015 Attr: rootAttr, 11016 } 11017 el := value.MemberElement(root) 11018 el.String(*v.Prefix) 11019 } 11020 if v.Priority != 0 { 11021 rootAttr := []smithyxml.Attr{} 11022 root := smithyxml.StartElement{ 11023 Name: smithyxml.Name{ 11024 Local: "Priority", 11025 }, 11026 Attr: rootAttr, 11027 } 11028 el := value.MemberElement(root) 11029 el.Integer(v.Priority) 11030 } 11031 if v.SourceSelectionCriteria != nil { 11032 rootAttr := []smithyxml.Attr{} 11033 root := smithyxml.StartElement{ 11034 Name: smithyxml.Name{ 11035 Local: "SourceSelectionCriteria", 11036 }, 11037 Attr: rootAttr, 11038 } 11039 el := value.MemberElement(root) 11040 if err := awsRestxml_serializeDocumentSourceSelectionCriteria(v.SourceSelectionCriteria, el); err != nil { 11041 return err 11042 } 11043 } 11044 if len(v.Status) > 0 { 11045 rootAttr := []smithyxml.Attr{} 11046 root := smithyxml.StartElement{ 11047 Name: smithyxml.Name{ 11048 Local: "Status", 11049 }, 11050 Attr: rootAttr, 11051 } 11052 el := value.MemberElement(root) 11053 el.String(string(v.Status)) 11054 } 11055 return nil 11056} 11057 11058func awsRestxml_serializeDocumentReplicationRuleAndOperator(v *types.ReplicationRuleAndOperator, value smithyxml.Value) error { 11059 defer value.Close() 11060 if v.Prefix != nil { 11061 rootAttr := []smithyxml.Attr{} 11062 root := smithyxml.StartElement{ 11063 Name: smithyxml.Name{ 11064 Local: "Prefix", 11065 }, 11066 Attr: rootAttr, 11067 } 11068 el := value.MemberElement(root) 11069 el.String(*v.Prefix) 11070 } 11071 if v.Tags != nil { 11072 rootAttr := []smithyxml.Attr{} 11073 root := smithyxml.StartElement{ 11074 Name: smithyxml.Name{ 11075 Local: "Tag", 11076 }, 11077 Attr: rootAttr, 11078 } 11079 el := value.FlattenedElement(root) 11080 if err := awsRestxml_serializeDocumentTagSet(v.Tags, el); err != nil { 11081 return err 11082 } 11083 } 11084 return nil 11085} 11086 11087func awsRestxml_serializeDocumentReplicationRuleFilter(v types.ReplicationRuleFilter, value smithyxml.Value) error { 11088 defer value.Close() 11089 switch uv := v.(type) { 11090 case *types.ReplicationRuleFilterMemberAnd: 11091 customMemberNameAttr := []smithyxml.Attr{} 11092 customMemberName := smithyxml.StartElement{ 11093 Name: smithyxml.Name{ 11094 Local: "And", 11095 }, 11096 Attr: customMemberNameAttr, 11097 } 11098 av := value.MemberElement(customMemberName) 11099 if err := awsRestxml_serializeDocumentReplicationRuleAndOperator(&uv.Value, av); err != nil { 11100 return err 11101 } 11102 11103 case *types.ReplicationRuleFilterMemberPrefix: 11104 customMemberNameAttr := []smithyxml.Attr{} 11105 customMemberName := smithyxml.StartElement{ 11106 Name: smithyxml.Name{ 11107 Local: "Prefix", 11108 }, 11109 Attr: customMemberNameAttr, 11110 } 11111 av := value.MemberElement(customMemberName) 11112 av.String(uv.Value) 11113 11114 case *types.ReplicationRuleFilterMemberTag: 11115 customMemberNameAttr := []smithyxml.Attr{} 11116 customMemberName := smithyxml.StartElement{ 11117 Name: smithyxml.Name{ 11118 Local: "Tag", 11119 }, 11120 Attr: customMemberNameAttr, 11121 } 11122 av := value.MemberElement(customMemberName) 11123 if err := awsRestxml_serializeDocumentTag(&uv.Value, av); err != nil { 11124 return err 11125 } 11126 11127 default: 11128 return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) 11129 11130 } 11131 return nil 11132} 11133 11134func awsRestxml_serializeDocumentReplicationRules(v []types.ReplicationRule, value smithyxml.Value) error { 11135 var array *smithyxml.Array 11136 if !value.IsFlattened() { 11137 defer value.Close() 11138 } 11139 array = value.Array() 11140 for i := range v { 11141 am := array.Member() 11142 if err := awsRestxml_serializeDocumentReplicationRule(&v[i], am); err != nil { 11143 return err 11144 } 11145 } 11146 return nil 11147} 11148 11149func awsRestxml_serializeDocumentReplicationTime(v *types.ReplicationTime, value smithyxml.Value) error { 11150 defer value.Close() 11151 if len(v.Status) > 0 { 11152 rootAttr := []smithyxml.Attr{} 11153 root := smithyxml.StartElement{ 11154 Name: smithyxml.Name{ 11155 Local: "Status", 11156 }, 11157 Attr: rootAttr, 11158 } 11159 el := value.MemberElement(root) 11160 el.String(string(v.Status)) 11161 } 11162 if v.Time != nil { 11163 rootAttr := []smithyxml.Attr{} 11164 root := smithyxml.StartElement{ 11165 Name: smithyxml.Name{ 11166 Local: "Time", 11167 }, 11168 Attr: rootAttr, 11169 } 11170 el := value.MemberElement(root) 11171 if err := awsRestxml_serializeDocumentReplicationTimeValue(v.Time, el); err != nil { 11172 return err 11173 } 11174 } 11175 return nil 11176} 11177 11178func awsRestxml_serializeDocumentReplicationTimeValue(v *types.ReplicationTimeValue, value smithyxml.Value) error { 11179 defer value.Close() 11180 if v.Minutes != 0 { 11181 rootAttr := []smithyxml.Attr{} 11182 root := smithyxml.StartElement{ 11183 Name: smithyxml.Name{ 11184 Local: "Minutes", 11185 }, 11186 Attr: rootAttr, 11187 } 11188 el := value.MemberElement(root) 11189 el.Integer(v.Minutes) 11190 } 11191 return nil 11192} 11193 11194func awsRestxml_serializeDocumentRequestPaymentConfiguration(v *types.RequestPaymentConfiguration, value smithyxml.Value) error { 11195 defer value.Close() 11196 if len(v.Payer) > 0 { 11197 rootAttr := []smithyxml.Attr{} 11198 root := smithyxml.StartElement{ 11199 Name: smithyxml.Name{ 11200 Local: "Payer", 11201 }, 11202 Attr: rootAttr, 11203 } 11204 el := value.MemberElement(root) 11205 el.String(string(v.Payer)) 11206 } 11207 return nil 11208} 11209 11210func awsRestxml_serializeDocumentRestoreRequest(v *types.RestoreRequest, value smithyxml.Value) error { 11211 defer value.Close() 11212 if v.Days != 0 { 11213 rootAttr := []smithyxml.Attr{} 11214 root := smithyxml.StartElement{ 11215 Name: smithyxml.Name{ 11216 Local: "Days", 11217 }, 11218 Attr: rootAttr, 11219 } 11220 el := value.MemberElement(root) 11221 el.Integer(v.Days) 11222 } 11223 if v.Description != nil { 11224 rootAttr := []smithyxml.Attr{} 11225 root := smithyxml.StartElement{ 11226 Name: smithyxml.Name{ 11227 Local: "Description", 11228 }, 11229 Attr: rootAttr, 11230 } 11231 el := value.MemberElement(root) 11232 el.String(*v.Description) 11233 } 11234 if v.GlacierJobParameters != nil { 11235 rootAttr := []smithyxml.Attr{} 11236 root := smithyxml.StartElement{ 11237 Name: smithyxml.Name{ 11238 Local: "GlacierJobParameters", 11239 }, 11240 Attr: rootAttr, 11241 } 11242 el := value.MemberElement(root) 11243 if err := awsRestxml_serializeDocumentGlacierJobParameters(v.GlacierJobParameters, el); err != nil { 11244 return err 11245 } 11246 } 11247 if v.OutputLocation != nil { 11248 rootAttr := []smithyxml.Attr{} 11249 root := smithyxml.StartElement{ 11250 Name: smithyxml.Name{ 11251 Local: "OutputLocation", 11252 }, 11253 Attr: rootAttr, 11254 } 11255 el := value.MemberElement(root) 11256 if err := awsRestxml_serializeDocumentOutputLocation(v.OutputLocation, el); err != nil { 11257 return err 11258 } 11259 } 11260 if v.SelectParameters != nil { 11261 rootAttr := []smithyxml.Attr{} 11262 root := smithyxml.StartElement{ 11263 Name: smithyxml.Name{ 11264 Local: "SelectParameters", 11265 }, 11266 Attr: rootAttr, 11267 } 11268 el := value.MemberElement(root) 11269 if err := awsRestxml_serializeDocumentSelectParameters(v.SelectParameters, el); err != nil { 11270 return err 11271 } 11272 } 11273 if len(v.Tier) > 0 { 11274 rootAttr := []smithyxml.Attr{} 11275 root := smithyxml.StartElement{ 11276 Name: smithyxml.Name{ 11277 Local: "Tier", 11278 }, 11279 Attr: rootAttr, 11280 } 11281 el := value.MemberElement(root) 11282 el.String(string(v.Tier)) 11283 } 11284 if len(v.Type) > 0 { 11285 rootAttr := []smithyxml.Attr{} 11286 root := smithyxml.StartElement{ 11287 Name: smithyxml.Name{ 11288 Local: "Type", 11289 }, 11290 Attr: rootAttr, 11291 } 11292 el := value.MemberElement(root) 11293 el.String(string(v.Type)) 11294 } 11295 return nil 11296} 11297 11298func awsRestxml_serializeDocumentRoutingRule(v *types.RoutingRule, value smithyxml.Value) error { 11299 defer value.Close() 11300 if v.Condition != nil { 11301 rootAttr := []smithyxml.Attr{} 11302 root := smithyxml.StartElement{ 11303 Name: smithyxml.Name{ 11304 Local: "Condition", 11305 }, 11306 Attr: rootAttr, 11307 } 11308 el := value.MemberElement(root) 11309 if err := awsRestxml_serializeDocumentCondition(v.Condition, el); err != nil { 11310 return err 11311 } 11312 } 11313 if v.Redirect != nil { 11314 rootAttr := []smithyxml.Attr{} 11315 root := smithyxml.StartElement{ 11316 Name: smithyxml.Name{ 11317 Local: "Redirect", 11318 }, 11319 Attr: rootAttr, 11320 } 11321 el := value.MemberElement(root) 11322 if err := awsRestxml_serializeDocumentRedirect(v.Redirect, el); err != nil { 11323 return err 11324 } 11325 } 11326 return nil 11327} 11328 11329func awsRestxml_serializeDocumentRoutingRules(v []types.RoutingRule, value smithyxml.Value) error { 11330 var array *smithyxml.Array 11331 if !value.IsFlattened() { 11332 defer value.Close() 11333 } 11334 customMemberNameAttr := []smithyxml.Attr{} 11335 customMemberName := smithyxml.StartElement{ 11336 Name: smithyxml.Name{ 11337 Local: "RoutingRule", 11338 }, 11339 Attr: customMemberNameAttr, 11340 } 11341 array = value.ArrayWithCustomName(customMemberName) 11342 for i := range v { 11343 am := array.Member() 11344 if err := awsRestxml_serializeDocumentRoutingRule(&v[i], am); err != nil { 11345 return err 11346 } 11347 } 11348 return nil 11349} 11350 11351func awsRestxml_serializeDocumentS3KeyFilter(v *types.S3KeyFilter, value smithyxml.Value) error { 11352 defer value.Close() 11353 if v.FilterRules != nil { 11354 rootAttr := []smithyxml.Attr{} 11355 root := smithyxml.StartElement{ 11356 Name: smithyxml.Name{ 11357 Local: "FilterRule", 11358 }, 11359 Attr: rootAttr, 11360 } 11361 el := value.FlattenedElement(root) 11362 if err := awsRestxml_serializeDocumentFilterRuleList(v.FilterRules, el); err != nil { 11363 return err 11364 } 11365 } 11366 return nil 11367} 11368 11369func awsRestxml_serializeDocumentS3Location(v *types.S3Location, value smithyxml.Value) error { 11370 defer value.Close() 11371 if v.AccessControlList != nil { 11372 rootAttr := []smithyxml.Attr{} 11373 root := smithyxml.StartElement{ 11374 Name: smithyxml.Name{ 11375 Local: "AccessControlList", 11376 }, 11377 Attr: rootAttr, 11378 } 11379 el := value.MemberElement(root) 11380 if err := awsRestxml_serializeDocumentGrants(v.AccessControlList, el); err != nil { 11381 return err 11382 } 11383 } 11384 if v.BucketName != nil { 11385 rootAttr := []smithyxml.Attr{} 11386 root := smithyxml.StartElement{ 11387 Name: smithyxml.Name{ 11388 Local: "BucketName", 11389 }, 11390 Attr: rootAttr, 11391 } 11392 el := value.MemberElement(root) 11393 el.String(*v.BucketName) 11394 } 11395 if len(v.CannedACL) > 0 { 11396 rootAttr := []smithyxml.Attr{} 11397 root := smithyxml.StartElement{ 11398 Name: smithyxml.Name{ 11399 Local: "CannedACL", 11400 }, 11401 Attr: rootAttr, 11402 } 11403 el := value.MemberElement(root) 11404 el.String(string(v.CannedACL)) 11405 } 11406 if v.Encryption != nil { 11407 rootAttr := []smithyxml.Attr{} 11408 root := smithyxml.StartElement{ 11409 Name: smithyxml.Name{ 11410 Local: "Encryption", 11411 }, 11412 Attr: rootAttr, 11413 } 11414 el := value.MemberElement(root) 11415 if err := awsRestxml_serializeDocumentEncryption(v.Encryption, el); err != nil { 11416 return err 11417 } 11418 } 11419 if v.Prefix != nil { 11420 rootAttr := []smithyxml.Attr{} 11421 root := smithyxml.StartElement{ 11422 Name: smithyxml.Name{ 11423 Local: "Prefix", 11424 }, 11425 Attr: rootAttr, 11426 } 11427 el := value.MemberElement(root) 11428 el.String(*v.Prefix) 11429 } 11430 if len(v.StorageClass) > 0 { 11431 rootAttr := []smithyxml.Attr{} 11432 root := smithyxml.StartElement{ 11433 Name: smithyxml.Name{ 11434 Local: "StorageClass", 11435 }, 11436 Attr: rootAttr, 11437 } 11438 el := value.MemberElement(root) 11439 el.String(string(v.StorageClass)) 11440 } 11441 if v.Tagging != nil { 11442 rootAttr := []smithyxml.Attr{} 11443 root := smithyxml.StartElement{ 11444 Name: smithyxml.Name{ 11445 Local: "Tagging", 11446 }, 11447 Attr: rootAttr, 11448 } 11449 el := value.MemberElement(root) 11450 if err := awsRestxml_serializeDocumentTagging(v.Tagging, el); err != nil { 11451 return err 11452 } 11453 } 11454 if v.UserMetadata != nil { 11455 rootAttr := []smithyxml.Attr{} 11456 root := smithyxml.StartElement{ 11457 Name: smithyxml.Name{ 11458 Local: "UserMetadata", 11459 }, 11460 Attr: rootAttr, 11461 } 11462 el := value.MemberElement(root) 11463 if err := awsRestxml_serializeDocumentUserMetadata(v.UserMetadata, el); err != nil { 11464 return err 11465 } 11466 } 11467 return nil 11468} 11469 11470func awsRestxml_serializeDocumentSelectParameters(v *types.SelectParameters, value smithyxml.Value) error { 11471 defer value.Close() 11472 if v.Expression != nil { 11473 rootAttr := []smithyxml.Attr{} 11474 root := smithyxml.StartElement{ 11475 Name: smithyxml.Name{ 11476 Local: "Expression", 11477 }, 11478 Attr: rootAttr, 11479 } 11480 el := value.MemberElement(root) 11481 el.String(*v.Expression) 11482 } 11483 if len(v.ExpressionType) > 0 { 11484 rootAttr := []smithyxml.Attr{} 11485 root := smithyxml.StartElement{ 11486 Name: smithyxml.Name{ 11487 Local: "ExpressionType", 11488 }, 11489 Attr: rootAttr, 11490 } 11491 el := value.MemberElement(root) 11492 el.String(string(v.ExpressionType)) 11493 } 11494 if v.InputSerialization != nil { 11495 rootAttr := []smithyxml.Attr{} 11496 root := smithyxml.StartElement{ 11497 Name: smithyxml.Name{ 11498 Local: "InputSerialization", 11499 }, 11500 Attr: rootAttr, 11501 } 11502 el := value.MemberElement(root) 11503 if err := awsRestxml_serializeDocumentInputSerialization(v.InputSerialization, el); err != nil { 11504 return err 11505 } 11506 } 11507 if v.OutputSerialization != nil { 11508 rootAttr := []smithyxml.Attr{} 11509 root := smithyxml.StartElement{ 11510 Name: smithyxml.Name{ 11511 Local: "OutputSerialization", 11512 }, 11513 Attr: rootAttr, 11514 } 11515 el := value.MemberElement(root) 11516 if err := awsRestxml_serializeDocumentOutputSerialization(v.OutputSerialization, el); err != nil { 11517 return err 11518 } 11519 } 11520 return nil 11521} 11522 11523func awsRestxml_serializeDocumentServerSideEncryptionByDefault(v *types.ServerSideEncryptionByDefault, value smithyxml.Value) error { 11524 defer value.Close() 11525 if v.KMSMasterKeyID != nil { 11526 rootAttr := []smithyxml.Attr{} 11527 root := smithyxml.StartElement{ 11528 Name: smithyxml.Name{ 11529 Local: "KMSMasterKeyID", 11530 }, 11531 Attr: rootAttr, 11532 } 11533 el := value.MemberElement(root) 11534 el.String(*v.KMSMasterKeyID) 11535 } 11536 if len(v.SSEAlgorithm) > 0 { 11537 rootAttr := []smithyxml.Attr{} 11538 root := smithyxml.StartElement{ 11539 Name: smithyxml.Name{ 11540 Local: "SSEAlgorithm", 11541 }, 11542 Attr: rootAttr, 11543 } 11544 el := value.MemberElement(root) 11545 el.String(string(v.SSEAlgorithm)) 11546 } 11547 return nil 11548} 11549 11550func awsRestxml_serializeDocumentServerSideEncryptionConfiguration(v *types.ServerSideEncryptionConfiguration, value smithyxml.Value) error { 11551 defer value.Close() 11552 if v.Rules != nil { 11553 rootAttr := []smithyxml.Attr{} 11554 root := smithyxml.StartElement{ 11555 Name: smithyxml.Name{ 11556 Local: "Rule", 11557 }, 11558 Attr: rootAttr, 11559 } 11560 el := value.FlattenedElement(root) 11561 if err := awsRestxml_serializeDocumentServerSideEncryptionRules(v.Rules, el); err != nil { 11562 return err 11563 } 11564 } 11565 return nil 11566} 11567 11568func awsRestxml_serializeDocumentServerSideEncryptionRule(v *types.ServerSideEncryptionRule, value smithyxml.Value) error { 11569 defer value.Close() 11570 if v.ApplyServerSideEncryptionByDefault != nil { 11571 rootAttr := []smithyxml.Attr{} 11572 root := smithyxml.StartElement{ 11573 Name: smithyxml.Name{ 11574 Local: "ApplyServerSideEncryptionByDefault", 11575 }, 11576 Attr: rootAttr, 11577 } 11578 el := value.MemberElement(root) 11579 if err := awsRestxml_serializeDocumentServerSideEncryptionByDefault(v.ApplyServerSideEncryptionByDefault, el); err != nil { 11580 return err 11581 } 11582 } 11583 if v.BucketKeyEnabled { 11584 rootAttr := []smithyxml.Attr{} 11585 root := smithyxml.StartElement{ 11586 Name: smithyxml.Name{ 11587 Local: "BucketKeyEnabled", 11588 }, 11589 Attr: rootAttr, 11590 } 11591 el := value.MemberElement(root) 11592 el.Boolean(v.BucketKeyEnabled) 11593 } 11594 return nil 11595} 11596 11597func awsRestxml_serializeDocumentServerSideEncryptionRules(v []types.ServerSideEncryptionRule, value smithyxml.Value) error { 11598 var array *smithyxml.Array 11599 if !value.IsFlattened() { 11600 defer value.Close() 11601 } 11602 array = value.Array() 11603 for i := range v { 11604 am := array.Member() 11605 if err := awsRestxml_serializeDocumentServerSideEncryptionRule(&v[i], am); err != nil { 11606 return err 11607 } 11608 } 11609 return nil 11610} 11611 11612func awsRestxml_serializeDocumentSourceSelectionCriteria(v *types.SourceSelectionCriteria, value smithyxml.Value) error { 11613 defer value.Close() 11614 if v.ReplicaModifications != nil { 11615 rootAttr := []smithyxml.Attr{} 11616 root := smithyxml.StartElement{ 11617 Name: smithyxml.Name{ 11618 Local: "ReplicaModifications", 11619 }, 11620 Attr: rootAttr, 11621 } 11622 el := value.MemberElement(root) 11623 if err := awsRestxml_serializeDocumentReplicaModifications(v.ReplicaModifications, el); err != nil { 11624 return err 11625 } 11626 } 11627 if v.SseKmsEncryptedObjects != nil { 11628 rootAttr := []smithyxml.Attr{} 11629 root := smithyxml.StartElement{ 11630 Name: smithyxml.Name{ 11631 Local: "SseKmsEncryptedObjects", 11632 }, 11633 Attr: rootAttr, 11634 } 11635 el := value.MemberElement(root) 11636 if err := awsRestxml_serializeDocumentSseKmsEncryptedObjects(v.SseKmsEncryptedObjects, el); err != nil { 11637 return err 11638 } 11639 } 11640 return nil 11641} 11642 11643func awsRestxml_serializeDocumentSSEKMS(v *types.SSEKMS, value smithyxml.Value) error { 11644 defer value.Close() 11645 if v.KeyId != nil { 11646 rootAttr := []smithyxml.Attr{} 11647 root := smithyxml.StartElement{ 11648 Name: smithyxml.Name{ 11649 Local: "KeyId", 11650 }, 11651 Attr: rootAttr, 11652 } 11653 el := value.MemberElement(root) 11654 el.String(*v.KeyId) 11655 } 11656 return nil 11657} 11658 11659func awsRestxml_serializeDocumentSseKmsEncryptedObjects(v *types.SseKmsEncryptedObjects, value smithyxml.Value) error { 11660 defer value.Close() 11661 if len(v.Status) > 0 { 11662 rootAttr := []smithyxml.Attr{} 11663 root := smithyxml.StartElement{ 11664 Name: smithyxml.Name{ 11665 Local: "Status", 11666 }, 11667 Attr: rootAttr, 11668 } 11669 el := value.MemberElement(root) 11670 el.String(string(v.Status)) 11671 } 11672 return nil 11673} 11674 11675func awsRestxml_serializeDocumentSSES3(v *types.SSES3, value smithyxml.Value) error { 11676 defer value.Close() 11677 return nil 11678} 11679 11680func awsRestxml_serializeDocumentStorageClassAnalysis(v *types.StorageClassAnalysis, value smithyxml.Value) error { 11681 defer value.Close() 11682 if v.DataExport != nil { 11683 rootAttr := []smithyxml.Attr{} 11684 root := smithyxml.StartElement{ 11685 Name: smithyxml.Name{ 11686 Local: "DataExport", 11687 }, 11688 Attr: rootAttr, 11689 } 11690 el := value.MemberElement(root) 11691 if err := awsRestxml_serializeDocumentStorageClassAnalysisDataExport(v.DataExport, el); err != nil { 11692 return err 11693 } 11694 } 11695 return nil 11696} 11697 11698func awsRestxml_serializeDocumentStorageClassAnalysisDataExport(v *types.StorageClassAnalysisDataExport, value smithyxml.Value) error { 11699 defer value.Close() 11700 if v.Destination != nil { 11701 rootAttr := []smithyxml.Attr{} 11702 root := smithyxml.StartElement{ 11703 Name: smithyxml.Name{ 11704 Local: "Destination", 11705 }, 11706 Attr: rootAttr, 11707 } 11708 el := value.MemberElement(root) 11709 if err := awsRestxml_serializeDocumentAnalyticsExportDestination(v.Destination, el); err != nil { 11710 return err 11711 } 11712 } 11713 if len(v.OutputSchemaVersion) > 0 { 11714 rootAttr := []smithyxml.Attr{} 11715 root := smithyxml.StartElement{ 11716 Name: smithyxml.Name{ 11717 Local: "OutputSchemaVersion", 11718 }, 11719 Attr: rootAttr, 11720 } 11721 el := value.MemberElement(root) 11722 el.String(string(v.OutputSchemaVersion)) 11723 } 11724 return nil 11725} 11726 11727func awsRestxml_serializeDocumentTag(v *types.Tag, value smithyxml.Value) error { 11728 defer value.Close() 11729 if v.Key != nil { 11730 rootAttr := []smithyxml.Attr{} 11731 root := smithyxml.StartElement{ 11732 Name: smithyxml.Name{ 11733 Local: "Key", 11734 }, 11735 Attr: rootAttr, 11736 } 11737 el := value.MemberElement(root) 11738 el.String(*v.Key) 11739 } 11740 if v.Value != nil { 11741 rootAttr := []smithyxml.Attr{} 11742 root := smithyxml.StartElement{ 11743 Name: smithyxml.Name{ 11744 Local: "Value", 11745 }, 11746 Attr: rootAttr, 11747 } 11748 el := value.MemberElement(root) 11749 el.String(*v.Value) 11750 } 11751 return nil 11752} 11753 11754func awsRestxml_serializeDocumentTagging(v *types.Tagging, value smithyxml.Value) error { 11755 defer value.Close() 11756 if v.TagSet != nil { 11757 rootAttr := []smithyxml.Attr{} 11758 root := smithyxml.StartElement{ 11759 Name: smithyxml.Name{ 11760 Local: "TagSet", 11761 }, 11762 Attr: rootAttr, 11763 } 11764 el := value.MemberElement(root) 11765 if err := awsRestxml_serializeDocumentTagSet(v.TagSet, el); err != nil { 11766 return err 11767 } 11768 } 11769 return nil 11770} 11771 11772func awsRestxml_serializeDocumentTagSet(v []types.Tag, value smithyxml.Value) error { 11773 var array *smithyxml.Array 11774 if !value.IsFlattened() { 11775 defer value.Close() 11776 } 11777 customMemberNameAttr := []smithyxml.Attr{} 11778 customMemberName := smithyxml.StartElement{ 11779 Name: smithyxml.Name{ 11780 Local: "Tag", 11781 }, 11782 Attr: customMemberNameAttr, 11783 } 11784 array = value.ArrayWithCustomName(customMemberName) 11785 for i := range v { 11786 am := array.Member() 11787 if err := awsRestxml_serializeDocumentTag(&v[i], am); err != nil { 11788 return err 11789 } 11790 } 11791 return nil 11792} 11793 11794func awsRestxml_serializeDocumentTargetGrant(v *types.TargetGrant, value smithyxml.Value) error { 11795 defer value.Close() 11796 if v.Grantee != nil { 11797 rootAttr := []smithyxml.Attr{} 11798 root := smithyxml.StartElement{ 11799 Name: smithyxml.Name{ 11800 Local: "Grantee", 11801 }, 11802 Attr: rootAttr, 11803 } 11804 el := value.MemberElement(root) 11805 if err := awsRestxml_serializeDocumentGrantee(v.Grantee, el); err != nil { 11806 return err 11807 } 11808 } 11809 if len(v.Permission) > 0 { 11810 rootAttr := []smithyxml.Attr{} 11811 root := smithyxml.StartElement{ 11812 Name: smithyxml.Name{ 11813 Local: "Permission", 11814 }, 11815 Attr: rootAttr, 11816 } 11817 el := value.MemberElement(root) 11818 el.String(string(v.Permission)) 11819 } 11820 return nil 11821} 11822 11823func awsRestxml_serializeDocumentTargetGrants(v []types.TargetGrant, value smithyxml.Value) error { 11824 var array *smithyxml.Array 11825 if !value.IsFlattened() { 11826 defer value.Close() 11827 } 11828 customMemberNameAttr := []smithyxml.Attr{} 11829 customMemberName := smithyxml.StartElement{ 11830 Name: smithyxml.Name{ 11831 Local: "Grant", 11832 }, 11833 Attr: customMemberNameAttr, 11834 } 11835 array = value.ArrayWithCustomName(customMemberName) 11836 for i := range v { 11837 am := array.Member() 11838 if err := awsRestxml_serializeDocumentTargetGrant(&v[i], am); err != nil { 11839 return err 11840 } 11841 } 11842 return nil 11843} 11844 11845func awsRestxml_serializeDocumentTiering(v *types.Tiering, value smithyxml.Value) error { 11846 defer value.Close() 11847 if len(v.AccessTier) > 0 { 11848 rootAttr := []smithyxml.Attr{} 11849 root := smithyxml.StartElement{ 11850 Name: smithyxml.Name{ 11851 Local: "AccessTier", 11852 }, 11853 Attr: rootAttr, 11854 } 11855 el := value.MemberElement(root) 11856 el.String(string(v.AccessTier)) 11857 } 11858 if v.Days != 0 { 11859 rootAttr := []smithyxml.Attr{} 11860 root := smithyxml.StartElement{ 11861 Name: smithyxml.Name{ 11862 Local: "Days", 11863 }, 11864 Attr: rootAttr, 11865 } 11866 el := value.MemberElement(root) 11867 el.Integer(v.Days) 11868 } 11869 return nil 11870} 11871 11872func awsRestxml_serializeDocumentTieringList(v []types.Tiering, value smithyxml.Value) error { 11873 var array *smithyxml.Array 11874 if !value.IsFlattened() { 11875 defer value.Close() 11876 } 11877 array = value.Array() 11878 for i := range v { 11879 am := array.Member() 11880 if err := awsRestxml_serializeDocumentTiering(&v[i], am); err != nil { 11881 return err 11882 } 11883 } 11884 return nil 11885} 11886 11887func awsRestxml_serializeDocumentTopicConfiguration(v *types.TopicConfiguration, value smithyxml.Value) error { 11888 defer value.Close() 11889 if v.Events != nil { 11890 rootAttr := []smithyxml.Attr{} 11891 root := smithyxml.StartElement{ 11892 Name: smithyxml.Name{ 11893 Local: "Event", 11894 }, 11895 Attr: rootAttr, 11896 } 11897 el := value.FlattenedElement(root) 11898 if err := awsRestxml_serializeDocumentEventList(v.Events, el); err != nil { 11899 return err 11900 } 11901 } 11902 if v.Filter != nil { 11903 rootAttr := []smithyxml.Attr{} 11904 root := smithyxml.StartElement{ 11905 Name: smithyxml.Name{ 11906 Local: "Filter", 11907 }, 11908 Attr: rootAttr, 11909 } 11910 el := value.MemberElement(root) 11911 if err := awsRestxml_serializeDocumentNotificationConfigurationFilter(v.Filter, el); err != nil { 11912 return err 11913 } 11914 } 11915 if v.Id != nil { 11916 rootAttr := []smithyxml.Attr{} 11917 root := smithyxml.StartElement{ 11918 Name: smithyxml.Name{ 11919 Local: "Id", 11920 }, 11921 Attr: rootAttr, 11922 } 11923 el := value.MemberElement(root) 11924 el.String(*v.Id) 11925 } 11926 if v.TopicArn != nil { 11927 rootAttr := []smithyxml.Attr{} 11928 root := smithyxml.StartElement{ 11929 Name: smithyxml.Name{ 11930 Local: "Topic", 11931 }, 11932 Attr: rootAttr, 11933 } 11934 el := value.MemberElement(root) 11935 el.String(*v.TopicArn) 11936 } 11937 return nil 11938} 11939 11940func awsRestxml_serializeDocumentTopicConfigurationList(v []types.TopicConfiguration, value smithyxml.Value) error { 11941 var array *smithyxml.Array 11942 if !value.IsFlattened() { 11943 defer value.Close() 11944 } 11945 array = value.Array() 11946 for i := range v { 11947 am := array.Member() 11948 if err := awsRestxml_serializeDocumentTopicConfiguration(&v[i], am); err != nil { 11949 return err 11950 } 11951 } 11952 return nil 11953} 11954 11955func awsRestxml_serializeDocumentTransition(v *types.Transition, value smithyxml.Value) error { 11956 defer value.Close() 11957 if v.Date != nil { 11958 rootAttr := []smithyxml.Attr{} 11959 root := smithyxml.StartElement{ 11960 Name: smithyxml.Name{ 11961 Local: "Date", 11962 }, 11963 Attr: rootAttr, 11964 } 11965 el := value.MemberElement(root) 11966 el.String(smithytime.FormatDateTime(*v.Date)) 11967 } 11968 if v.Days != 0 { 11969 rootAttr := []smithyxml.Attr{} 11970 root := smithyxml.StartElement{ 11971 Name: smithyxml.Name{ 11972 Local: "Days", 11973 }, 11974 Attr: rootAttr, 11975 } 11976 el := value.MemberElement(root) 11977 el.Integer(v.Days) 11978 } 11979 if len(v.StorageClass) > 0 { 11980 rootAttr := []smithyxml.Attr{} 11981 root := smithyxml.StartElement{ 11982 Name: smithyxml.Name{ 11983 Local: "StorageClass", 11984 }, 11985 Attr: rootAttr, 11986 } 11987 el := value.MemberElement(root) 11988 el.String(string(v.StorageClass)) 11989 } 11990 return nil 11991} 11992 11993func awsRestxml_serializeDocumentTransitionList(v []types.Transition, value smithyxml.Value) error { 11994 var array *smithyxml.Array 11995 if !value.IsFlattened() { 11996 defer value.Close() 11997 } 11998 array = value.Array() 11999 for i := range v { 12000 am := array.Member() 12001 if err := awsRestxml_serializeDocumentTransition(&v[i], am); err != nil { 12002 return err 12003 } 12004 } 12005 return nil 12006} 12007 12008func awsRestxml_serializeDocumentUserMetadata(v []types.MetadataEntry, value smithyxml.Value) error { 12009 var array *smithyxml.Array 12010 if !value.IsFlattened() { 12011 defer value.Close() 12012 } 12013 customMemberNameAttr := []smithyxml.Attr{} 12014 customMemberName := smithyxml.StartElement{ 12015 Name: smithyxml.Name{ 12016 Local: "MetadataEntry", 12017 }, 12018 Attr: customMemberNameAttr, 12019 } 12020 array = value.ArrayWithCustomName(customMemberName) 12021 for i := range v { 12022 am := array.Member() 12023 if err := awsRestxml_serializeDocumentMetadataEntry(&v[i], am); err != nil { 12024 return err 12025 } 12026 } 12027 return nil 12028} 12029 12030func awsRestxml_serializeDocumentVersioningConfiguration(v *types.VersioningConfiguration, value smithyxml.Value) error { 12031 defer value.Close() 12032 if len(v.MFADelete) > 0 { 12033 rootAttr := []smithyxml.Attr{} 12034 root := smithyxml.StartElement{ 12035 Name: smithyxml.Name{ 12036 Local: "MfaDelete", 12037 }, 12038 Attr: rootAttr, 12039 } 12040 el := value.MemberElement(root) 12041 el.String(string(v.MFADelete)) 12042 } 12043 if len(v.Status) > 0 { 12044 rootAttr := []smithyxml.Attr{} 12045 root := smithyxml.StartElement{ 12046 Name: smithyxml.Name{ 12047 Local: "Status", 12048 }, 12049 Attr: rootAttr, 12050 } 12051 el := value.MemberElement(root) 12052 el.String(string(v.Status)) 12053 } 12054 return nil 12055} 12056 12057func awsRestxml_serializeDocumentWebsiteConfiguration(v *types.WebsiteConfiguration, value smithyxml.Value) error { 12058 defer value.Close() 12059 if v.ErrorDocument != nil { 12060 rootAttr := []smithyxml.Attr{} 12061 root := smithyxml.StartElement{ 12062 Name: smithyxml.Name{ 12063 Local: "ErrorDocument", 12064 }, 12065 Attr: rootAttr, 12066 } 12067 el := value.MemberElement(root) 12068 if err := awsRestxml_serializeDocumentErrorDocument(v.ErrorDocument, el); err != nil { 12069 return err 12070 } 12071 } 12072 if v.IndexDocument != nil { 12073 rootAttr := []smithyxml.Attr{} 12074 root := smithyxml.StartElement{ 12075 Name: smithyxml.Name{ 12076 Local: "IndexDocument", 12077 }, 12078 Attr: rootAttr, 12079 } 12080 el := value.MemberElement(root) 12081 if err := awsRestxml_serializeDocumentIndexDocument(v.IndexDocument, el); err != nil { 12082 return err 12083 } 12084 } 12085 if v.RedirectAllRequestsTo != nil { 12086 rootAttr := []smithyxml.Attr{} 12087 root := smithyxml.StartElement{ 12088 Name: smithyxml.Name{ 12089 Local: "RedirectAllRequestsTo", 12090 }, 12091 Attr: rootAttr, 12092 } 12093 el := value.MemberElement(root) 12094 if err := awsRestxml_serializeDocumentRedirectAllRequestsTo(v.RedirectAllRequestsTo, el); err != nil { 12095 return err 12096 } 12097 } 12098 if v.RoutingRules != nil { 12099 rootAttr := []smithyxml.Attr{} 12100 root := smithyxml.StartElement{ 12101 Name: smithyxml.Name{ 12102 Local: "RoutingRules", 12103 }, 12104 Attr: rootAttr, 12105 } 12106 el := value.MemberElement(root) 12107 if err := awsRestxml_serializeDocumentRoutingRules(v.RoutingRules, el); err != nil { 12108 return err 12109 } 12110 } 12111 return nil 12112} 12113