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