mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-19 15:06:25 +01:00
22666 lines
572 KiB
Go
22666 lines
572 KiB
Go
// Code generated by smithy-go-codegen DO NOT EDIT.
|
|
|
|
package s3
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"encoding/json"
|
|
"encoding/xml"
|
|
"fmt"
|
|
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
|
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
|
|
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
|
|
awsxml "github.com/aws/aws-sdk-go-v2/aws/protocol/xml"
|
|
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
|
|
"github.com/aws/aws-sdk-go-v2/service/s3/types"
|
|
smithy "github.com/aws/smithy-go"
|
|
smithyxml "github.com/aws/smithy-go/encoding/xml"
|
|
smithyio "github.com/aws/smithy-go/io"
|
|
"github.com/aws/smithy-go/middleware"
|
|
"github.com/aws/smithy-go/ptr"
|
|
smithytime "github.com/aws/smithy-go/time"
|
|
smithyhttp "github.com/aws/smithy-go/transport/http"
|
|
"io"
|
|
"io/ioutil"
|
|
"strconv"
|
|
"strings"
|
|
)
|
|
|
|
type awsRestxml_deserializeOpAbortMultipartUpload struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpAbortMultipartUpload) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpAbortMultipartUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorAbortMultipartUpload(response, &metadata)
|
|
}
|
|
output := &AbortMultipartUploadOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsAbortMultipartUploadOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorAbortMultipartUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchUpload", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchUpload(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsAbortMultipartUploadOutput(v *AbortMultipartUploadOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpCompleteMultipartUpload struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpCompleteMultipartUpload) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpCompleteMultipartUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorCompleteMultipartUpload(response, &metadata)
|
|
}
|
|
output := &CompleteMultipartUploadOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsCompleteMultipartUploadOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentCompleteMultipartUploadOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorCompleteMultipartUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsCompleteMultipartUploadOutput(v *CompleteMultipartUploadOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-expiration"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Expiration = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentCompleteMultipartUploadOutput(v **CompleteMultipartUploadOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *CompleteMultipartUploadOutput
|
|
if *v == nil {
|
|
sv = &CompleteMultipartUploadOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32C", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32C = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA1", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA1 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA256", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA256 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Location", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Location = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpCopyObject struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpCopyObject) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpCopyObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorCopyObject(response, &metadata)
|
|
}
|
|
output := &CopyObjectOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsCopyObjectOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentCopyObjectResult(&output.CopyObjectResult, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorCopyObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("ObjectNotInActiveTierError", errorCode):
|
|
return awsRestxml_deserializeErrorObjectNotInActiveTierError(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsCopyObjectOutput(v *CopyObjectOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-copy-source-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.CopySourceVersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-expiration"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Expiration = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-context"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSEncryptionContext = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentCopyObjectOutput(v **CopyObjectOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *CopyObjectOutput
|
|
if *v == nil {
|
|
sv = &CopyObjectOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CopyObjectResult", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCopyObjectResult(&sv.CopyObjectResult, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpCreateBucket struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpCreateBucket) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpCreateBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorCreateBucket(response, &metadata)
|
|
}
|
|
output := &CreateBucketOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorCreateBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("BucketAlreadyExists", errorCode):
|
|
return awsRestxml_deserializeErrorBucketAlreadyExists(response, errorBody)
|
|
|
|
case strings.EqualFold("BucketAlreadyOwnedByYou", errorCode):
|
|
return awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsCreateBucketOutput(v *CreateBucketOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Location"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Location = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpCreateMultipartUpload struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpCreateMultipartUpload) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpCreateMultipartUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorCreateMultipartUpload(response, &metadata)
|
|
}
|
|
output := &CreateMultipartUploadOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsCreateMultipartUploadOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentCreateMultipartUploadOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorCreateMultipartUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsCreateMultipartUploadOutput(v *CreateMultipartUploadOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-abort-date"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.AbortDate = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-abort-rule-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.AbortRuleId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumAlgorithm = types.ChecksumAlgorithm(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-context"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSEncryptionContext = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentCreateMultipartUploadOutput(v **CreateMultipartUploadOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *CreateMultipartUploadOutput
|
|
if *v == nil {
|
|
sv = &CreateMultipartUploadOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("UploadId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.UploadId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpCreateSession struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpCreateSession) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpCreateSession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorCreateSession(response, &metadata)
|
|
}
|
|
output := &CreateSessionOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentCreateSessionOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorCreateSession(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchBucket", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchBucket(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentCreateSessionOutput(v **CreateSessionOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *CreateSessionOutput
|
|
if *v == nil {
|
|
sv = &CreateSessionOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Credentials", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentSessionCredentials(&sv.Credentials, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucket struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucket) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucket(response, &metadata)
|
|
}
|
|
output := &DeleteBucketOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketAnalyticsConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketAnalyticsConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketAnalyticsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketAnalyticsConfiguration(response, &metadata)
|
|
}
|
|
output := &DeleteBucketAnalyticsConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketAnalyticsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketCors struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketCors) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketCors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketCors(response, &metadata)
|
|
}
|
|
output := &DeleteBucketCorsOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketCors(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketEncryption struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketEncryption) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketEncryption(response, &metadata)
|
|
}
|
|
output := &DeleteBucketEncryptionOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketIntelligentTieringConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketIntelligentTieringConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketIntelligentTieringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketIntelligentTieringConfiguration(response, &metadata)
|
|
}
|
|
output := &DeleteBucketIntelligentTieringConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketIntelligentTieringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketInventoryConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketInventoryConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketInventoryConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketInventoryConfiguration(response, &metadata)
|
|
}
|
|
output := &DeleteBucketInventoryConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketInventoryConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketLifecycle struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketLifecycle) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketLifecycle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketLifecycle(response, &metadata)
|
|
}
|
|
output := &DeleteBucketLifecycleOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketLifecycle(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketMetricsConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketMetricsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(response, &metadata)
|
|
}
|
|
output := &DeleteBucketMetricsConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketMetricsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketOwnershipControls struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketOwnershipControls) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketOwnershipControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(response, &metadata)
|
|
}
|
|
output := &DeleteBucketOwnershipControlsOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketOwnershipControls(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketPolicy struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketPolicy(response, &metadata)
|
|
}
|
|
output := &DeleteBucketPolicyOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketReplication struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketReplication) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketReplication(response, &metadata)
|
|
}
|
|
output := &DeleteBucketReplicationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketTagging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketTagging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketTagging(response, &metadata)
|
|
}
|
|
output := &DeleteBucketTaggingOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteBucketWebsite struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteBucketWebsite) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteBucketWebsite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteBucketWebsite(response, &metadata)
|
|
}
|
|
output := &DeleteBucketWebsiteOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteBucketWebsite(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteObject struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteObject) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteObject(response, &metadata)
|
|
}
|
|
output := &DeleteObjectOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsDeleteObjectOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsDeleteObjectOutput(v *DeleteObjectOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-delete-marker"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.DeleteMarker = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteObjects struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteObjects) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteObjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteObjects(response, &metadata)
|
|
}
|
|
output := &DeleteObjectsOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsDeleteObjectsOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentDeleteObjectsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteObjects(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsDeleteObjectsOutput(v *DeleteObjectsOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentDeleteObjectsOutput(v **DeleteObjectsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *DeleteObjectsOutput
|
|
if *v == nil {
|
|
sv = &DeleteObjectsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Deleted", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentDeletedObjectsUnwrapped(&sv.Deleted, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Error", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentErrorsUnwrapped(&sv.Errors, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeleteObjectTagging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeleteObjectTagging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeleteObjectTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeleteObjectTagging(response, &metadata)
|
|
}
|
|
output := &DeleteObjectTaggingOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsDeleteObjectTaggingOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeleteObjectTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsDeleteObjectTaggingOutput(v *DeleteObjectTaggingOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpDeletePublicAccessBlock struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpDeletePublicAccessBlock) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpDeletePublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response, &metadata)
|
|
}
|
|
output := &DeletePublicAccessBlockOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorDeletePublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketAccelerateConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketAccelerateConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketAccelerateConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketAccelerateConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketAccelerateConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsGetBucketAccelerateConfigurationOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketAccelerateConfigurationOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketAccelerateConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsGetBucketAccelerateConfigurationOutput(v *GetBucketAccelerateConfigurationOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentGetBucketAccelerateConfigurationOutput(v **GetBucketAccelerateConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketAccelerateConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketAccelerateConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.BucketAccelerateStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketAcl struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketAcl) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketAcl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketAcl(response, &metadata)
|
|
}
|
|
output := &GetBucketAclOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketAclOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketAcl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketAclOutput(v **GetBucketAclOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketAclOutput
|
|
if *v == nil {
|
|
sv = &GetBucketAclOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessControlList", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentGrants(&sv.Grants, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketAnalyticsConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketAnalyticsConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketAnalyticsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketAnalyticsConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketAnalyticsConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentAnalyticsConfiguration(&output.AnalyticsConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketAnalyticsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketAnalyticsConfigurationOutput(v **GetBucketAnalyticsConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketAnalyticsConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketAnalyticsConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AnalyticsConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAnalyticsConfiguration(&sv.AnalyticsConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketCors struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketCors) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketCors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketCors(response, &metadata)
|
|
}
|
|
output := &GetBucketCorsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketCorsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketCors(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketCorsOutput(v **GetBucketCorsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketCorsOutput
|
|
if *v == nil {
|
|
sv = &GetBucketCorsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CORSRule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCORSRulesUnwrapped(&sv.CORSRules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketEncryption struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketEncryption) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketEncryption(response, &metadata)
|
|
}
|
|
output := &GetBucketEncryptionOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentServerSideEncryptionConfiguration(&output.ServerSideEncryptionConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketEncryptionOutput(v **GetBucketEncryptionOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketEncryptionOutput
|
|
if *v == nil {
|
|
sv = &GetBucketEncryptionOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ServerSideEncryptionConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentServerSideEncryptionConfiguration(&sv.ServerSideEncryptionConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketIntelligentTieringConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketIntelligentTieringConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketIntelligentTieringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketIntelligentTieringConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketIntelligentTieringConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentIntelligentTieringConfiguration(&output.IntelligentTieringConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketIntelligentTieringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketIntelligentTieringConfigurationOutput(v **GetBucketIntelligentTieringConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketIntelligentTieringConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketIntelligentTieringConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("IntelligentTieringConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentIntelligentTieringConfiguration(&sv.IntelligentTieringConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketInventoryConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketInventoryConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketInventoryConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketInventoryConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketInventoryConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentInventoryConfiguration(&output.InventoryConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketInventoryConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketInventoryConfigurationOutput(v **GetBucketInventoryConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketInventoryConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketInventoryConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("InventoryConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryConfiguration(&sv.InventoryConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketLifecycleConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketLifecycleConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketLifecycleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketLifecycleConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketLifecycleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketLifecycleConfigurationOutput(v **GetBucketLifecycleConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketLifecycleConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketLifecycleConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Rule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentLifecycleRulesUnwrapped(&sv.Rules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketLocation struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketLocation) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketLocation(response, &metadata)
|
|
}
|
|
output := &GetBucketLocationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketLocationOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketLocationOutput(v **GetBucketLocationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketLocationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketLocationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("LocationConstraint", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.LocationConstraint = types.BucketLocationConstraint(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketLogging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketLogging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketLogging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketLogging(response, &metadata)
|
|
}
|
|
output := &GetBucketLoggingOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketLoggingOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketLogging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketLoggingOutput(v **GetBucketLoggingOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketLoggingOutput
|
|
if *v == nil {
|
|
sv = &GetBucketLoggingOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("LoggingEnabled", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentLoggingEnabled(&sv.LoggingEnabled, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketMetricsConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketMetricsConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketMetricsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketMetricsConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketMetricsConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentMetricsConfiguration(&output.MetricsConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketMetricsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketMetricsConfigurationOutput(v **GetBucketMetricsConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketMetricsConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketMetricsConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("MetricsConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentMetricsConfiguration(&sv.MetricsConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketNotificationConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketNotificationConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketNotificationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketNotificationConfiguration(response, &metadata)
|
|
}
|
|
output := &GetBucketNotificationConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketNotificationConfigurationOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketNotificationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketNotificationConfigurationOutput(v **GetBucketNotificationConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketNotificationConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketNotificationConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("EventBridgeConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentEventBridgeConfiguration(&sv.EventBridgeConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("CloudFunctionConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentLambdaFunctionConfigurationListUnwrapped(&sv.LambdaFunctionConfigurations, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("QueueConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentQueueConfigurationListUnwrapped(&sv.QueueConfigurations, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("TopicConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTopicConfigurationListUnwrapped(&sv.TopicConfigurations, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketOwnershipControls struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketOwnershipControls) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketOwnershipControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketOwnershipControls(response, &metadata)
|
|
}
|
|
output := &GetBucketOwnershipControlsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentOwnershipControls(&output.OwnershipControls, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketOwnershipControls(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketOwnershipControlsOutput(v **GetBucketOwnershipControlsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketOwnershipControlsOutput
|
|
if *v == nil {
|
|
sv = &GetBucketOwnershipControlsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("OwnershipControls", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwnershipControls(&sv.OwnershipControls, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketPolicy struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketPolicy(response, &metadata)
|
|
}
|
|
output := &GetBucketPolicyOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(output, response.Body, response.ContentLength)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketPolicyOutput(v *GetBucketPolicyOutput, body io.ReadCloser, contentLength int64) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization of nil %T", v)
|
|
}
|
|
var buf bytes.Buffer
|
|
if contentLength > 0 {
|
|
buf.Grow(int(contentLength))
|
|
} else {
|
|
buf.Grow(512)
|
|
}
|
|
|
|
_, err := buf.ReadFrom(body)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if buf.Len() > 0 {
|
|
v.Policy = ptr.String(buf.String())
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketPolicyStatus struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketPolicyStatus) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketPolicyStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketPolicyStatus(response, &metadata)
|
|
}
|
|
output := &GetBucketPolicyStatusOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentPolicyStatus(&output.PolicyStatus, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketPolicyStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketPolicyStatusOutput(v **GetBucketPolicyStatusOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketPolicyStatusOutput
|
|
if *v == nil {
|
|
sv = &GetBucketPolicyStatusOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("PolicyStatus", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentPolicyStatus(&sv.PolicyStatus, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketReplication struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketReplication) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketReplication(response, &metadata)
|
|
}
|
|
output := &GetBucketReplicationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentReplicationConfiguration(&output.ReplicationConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketReplicationOutput(v **GetBucketReplicationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketReplicationOutput
|
|
if *v == nil {
|
|
sv = &GetBucketReplicationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ReplicationConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicationConfiguration(&sv.ReplicationConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketRequestPayment struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketRequestPayment) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketRequestPayment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketRequestPayment(response, &metadata)
|
|
}
|
|
output := &GetBucketRequestPaymentOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketRequestPaymentOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketRequestPayment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketRequestPaymentOutput(v **GetBucketRequestPaymentOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketRequestPaymentOutput
|
|
if *v == nil {
|
|
sv = &GetBucketRequestPaymentOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Payer", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Payer = types.Payer(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketTagging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketTagging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketTagging(response, &metadata)
|
|
}
|
|
output := &GetBucketTaggingOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketTaggingOutput(v **GetBucketTaggingOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketTaggingOutput
|
|
if *v == nil {
|
|
sv = &GetBucketTaggingOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("TagSet", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSet(&sv.TagSet, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketVersioning struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketVersioning) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketVersioning) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketVersioning(response, &metadata)
|
|
}
|
|
output := &GetBucketVersioningOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketVersioning(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketVersioningOutput(v **GetBucketVersioningOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketVersioningOutput
|
|
if *v == nil {
|
|
sv = &GetBucketVersioningOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("MfaDelete", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.MFADelete = types.MFADeleteStatus(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.BucketVersioningStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetBucketWebsite struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetBucketWebsite) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetBucketWebsite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetBucketWebsite(response, &metadata)
|
|
}
|
|
output := &GetBucketWebsiteOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetBucketWebsiteOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetBucketWebsite(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetBucketWebsiteOutput(v **GetBucketWebsiteOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetBucketWebsiteOutput
|
|
if *v == nil {
|
|
sv = &GetBucketWebsiteOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ErrorDocument", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentErrorDocument(&sv.ErrorDocument, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("IndexDocument", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentIndexDocument(&sv.IndexDocument, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("RedirectAllRequestsTo", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentRedirectAllRequestsTo(&sv.RedirectAllRequestsTo, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("RoutingRules", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentRoutingRules(&sv.RoutingRules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObject struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObject) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObject(response, &metadata)
|
|
}
|
|
output := &GetObjectOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsGetObjectOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
err = awsRestxml_deserializeOpDocumentGetObjectOutput(output, response.Body)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("InvalidObjectState", errorCode):
|
|
return awsRestxml_deserializeErrorInvalidObjectState(response, errorBody)
|
|
|
|
case strings.EqualFold("NoSuchKey", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchKey(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("accept-ranges"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.AcceptRanges = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.CacheControl = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32c"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32C = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha1"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA1 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha256"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA256 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Disposition"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentDisposition = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Encoding"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentEncoding = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Language"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentLanguage = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Length"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.ContentLength = ptr.Int64(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Range"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentRange = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentType = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-delete-marker"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.DeleteMarker = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ETag = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-expiration"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Expiration = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.Expires = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
for headerKey, headerValues := range response.Header {
|
|
if lenPrefix := len("x-amz-meta-"); len(headerKey) >= lenPrefix && strings.EqualFold(headerKey[:lenPrefix], "x-amz-meta-") {
|
|
if v.Metadata == nil {
|
|
v.Metadata = map[string]string{}
|
|
}
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Metadata[strings.ToLower(headerKey[lenPrefix:])] = headerValues[0]
|
|
}
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-missing-meta"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.MissingMeta = ptr.Int32(int32(vv))
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-object-lock-legal-hold"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-object-lock-mode"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ObjectLockMode = types.ObjectLockMode(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-object-lock-retain-until-date"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseDateTime(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.ObjectLockRetainUntilDate = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-mp-parts-count"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.PartsCount = ptr.Int32(int32(vv))
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-replication-status"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ReplicationStatus = types.ReplicationStatus(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-restore"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Restore = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-storage-class"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.StorageClass = types.StorageClass(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-tagging-count"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.TagCount = ptr.Int32(int32(vv))
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-website-redirect-location"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.WebsiteRedirectLocation = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentGetObjectOutput(v *GetObjectOutput, body io.ReadCloser) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization of nil %T", v)
|
|
}
|
|
v.Body = body
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectAcl struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectAcl) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectAcl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectAcl(response, &metadata)
|
|
}
|
|
output := &GetObjectAclOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsGetObjectAclOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetObjectAclOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectAcl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchKey", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchKey(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsGetObjectAclOutput(v *GetObjectAclOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentGetObjectAclOutput(v **GetObjectAclOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetObjectAclOutput
|
|
if *v == nil {
|
|
sv = &GetObjectAclOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessControlList", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentGrants(&sv.Grants, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectAttributes struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectAttributes) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectAttributes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectAttributes(response, &metadata)
|
|
}
|
|
output := &GetObjectAttributesOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsGetObjectAttributesOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetObjectAttributesOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectAttributes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchKey", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchKey(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsGetObjectAttributesOutput(v *GetObjectAttributesOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-delete-marker"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.DeleteMarker = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentGetObjectAttributesOutput(v **GetObjectAttributesOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetObjectAttributesOutput
|
|
if *v == nil {
|
|
sv = &GetObjectAttributesOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Checksum", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentChecksum(&sv.Checksum, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ObjectParts", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentGetObjectAttributesParts(&sv.ObjectParts, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ObjectSize", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ObjectSize = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.StorageClass(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectLegalHold struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectLegalHold) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectLegalHold) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectLegalHold(response, &metadata)
|
|
}
|
|
output := &GetObjectLegalHoldOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentObjectLockLegalHold(&output.LegalHold, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectLegalHold(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetObjectLegalHoldOutput(v **GetObjectLegalHoldOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetObjectLegalHoldOutput
|
|
if *v == nil {
|
|
sv = &GetObjectLegalHoldOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("LegalHold", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectLockLegalHold(&sv.LegalHold, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectLockConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectLockConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectLockConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectLockConfiguration(response, &metadata)
|
|
}
|
|
output := &GetObjectLockConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentObjectLockConfiguration(&output.ObjectLockConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectLockConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetObjectLockConfigurationOutput(v **GetObjectLockConfigurationOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetObjectLockConfigurationOutput
|
|
if *v == nil {
|
|
sv = &GetObjectLockConfigurationOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ObjectLockConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectLockConfiguration(&sv.ObjectLockConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectRetention struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectRetention) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectRetention) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectRetention(response, &metadata)
|
|
}
|
|
output := &GetObjectRetentionOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentObjectLockRetention(&output.Retention, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectRetention(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetObjectRetentionOutput(v **GetObjectRetentionOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetObjectRetentionOutput
|
|
if *v == nil {
|
|
sv = &GetObjectRetentionOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Retention", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectLockRetention(&sv.Retention, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectTagging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectTagging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectTagging(response, &metadata)
|
|
}
|
|
output := &GetObjectTaggingOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsGetObjectTaggingOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentGetObjectTaggingOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsGetObjectTaggingOutput(v *GetObjectTaggingOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentGetObjectTaggingOutput(v **GetObjectTaggingOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetObjectTaggingOutput
|
|
if *v == nil {
|
|
sv = &GetObjectTaggingOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("TagSet", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSet(&sv.TagSet, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetObjectTorrent struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetObjectTorrent) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetObjectTorrent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetObjectTorrent(response, &metadata)
|
|
}
|
|
output := &GetObjectTorrentOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsGetObjectTorrentOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
err = awsRestxml_deserializeOpDocumentGetObjectTorrentOutput(output, response.Body)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetObjectTorrent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsGetObjectTorrentOutput(v *GetObjectTorrentOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentGetObjectTorrentOutput(v *GetObjectTorrentOutput, body io.ReadCloser) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization of nil %T", v)
|
|
}
|
|
v.Body = body
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpGetPublicAccessBlock struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpGetPublicAccessBlock) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpGetPublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorGetPublicAccessBlock(response, &metadata)
|
|
}
|
|
output := &GetPublicAccessBlockOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&output.PublicAccessBlockConfiguration, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorGetPublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentGetPublicAccessBlockOutput(v **GetPublicAccessBlockOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *GetPublicAccessBlockOutput
|
|
if *v == nil {
|
|
sv = &GetPublicAccessBlockOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("PublicAccessBlockConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(&sv.PublicAccessBlockConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpHeadBucket struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpHeadBucket) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpHeadBucket) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorHeadBucket(response, &metadata)
|
|
}
|
|
output := &HeadBucketOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsHeadBucketOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorHeadBucket(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NotFound", errorCode):
|
|
return awsRestxml_deserializeErrorNotFound(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsHeadBucketOutput(v *HeadBucketOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-access-point-alias"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.AccessPointAlias = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-bucket-location-name"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.BucketLocationName = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-bucket-location-type"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.BucketLocationType = types.LocationType(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-bucket-region"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.BucketRegion = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpHeadObject struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpHeadObject) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpHeadObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorHeadObject(response, &metadata)
|
|
}
|
|
output := &HeadObjectOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorHeadObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NotFound", errorCode):
|
|
return awsRestxml_deserializeErrorNotFound(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("accept-ranges"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.AcceptRanges = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-archive-status"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ArchiveStatus = types.ArchiveStatus(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Cache-Control"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.CacheControl = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32c"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32C = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha1"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA1 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha256"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA256 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Disposition"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentDisposition = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Encoding"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentEncoding = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Language"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentLanguage = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Length"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.ContentLength = ptr.Int64(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ContentType = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-delete-marker"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.DeleteMarker = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ETag = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-expiration"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Expiration = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Expires"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.Expires = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("Last-Modified"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
for headerKey, headerValues := range response.Header {
|
|
if lenPrefix := len("x-amz-meta-"); len(headerKey) >= lenPrefix && strings.EqualFold(headerKey[:lenPrefix], "x-amz-meta-") {
|
|
if v.Metadata == nil {
|
|
v.Metadata = map[string]string{}
|
|
}
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Metadata[strings.ToLower(headerKey[lenPrefix:])] = headerValues[0]
|
|
}
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-missing-meta"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.MissingMeta = ptr.Int32(int32(vv))
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-object-lock-legal-hold"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-object-lock-mode"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ObjectLockMode = types.ObjectLockMode(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-object-lock-retain-until-date"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseDateTime(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.ObjectLockRetainUntilDate = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-mp-parts-count"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.PartsCount = ptr.Int32(int32(vv))
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-replication-status"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ReplicationStatus = types.ReplicationStatus(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-restore"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Restore = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-storage-class"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.StorageClass = types.StorageClass(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-website-redirect-location"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.WebsiteRedirectLocation = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListBucketAnalyticsConfigurations struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListBucketAnalyticsConfigurations) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListBucketAnalyticsConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListBucketAnalyticsConfigurations(response, &metadata)
|
|
}
|
|
output := &ListBucketAnalyticsConfigurationsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListBucketAnalyticsConfigurationsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListBucketAnalyticsConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentListBucketAnalyticsConfigurationsOutput(v **ListBucketAnalyticsConfigurationsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListBucketAnalyticsConfigurationsOutput
|
|
if *v == nil {
|
|
sv = &ListBucketAnalyticsConfigurationsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AnalyticsConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAnalyticsConfigurationListUnwrapped(&sv.AnalyticsConfigurationList, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListBucketIntelligentTieringConfigurations struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListBucketIntelligentTieringConfigurations) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListBucketIntelligentTieringConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListBucketIntelligentTieringConfigurations(response, &metadata)
|
|
}
|
|
output := &ListBucketIntelligentTieringConfigurationsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListBucketIntelligentTieringConfigurationsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListBucketIntelligentTieringConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentListBucketIntelligentTieringConfigurationsOutput(v **ListBucketIntelligentTieringConfigurationsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListBucketIntelligentTieringConfigurationsOutput
|
|
if *v == nil {
|
|
sv = &ListBucketIntelligentTieringConfigurationsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IntelligentTieringConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentIntelligentTieringConfigurationListUnwrapped(&sv.IntelligentTieringConfigurationList, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListBucketInventoryConfigurations struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListBucketInventoryConfigurations) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListBucketInventoryConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListBucketInventoryConfigurations(response, &metadata)
|
|
}
|
|
output := &ListBucketInventoryConfigurationsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListBucketInventoryConfigurationsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListBucketInventoryConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentListBucketInventoryConfigurationsOutput(v **ListBucketInventoryConfigurationsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListBucketInventoryConfigurationsOutput
|
|
if *v == nil {
|
|
sv = &ListBucketInventoryConfigurationsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("InventoryConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryConfigurationListUnwrapped(&sv.InventoryConfigurationList, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListBucketMetricsConfigurations struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListBucketMetricsConfigurations) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListBucketMetricsConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListBucketMetricsConfigurations(response, &metadata)
|
|
}
|
|
output := &ListBucketMetricsConfigurationsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListBucketMetricsConfigurationsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListBucketMetricsConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentListBucketMetricsConfigurationsOutput(v **ListBucketMetricsConfigurationsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListBucketMetricsConfigurationsOutput
|
|
if *v == nil {
|
|
sv = &ListBucketMetricsConfigurationsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MetricsConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentMetricsConfigurationListUnwrapped(&sv.MetricsConfigurationList, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("NextContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListBuckets struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListBuckets) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListBuckets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListBuckets(response, &metadata)
|
|
}
|
|
output := &ListBucketsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListBucketsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListBuckets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentListBucketsOutput(v **ListBucketsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListBucketsOutput
|
|
if *v == nil {
|
|
sv = &ListBucketsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Buckets", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListDirectoryBuckets struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListDirectoryBuckets) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListDirectoryBuckets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListDirectoryBuckets(response, &metadata)
|
|
}
|
|
output := &ListDirectoryBucketsOutput{}
|
|
out.Result = output
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListDirectoryBucketsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListDirectoryBuckets(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpDocumentListDirectoryBucketsOutput(v **ListDirectoryBucketsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListDirectoryBucketsOutput
|
|
if *v == nil {
|
|
sv = &ListDirectoryBucketsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Buckets", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentBuckets(&sv.Buckets, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListMultipartUploads struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListMultipartUploads) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListMultipartUploads) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListMultipartUploads(response, &metadata)
|
|
}
|
|
output := &ListMultipartUploadsOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsListMultipartUploadsOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListMultipartUploadsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListMultipartUploads(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsListMultipartUploadsOutput(v *ListMultipartUploadsOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentListMultipartUploadsOutput(v **ListMultipartUploadsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListMultipartUploadsOutput
|
|
if *v == nil {
|
|
sv = &ListMultipartUploadsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("CommonPrefixes", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCommonPrefixListUnwrapped(&sv.CommonPrefixes, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Delimiter", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Delimiter = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("EncodingType", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.EncodingType = types.EncodingType(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("KeyMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.KeyMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MaxUploads", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxUploads = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("NextKeyMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextKeyMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextUploadIdMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextUploadIdMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("UploadIdMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.UploadIdMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Upload", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentMultipartUploadListUnwrapped(&sv.Uploads, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListObjects struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListObjects) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListObjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListObjects(response, &metadata)
|
|
}
|
|
output := &ListObjectsOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsListObjectsOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListObjectsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListObjects(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchBucket", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchBucket(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsListObjectsOutput(v *ListObjectsOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentListObjectsOutput(v **ListObjectsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListObjectsOutput
|
|
if *v == nil {
|
|
sv = &ListObjectsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CommonPrefixes", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCommonPrefixListUnwrapped(&sv.CommonPrefixes, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Contents", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectListUnwrapped(&sv.Contents, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Delimiter", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Delimiter = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("EncodingType", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.EncodingType = types.EncodingType(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Marker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Marker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MaxKeys", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxKeys = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("Name", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Name = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListObjectsV2 struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListObjectsV2) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListObjectsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListObjectsV2(response, &metadata)
|
|
}
|
|
output := &ListObjectsV2Output{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsListObjectsV2Output(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListObjectsV2Output(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListObjectsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchBucket", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchBucket(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsListObjectsV2Output(v *ListObjectsV2Output, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentListObjectsV2Output(v **ListObjectsV2Output, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListObjectsV2Output
|
|
if *v == nil {
|
|
sv = &ListObjectsV2Output{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CommonPrefixes", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCommonPrefixListUnwrapped(&sv.CommonPrefixes, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Contents", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectListUnwrapped(&sv.Contents, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Delimiter", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Delimiter = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("EncodingType", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.EncodingType = types.EncodingType(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("KeyCount", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.KeyCount = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("MaxKeys", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxKeys = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("Name", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Name = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextContinuationToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextContinuationToken = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("StartAfter", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StartAfter = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListObjectVersions struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListObjectVersions) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListObjectVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListObjectVersions(response, &metadata)
|
|
}
|
|
output := &ListObjectVersionsOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsListObjectVersionsOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListObjectVersionsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListObjectVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsListObjectVersionsOutput(v *ListObjectVersionsOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentListObjectVersionsOutput(v **ListObjectVersionsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListObjectVersionsOutput
|
|
if *v == nil {
|
|
sv = &ListObjectVersionsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CommonPrefixes", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCommonPrefixListUnwrapped(&sv.CommonPrefixes, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("DeleteMarker", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentDeleteMarkersUnwrapped(&sv.DeleteMarkers, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Delimiter", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Delimiter = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("EncodingType", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.EncodingType = types.EncodingType(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("KeyMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.KeyMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MaxKeys", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxKeys = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("Name", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Name = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextKeyMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextKeyMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NextVersionIdMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextVersionIdMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("VersionIdMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.VersionIdMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Version", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectVersionListUnwrapped(&sv.Versions, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpListParts struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpListParts) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpListParts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorListParts(response, &metadata)
|
|
}
|
|
output := &ListPartsOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsListPartsOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeOpDocumentListPartsOutput(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorListParts(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsListPartsOutput(v *ListPartsOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-abort-date"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
t, err := smithytime.ParseHTTPDate(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.AbortDate = ptr.Time(t)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-abort-rule-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.AbortRuleId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentListPartsOutput(v **ListPartsOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *ListPartsOutput
|
|
if *v == nil {
|
|
sv = &ListPartsOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumAlgorithm", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumAlgorithm = types.ChecksumAlgorithm(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Initiator", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInitiator(&sv.Initiator, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MaxParts", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxParts = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("NextPartNumberMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextPartNumberMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("PartNumberMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.PartNumberMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Part", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentPartsUnwrapped(&sv.Parts, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.StorageClass(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("UploadId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.UploadId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketAccelerateConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketAccelerateConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketAccelerateConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketAccelerateConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketAccelerateConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketAccelerateConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketAcl struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketAcl) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketAcl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketAcl(response, &metadata)
|
|
}
|
|
output := &PutBucketAclOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketAcl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketAnalyticsConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketAnalyticsConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketAnalyticsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketAnalyticsConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketAnalyticsConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketAnalyticsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketCors struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketCors) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketCors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketCors(response, &metadata)
|
|
}
|
|
output := &PutBucketCorsOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketCors(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketEncryption struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketEncryption) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketEncryption(response, &metadata)
|
|
}
|
|
output := &PutBucketEncryptionOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketIntelligentTieringConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketIntelligentTieringConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketIntelligentTieringConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketIntelligentTieringConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketIntelligentTieringConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketIntelligentTieringConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketInventoryConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketInventoryConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketInventoryConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketInventoryConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketInventoryConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketInventoryConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketLifecycleConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketLifecycleConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketLifecycleConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketLifecycleConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketLifecycleConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketLifecycleConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketLogging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketLogging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketLogging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketLogging(response, &metadata)
|
|
}
|
|
output := &PutBucketLoggingOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketLogging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketMetricsConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketMetricsConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketMetricsConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketMetricsConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketMetricsConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketMetricsConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketNotificationConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketNotificationConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketNotificationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketNotificationConfiguration(response, &metadata)
|
|
}
|
|
output := &PutBucketNotificationConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketNotificationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketOwnershipControls struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketOwnershipControls) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketOwnershipControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketOwnershipControls(response, &metadata)
|
|
}
|
|
output := &PutBucketOwnershipControlsOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketOwnershipControls(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketPolicy struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketPolicy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketPolicy(response, &metadata)
|
|
}
|
|
output := &PutBucketPolicyOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketReplication struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketReplication) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketReplication(response, &metadata)
|
|
}
|
|
output := &PutBucketReplicationOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketReplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketRequestPayment struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketRequestPayment) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketRequestPayment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketRequestPayment(response, &metadata)
|
|
}
|
|
output := &PutBucketRequestPaymentOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketRequestPayment(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketTagging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketTagging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketTagging(response, &metadata)
|
|
}
|
|
output := &PutBucketTaggingOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketVersioning struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketVersioning) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketVersioning) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketVersioning(response, &metadata)
|
|
}
|
|
output := &PutBucketVersioningOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketVersioning(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutBucketWebsite struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutBucketWebsite) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutBucketWebsite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutBucketWebsite(response, &metadata)
|
|
}
|
|
output := &PutBucketWebsiteOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutBucketWebsite(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutObject struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutObject) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutObject(response, &metadata)
|
|
}
|
|
output := &PutObjectOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsPutObjectOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsPutObjectOutput(v *PutObjectOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32c"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32C = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha1"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA1 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha256"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA256 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ETag = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-expiration"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.Expiration = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-context"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSEncryptionContext = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutObjectAcl struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutObjectAcl) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutObjectAcl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutObjectAcl(response, &metadata)
|
|
}
|
|
output := &PutObjectAclOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsPutObjectAclOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutObjectAcl(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("NoSuchKey", errorCode):
|
|
return awsRestxml_deserializeErrorNoSuchKey(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsPutObjectAclOutput(v *PutObjectAclOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutObjectLegalHold struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutObjectLegalHold) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutObjectLegalHold) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutObjectLegalHold(response, &metadata)
|
|
}
|
|
output := &PutObjectLegalHoldOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsPutObjectLegalHoldOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutObjectLegalHold(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsPutObjectLegalHoldOutput(v *PutObjectLegalHoldOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutObjectLockConfiguration struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutObjectLockConfiguration) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutObjectLockConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutObjectLockConfiguration(response, &metadata)
|
|
}
|
|
output := &PutObjectLockConfigurationOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsPutObjectLockConfigurationOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutObjectLockConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsPutObjectLockConfigurationOutput(v *PutObjectLockConfigurationOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutObjectRetention struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutObjectRetention) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutObjectRetention) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutObjectRetention(response, &metadata)
|
|
}
|
|
output := &PutObjectRetentionOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsPutObjectRetentionOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutObjectRetention(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsPutObjectRetentionOutput(v *PutObjectRetentionOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutObjectTagging struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutObjectTagging) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutObjectTagging) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutObjectTagging(response, &metadata)
|
|
}
|
|
output := &PutObjectTaggingOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsPutObjectTaggingOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutObjectTagging(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsPutObjectTaggingOutput(v *PutObjectTaggingOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.VersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpPutPublicAccessBlock struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpPutPublicAccessBlock) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpPutPublicAccessBlock) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorPutPublicAccessBlock(response, &metadata)
|
|
}
|
|
output := &PutPublicAccessBlockOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorPutPublicAccessBlock(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpRestoreObject struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpRestoreObject) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpRestoreObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorRestoreObject(response, &metadata)
|
|
}
|
|
output := &RestoreObjectOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsRestoreObjectOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorRestoreObject(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
case strings.EqualFold("ObjectAlreadyInActiveTierError", errorCode):
|
|
return awsRestxml_deserializeErrorObjectAlreadyInActiveTierError(response, errorBody)
|
|
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsRestoreObjectOutput(v *RestoreObjectOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-restore-output-path"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RestoreOutputPath = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpSelectObjectContent struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpSelectObjectContent) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpSelectObjectContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorSelectObjectContent(response, &metadata)
|
|
}
|
|
output := &SelectObjectContentOutput{}
|
|
out.Result = output
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorSelectObjectContent(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
type awsRestxml_deserializeOpUploadPart struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpUploadPart) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpUploadPart) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorUploadPart(response, &metadata)
|
|
}
|
|
output := &UploadPartOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsUploadPartOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorUploadPart(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsUploadPartOutput(v *UploadPartOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-crc32c"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumCRC32C = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha1"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA1 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-checksum-sha256"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ChecksumSHA256 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ETag = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpUploadPartCopy struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpUploadPartCopy) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpUploadPartCopy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorUploadPartCopy(response, &metadata)
|
|
}
|
|
output := &UploadPartCopyOutput{}
|
|
out.Result = output
|
|
|
|
err = awsRestxml_deserializeOpHttpBindingsUploadPartCopyOutput(output, response)
|
|
if err != nil {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)}
|
|
}
|
|
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(response.Body, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return out, metadata, nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentCopyPartResult(&output.CopyPartResult, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorUploadPartCopy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeOpHttpBindingsUploadPartCopyOutput(v *UploadPartCopyOutput, response *smithyhttp.Response) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unsupported deserialization for nil %T", v)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-bucket-key-enabled"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
vv, err := strconv.ParseBool(headerValues[0])
|
|
if err != nil {
|
|
return err
|
|
}
|
|
v.BucketKeyEnabled = ptr.Bool(vv)
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-copy-source-version-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.CopySourceVersionId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-request-charged"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.RequestCharged = types.RequestCharged(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerAlgorithm = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-key-MD5"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSECustomerKeyMD5 = ptr.String(headerValues[0])
|
|
}
|
|
|
|
if headerValues := response.Header.Values("x-amz-server-side-encryption-aws-kms-key-id"); len(headerValues) != 0 {
|
|
headerValues[0] = strings.TrimSpace(headerValues[0])
|
|
v.SSEKMSKeyId = ptr.String(headerValues[0])
|
|
}
|
|
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeOpDocumentUploadPartCopyOutput(v **UploadPartCopyOutput, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *UploadPartCopyOutput
|
|
if *v == nil {
|
|
sv = &UploadPartCopyOutput{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CopyPartResult", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCopyPartResult(&sv.CopyPartResult, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
type awsRestxml_deserializeOpWriteGetObjectResponse struct {
|
|
}
|
|
|
|
func (*awsRestxml_deserializeOpWriteGetObjectResponse) ID() string {
|
|
return "OperationDeserializer"
|
|
}
|
|
|
|
func (m *awsRestxml_deserializeOpWriteGetObjectResponse) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
|
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
|
) {
|
|
out, metadata, err = next.HandleDeserialize(ctx, in)
|
|
if err != nil {
|
|
return out, metadata, err
|
|
}
|
|
|
|
response, ok := out.RawResponse.(*smithyhttp.Response)
|
|
if !ok {
|
|
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
|
}
|
|
|
|
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
|
return out, metadata, awsRestxml_deserializeOpErrorWriteGetObjectResponse(response, &metadata)
|
|
}
|
|
output := &WriteGetObjectResponseOutput{}
|
|
out.Result = output
|
|
|
|
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
|
|
return out, metadata, &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to discard response body, %w", err),
|
|
}
|
|
}
|
|
|
|
return out, metadata, err
|
|
}
|
|
|
|
func awsRestxml_deserializeOpErrorWriteGetObjectResponse(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
|
var errorBuffer bytes.Buffer
|
|
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
|
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
|
}
|
|
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
|
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
|
|
errorComponents, err := s3shared.GetErrorResponseComponents(errorBody, s3shared.ErrorResponseDeserializerOptions{
|
|
UseStatusCode: true, StatusCode: response.StatusCode,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if hostID := errorComponents.HostID; len(hostID) != 0 {
|
|
s3shared.SetHostIDMetadata(metadata, hostID)
|
|
}
|
|
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
|
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
|
}
|
|
if len(errorComponents.Code) != 0 {
|
|
errorCode = errorComponents.Code
|
|
}
|
|
if len(errorComponents.Message) != 0 {
|
|
errorMessage = errorComponents.Message
|
|
}
|
|
errorBody.Seek(0, io.SeekStart)
|
|
switch {
|
|
default:
|
|
genericError := &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
return genericError
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeEventStreamSelectObjectContentEventStream(v *types.SelectObjectContentEventStream, msg *eventstream.Message) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected serialization of nil %T", v)
|
|
}
|
|
|
|
eventType := msg.Headers.Get(eventstreamapi.EventTypeHeader)
|
|
if eventType == nil {
|
|
return fmt.Errorf("%s event header not present", eventstreamapi.EventTypeHeader)
|
|
}
|
|
|
|
switch {
|
|
case strings.EqualFold("Cont", eventType.String()):
|
|
vv := &types.SelectObjectContentEventStreamMemberCont{}
|
|
if err := awsRestxml_deserializeEventMessageContinuationEvent(&vv.Value, msg); err != nil {
|
|
return err
|
|
}
|
|
*v = vv
|
|
return nil
|
|
|
|
case strings.EqualFold("End", eventType.String()):
|
|
vv := &types.SelectObjectContentEventStreamMemberEnd{}
|
|
if err := awsRestxml_deserializeEventMessageEndEvent(&vv.Value, msg); err != nil {
|
|
return err
|
|
}
|
|
*v = vv
|
|
return nil
|
|
|
|
case strings.EqualFold("Progress", eventType.String()):
|
|
vv := &types.SelectObjectContentEventStreamMemberProgress{}
|
|
if err := awsRestxml_deserializeEventMessageProgressEvent(&vv.Value, msg); err != nil {
|
|
return err
|
|
}
|
|
*v = vv
|
|
return nil
|
|
|
|
case strings.EqualFold("Records", eventType.String()):
|
|
vv := &types.SelectObjectContentEventStreamMemberRecords{}
|
|
if err := awsRestxml_deserializeEventMessageRecordsEvent(&vv.Value, msg); err != nil {
|
|
return err
|
|
}
|
|
*v = vv
|
|
return nil
|
|
|
|
case strings.EqualFold("Stats", eventType.String()):
|
|
vv := &types.SelectObjectContentEventStreamMemberStats{}
|
|
if err := awsRestxml_deserializeEventMessageStatsEvent(&vv.Value, msg); err != nil {
|
|
return err
|
|
}
|
|
*v = vv
|
|
return nil
|
|
|
|
default:
|
|
buffer := bytes.NewBuffer(nil)
|
|
eventstream.NewEncoder().Encode(buffer, *msg)
|
|
*v = &types.UnknownUnionMember{
|
|
Tag: eventType.String(),
|
|
Value: buffer.Bytes(),
|
|
}
|
|
return nil
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeEventStreamExceptionSelectObjectContentEventStream(msg *eventstream.Message) error {
|
|
exceptionType := msg.Headers.Get(eventstreamapi.ExceptionTypeHeader)
|
|
if exceptionType == nil {
|
|
return fmt.Errorf("%s event header not present", eventstreamapi.ExceptionTypeHeader)
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
br := bytes.NewReader(msg.Payload)
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
|
|
body := io.TeeReader(br, ringBuffer)
|
|
decoder := json.NewDecoder(body)
|
|
decoder.UseNumber()
|
|
errorComponents, err := awsxml.GetErrorResponseComponents(br, true)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
errorCode := "UnknownError"
|
|
errorMessage := errorCode
|
|
if ev := exceptionType.String(); len(ev) > 0 {
|
|
errorCode = ev
|
|
} else if ev := errorComponents.Code; len(ev) > 0 {
|
|
errorCode = ev
|
|
}
|
|
if ev := errorComponents.Message; len(ev) > 0 {
|
|
errorMessage = ev
|
|
}
|
|
return &smithy.GenericAPIError{
|
|
Code: errorCode,
|
|
Message: errorMessage,
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
func awsRestxml_deserializeEventMessageRecordsEvent(v *types.RecordsEvent, msg *eventstream.Message) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected serialization of nil %T", v)
|
|
}
|
|
|
|
if msg.Payload != nil {
|
|
bsv := make([]byte, len(msg.Payload))
|
|
copy(bsv, msg.Payload)
|
|
|
|
v.Payload = bsv
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeEventMessageStatsEvent(v *types.StatsEvent, msg *eventstream.Message) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected serialization of nil %T", v)
|
|
}
|
|
|
|
br := bytes.NewReader(msg.Payload)
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(br, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentStats(&v.Details, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeEventMessageProgressEvent(v *types.ProgressEvent, msg *eventstream.Message) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected serialization of nil %T", v)
|
|
}
|
|
|
|
br := bytes.NewReader(msg.Payload)
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(br, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentProgress(&v.Details, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeEventMessageContinuationEvent(v *types.ContinuationEvent, msg *eventstream.Message) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected serialization of nil %T", v)
|
|
}
|
|
|
|
br := bytes.NewReader(msg.Payload)
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(br, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentContinuationEvent(&v, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeEventMessageEndEvent(v *types.EndEvent, msg *eventstream.Message) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected serialization of nil %T", v)
|
|
}
|
|
|
|
br := bytes.NewReader(msg.Payload)
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(br, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return nil
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentEndEvent(&v, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentContinuationEvent(v **types.ContinuationEvent, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ContinuationEvent
|
|
if *v == nil {
|
|
sv = &types.ContinuationEvent{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentEndEvent(v **types.EndEvent, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.EndEvent
|
|
if *v == nil {
|
|
sv = &types.EndEvent{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentProgress(v **types.Progress, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Progress
|
|
if *v == nil {
|
|
sv = &types.Progress{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("BytesProcessed", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BytesProcessed = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("BytesReturned", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BytesReturned = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("BytesScanned", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BytesScanned = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentStats(v **types.Stats, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Stats
|
|
if *v == nil {
|
|
sv = &types.Stats{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("BytesProcessed", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BytesProcessed = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("BytesReturned", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BytesReturned = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("BytesScanned", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.BytesScanned = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorBucketAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.BucketAlreadyExists{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.BucketAlreadyOwnedByYou{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorInvalidObjectState(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.InvalidObjectState{}
|
|
var buff [1024]byte
|
|
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
|
body := io.TeeReader(errorBody, ringBuffer)
|
|
rootDecoder := xml.NewDecoder(body)
|
|
t, err := smithyxml.FetchRootElement(rootDecoder)
|
|
if err == io.EOF {
|
|
return output
|
|
}
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
|
err = awsRestxml_deserializeDocumentInvalidObjectState(&output, decoder)
|
|
if err != nil {
|
|
var snapshot bytes.Buffer
|
|
io.Copy(&snapshot, ringBuffer)
|
|
return &smithy.DeserializationError{
|
|
Err: fmt.Errorf("failed to decode response body, %w", err),
|
|
Snapshot: snapshot.Bytes(),
|
|
}
|
|
}
|
|
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorNoSuchBucket(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.NoSuchBucket{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorNoSuchKey(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.NoSuchKey{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorNoSuchUpload(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.NoSuchUpload{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.NotFound{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorObjectAlreadyInActiveTierError(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.ObjectAlreadyInActiveTierError{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeErrorObjectNotInActiveTierError(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
|
output := &types.ObjectNotInActiveTierError{}
|
|
return output
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.AbortIncompleteMultipartUpload, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.AbortIncompleteMultipartUpload
|
|
if *v == nil {
|
|
sv = &types.AbortIncompleteMultipartUpload{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DaysAfterInitiation", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.DaysAfterInitiation = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAccessControlTranslation(v **types.AccessControlTranslation, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.AccessControlTranslation
|
|
if *v == nil {
|
|
sv = &types.AccessControlTranslation{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Owner = types.OwnerOverride(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAllowedHeaders(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = xtv
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAllowedHeadersUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv string
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentAllowedMethods(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = xtv
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAllowedMethodsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv string
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentAllowedOrigins(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = xtv
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAllowedOriginsUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv string
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentAnalyticsAndOperator(v **types.AnalyticsAndOperator, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.AnalyticsAndOperator
|
|
if *v == nil {
|
|
sv = &types.AnalyticsAndOperator{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSetUnwrapped(&sv.Tags, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAnalyticsConfiguration(v **types.AnalyticsConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.AnalyticsConfiguration
|
|
if *v == nil {
|
|
sv = &types.AnalyticsConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAnalyticsFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("StorageClassAnalysis", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentStorageClassAnalysis(&sv.StorageClassAnalysis, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAnalyticsConfigurationList(v *[]types.AnalyticsConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.AnalyticsConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.AnalyticsConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.AnalyticsConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentAnalyticsConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAnalyticsConfigurationListUnwrapped(v *[]types.AnalyticsConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.AnalyticsConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.AnalyticsConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.AnalyticsConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentAnalyticsConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentAnalyticsExportDestination(v **types.AnalyticsExportDestination, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.AnalyticsExportDestination
|
|
if *v == nil {
|
|
sv = &types.AnalyticsExportDestination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("S3BucketDestination", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAnalyticsS3BucketDestination(&sv.S3BucketDestination, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAnalyticsFilter(v *types.AnalyticsFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var uv types.AnalyticsFilter
|
|
var memberFound bool
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
if memberFound {
|
|
if err = decoder.Decoder.Skip(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("And", t.Name.Local):
|
|
var mv types.AnalyticsAndOperator
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentAnalyticsAndOperator(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.AnalyticsFilterMemberAnd{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
var mv string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
uv = &types.AnalyticsFilterMemberPrefix{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
var mv types.Tag
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.AnalyticsFilterMemberTag{Value: mv}
|
|
memberFound = true
|
|
|
|
default:
|
|
uv = &types.UnknownUnionMember{Tag: t.Name.Local}
|
|
memberFound = true
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = uv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentAnalyticsS3BucketDestination(v **types.AnalyticsS3BucketDestination, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.AnalyticsS3BucketDestination
|
|
if *v == nil {
|
|
sv = &types.AnalyticsS3BucketDestination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("BucketAccountId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.BucketAccountId = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Format", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Format = types.AnalyticsS3ExportFileFormat(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentBucket(v **types.Bucket, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Bucket
|
|
if *v == nil {
|
|
sv = &types.Bucket{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("CreationDate", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.CreationDate = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Name", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Name = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentBucketAlreadyExists(v **types.BucketAlreadyExists, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.BucketAlreadyExists
|
|
if *v == nil {
|
|
sv = &types.BucketAlreadyExists{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentBucketAlreadyOwnedByYou(v **types.BucketAlreadyOwnedByYou, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.BucketAlreadyOwnedByYou
|
|
if *v == nil {
|
|
sv = &types.BucketAlreadyOwnedByYou{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentBuckets(v *[]types.Bucket, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Bucket
|
|
if *v == nil {
|
|
sv = make([]types.Bucket, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
var col types.Bucket
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentBucket(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentBucketsUnwrapped(v *[]types.Bucket, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Bucket
|
|
if *v == nil {
|
|
sv = make([]types.Bucket, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Bucket
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentBucket(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentChecksum(v **types.Checksum, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Checksum
|
|
if *v == nil {
|
|
sv = &types.Checksum{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumCRC32", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32C", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32C = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA1", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA1 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA256", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA256 = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentChecksumAlgorithmList(v *[]types.ChecksumAlgorithm, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.ChecksumAlgorithm
|
|
if *v == nil {
|
|
sv = make([]types.ChecksumAlgorithm, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.ChecksumAlgorithm
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = types.ChecksumAlgorithm(xtv)
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentChecksumAlgorithmListUnwrapped(v *[]types.ChecksumAlgorithm, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.ChecksumAlgorithm
|
|
if *v == nil {
|
|
sv = make([]types.ChecksumAlgorithm, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.ChecksumAlgorithm
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = types.ChecksumAlgorithm(xtv)
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentCommonPrefix(v **types.CommonPrefix, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.CommonPrefix
|
|
if *v == nil {
|
|
sv = &types.CommonPrefix{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCommonPrefixList(v *[]types.CommonPrefix, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.CommonPrefix
|
|
if *v == nil {
|
|
sv = make([]types.CommonPrefix, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.CommonPrefix
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentCommonPrefix(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCommonPrefixListUnwrapped(v *[]types.CommonPrefix, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.CommonPrefix
|
|
if *v == nil {
|
|
sv = make([]types.CommonPrefix, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.CommonPrefix
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentCommonPrefix(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentCondition(v **types.Condition, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Condition
|
|
if *v == nil {
|
|
sv = &types.Condition{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("HttpErrorCodeReturnedEquals", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.HttpErrorCodeReturnedEquals = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("KeyPrefixEquals", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.KeyPrefixEquals = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCopyObjectResult(v **types.CopyObjectResult, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.CopyObjectResult
|
|
if *v == nil {
|
|
sv = &types.CopyObjectResult{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumCRC32", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32C", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32C = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA1", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA1 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA256", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA256 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("LastModified", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCopyPartResult(v **types.CopyPartResult, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.CopyPartResult
|
|
if *v == nil {
|
|
sv = &types.CopyPartResult{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumCRC32", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32C", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32C = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA1", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA1 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA256", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA256 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("LastModified", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCORSRule(v **types.CORSRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.CORSRule
|
|
if *v == nil {
|
|
sv = &types.CORSRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AllowedHeader", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAllowedHeadersUnwrapped(&sv.AllowedHeaders, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("AllowedMethod", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAllowedMethodsUnwrapped(&sv.AllowedMethods, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("AllowedOrigin", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAllowedOriginsUnwrapped(&sv.AllowedOrigins, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ExposeHeader", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentExposeHeadersUnwrapped(&sv.ExposeHeaders, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ID = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MaxAgeSeconds", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxAgeSeconds = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCORSRules(v *[]types.CORSRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.CORSRule
|
|
if *v == nil {
|
|
sv = make([]types.CORSRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.CORSRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentCORSRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentCORSRulesUnwrapped(v *[]types.CORSRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.CORSRule
|
|
if *v == nil {
|
|
sv = make([]types.CORSRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.CORSRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentCORSRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentDefaultRetention(v **types.DefaultRetention, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.DefaultRetention
|
|
if *v == nil {
|
|
sv = &types.DefaultRetention{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Days", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Days = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("Mode", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Mode = types.ObjectLockRetentionMode(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Years", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Years = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentDeletedObject(v **types.DeletedObject, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.DeletedObject
|
|
if *v == nil {
|
|
sv = &types.DeletedObject{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DeleteMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected DeleteMarker to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.DeleteMarker = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("DeleteMarkerVersionId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.DeleteMarkerVersionId = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("VersionId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.VersionId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentDeletedObjects(v *[]types.DeletedObject, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.DeletedObject
|
|
if *v == nil {
|
|
sv = make([]types.DeletedObject, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.DeletedObject
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentDeletedObject(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentDeletedObjectsUnwrapped(v *[]types.DeletedObject, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.DeletedObject
|
|
if *v == nil {
|
|
sv = make([]types.DeletedObject, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.DeletedObject
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentDeletedObject(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentDeleteMarkerEntry(v **types.DeleteMarkerEntry, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.DeleteMarkerEntry
|
|
if *v == nil {
|
|
sv = &types.DeleteMarkerEntry{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("IsLatest", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsLatest to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsLatest = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("LastModified", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("VersionId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.VersionId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentDeleteMarkerReplication(v **types.DeleteMarkerReplication, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.DeleteMarkerReplication
|
|
if *v == nil {
|
|
sv = &types.DeleteMarkerReplication{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.DeleteMarkerReplicationStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentDeleteMarkers(v *[]types.DeleteMarkerEntry, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.DeleteMarkerEntry
|
|
if *v == nil {
|
|
sv = make([]types.DeleteMarkerEntry, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.DeleteMarkerEntry
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentDeleteMarkerEntry(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentDeleteMarkersUnwrapped(v *[]types.DeleteMarkerEntry, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.DeleteMarkerEntry
|
|
if *v == nil {
|
|
sv = make([]types.DeleteMarkerEntry, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.DeleteMarkerEntry
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentDeleteMarkerEntry(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentDestination(v **types.Destination, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Destination
|
|
if *v == nil {
|
|
sv = &types.Destination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessControlTranslation", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAccessControlTranslation(&sv.AccessControlTranslation, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Account", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Account = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("EncryptionConfiguration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Metrics", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentMetrics(&sv.Metrics, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ReplicationTime", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicationTime(&sv.ReplicationTime, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.StorageClass(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.EncryptionConfiguration
|
|
if *v == nil {
|
|
sv = &types.EncryptionConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ReplicaKmsKeyID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ReplicaKmsKeyID = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentError(v **types.Error, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Error
|
|
if *v == nil {
|
|
sv = &types.Error{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Code", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Code = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Message", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Message = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("VersionId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.VersionId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentErrorDocument(v **types.ErrorDocument, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ErrorDocument
|
|
if *v == nil {
|
|
sv = &types.ErrorDocument{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentErrors(v *[]types.Error, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Error
|
|
if *v == nil {
|
|
sv = make([]types.Error, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.Error
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentError(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentErrorsUnwrapped(v *[]types.Error, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Error
|
|
if *v == nil {
|
|
sv = make([]types.Error, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Error
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentError(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentEventBridgeConfiguration(v **types.EventBridgeConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.EventBridgeConfiguration
|
|
if *v == nil {
|
|
sv = &types.EventBridgeConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentEventList(v *[]types.Event, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Event
|
|
if *v == nil {
|
|
sv = make([]types.Event, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.Event
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = types.Event(xtv)
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentEventListUnwrapped(v *[]types.Event, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Event
|
|
if *v == nil {
|
|
sv = make([]types.Event, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Event
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = types.Event(xtv)
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentExistingObjectReplication(v **types.ExistingObjectReplication, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ExistingObjectReplication
|
|
if *v == nil {
|
|
sv = &types.ExistingObjectReplication{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.ExistingObjectReplicationStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentExposeHeaders(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = xtv
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentExposeHeadersUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error {
|
|
var sv []string
|
|
if *v == nil {
|
|
sv = make([]string, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv string
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentFilterRule(v **types.FilterRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.FilterRule
|
|
if *v == nil {
|
|
sv = &types.FilterRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Name", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Name = types.FilterRuleName(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Value", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Value = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentFilterRuleList(v *[]types.FilterRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.FilterRule
|
|
if *v == nil {
|
|
sv = make([]types.FilterRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.FilterRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentFilterRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentFilterRuleListUnwrapped(v *[]types.FilterRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.FilterRule
|
|
if *v == nil {
|
|
sv = make([]types.FilterRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.FilterRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentFilterRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentGetObjectAttributesParts(v **types.GetObjectAttributesParts, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.GetObjectAttributesParts
|
|
if *v == nil {
|
|
sv = &types.GetObjectAttributesParts{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("IsTruncated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsTruncated to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsTruncated = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("MaxParts", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.MaxParts = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("NextPartNumberMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.NextPartNumberMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("PartNumberMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.PartNumberMarker = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Part", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentPartsListUnwrapped(&sv.Parts, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("PartsCount", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.TotalPartsCount = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentGrant(v **types.Grant, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Grant
|
|
if *v == nil {
|
|
sv = &types.Grant{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Grantee", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentGrantee(&sv.Grantee, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Permission", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Permission = types.Permission(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentGrantee(v **types.Grantee, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Grantee
|
|
if *v == nil {
|
|
sv = &types.Grantee{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for _, attr := range decoder.StartEl.Attr {
|
|
name := attr.Name.Local
|
|
if len(attr.Name.Space) != 0 {
|
|
name = attr.Name.Space + `:` + attr.Name.Local
|
|
}
|
|
switch {
|
|
case strings.EqualFold("xsi:type", name):
|
|
val := []byte(attr.Value)
|
|
{
|
|
xtv := string(val)
|
|
sv.Type = types.Type(xtv)
|
|
}
|
|
|
|
}
|
|
}
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DisplayName", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.DisplayName = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("EmailAddress", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.EmailAddress = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ID = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("URI", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.URI = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentGrants(v *[]types.Grant, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Grant
|
|
if *v == nil {
|
|
sv = make([]types.Grant, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("Grant", t.Name.Local):
|
|
var col types.Grant
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentGrant(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentGrantsUnwrapped(v *[]types.Grant, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Grant
|
|
if *v == nil {
|
|
sv = make([]types.Grant, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Grant
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentGrant(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentIndexDocument(v **types.IndexDocument, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.IndexDocument
|
|
if *v == nil {
|
|
sv = &types.IndexDocument{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Suffix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Suffix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInitiator(v **types.Initiator, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Initiator
|
|
if *v == nil {
|
|
sv = &types.Initiator{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DisplayName", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.DisplayName = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ID = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentIntelligentTieringAndOperator(v **types.IntelligentTieringAndOperator, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.IntelligentTieringAndOperator
|
|
if *v == nil {
|
|
sv = &types.IntelligentTieringAndOperator{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSetUnwrapped(&sv.Tags, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentIntelligentTieringConfiguration(v **types.IntelligentTieringConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.IntelligentTieringConfiguration
|
|
if *v == nil {
|
|
sv = &types.IntelligentTieringConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentIntelligentTieringFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.IntelligentTieringStatus(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tiering", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTieringListUnwrapped(&sv.Tierings, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentIntelligentTieringConfigurationList(v *[]types.IntelligentTieringConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.IntelligentTieringConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.IntelligentTieringConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.IntelligentTieringConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentIntelligentTieringConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentIntelligentTieringConfigurationListUnwrapped(v *[]types.IntelligentTieringConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.IntelligentTieringConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.IntelligentTieringConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.IntelligentTieringConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentIntelligentTieringConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentIntelligentTieringFilter(v **types.IntelligentTieringFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.IntelligentTieringFilter
|
|
if *v == nil {
|
|
sv = &types.IntelligentTieringFilter{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("And", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentIntelligentTieringAndOperator(&sv.And, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTag(&sv.Tag, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInvalidObjectState(v **types.InvalidObjectState, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InvalidObjectState
|
|
if *v == nil {
|
|
sv = &types.InvalidObjectState{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessTier", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.AccessTier = types.IntelligentTieringAccessTier(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.StorageClass(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryConfiguration(v **types.InventoryConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InventoryConfiguration
|
|
if *v == nil {
|
|
sv = &types.InventoryConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Destination", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryDestination(&sv.Destination, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IncludedObjectVersions", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.IncludedObjectVersions = types.InventoryIncludedObjectVersions(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsEnabled", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsEnabled to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsEnabled = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("OptionalFields", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryOptionalFields(&sv.OptionalFields, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Schedule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventorySchedule(&sv.Schedule, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryConfigurationList(v *[]types.InventoryConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.InventoryConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.InventoryConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.InventoryConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentInventoryConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryConfigurationListUnwrapped(v *[]types.InventoryConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.InventoryConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.InventoryConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.InventoryConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentInventoryConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentInventoryDestination(v **types.InventoryDestination, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InventoryDestination
|
|
if *v == nil {
|
|
sv = &types.InventoryDestination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("S3BucketDestination", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryS3BucketDestination(&sv.S3BucketDestination, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryEncryption(v **types.InventoryEncryption, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InventoryEncryption
|
|
if *v == nil {
|
|
sv = &types.InventoryEncryption{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("SSE-KMS", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentSSEKMS(&sv.SSEKMS, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("SSE-S3", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentSSES3(&sv.SSES3, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryFilter(v **types.InventoryFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InventoryFilter
|
|
if *v == nil {
|
|
sv = &types.InventoryFilter{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryOptionalFields(v *[]types.InventoryOptionalField, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.InventoryOptionalField
|
|
if *v == nil {
|
|
sv = make([]types.InventoryOptionalField, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
decoder = memberDecoder
|
|
switch {
|
|
case strings.EqualFold("Field", t.Name.Local):
|
|
var col types.InventoryOptionalField
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
col = types.InventoryOptionalField(xtv)
|
|
}
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventoryOptionalFieldsUnwrapped(v *[]types.InventoryOptionalField, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.InventoryOptionalField
|
|
if *v == nil {
|
|
sv = make([]types.InventoryOptionalField, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.InventoryOptionalField
|
|
t := decoder.StartEl
|
|
_ = t
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = types.InventoryOptionalField(xtv)
|
|
}
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentInventoryS3BucketDestination(v **types.InventoryS3BucketDestination, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InventoryS3BucketDestination
|
|
if *v == nil {
|
|
sv = &types.InventoryS3BucketDestination{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccountId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.AccountId = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Bucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Bucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Encryption", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInventoryEncryption(&sv.Encryption, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Format", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Format = types.InventoryFormat(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentInventorySchedule(v **types.InventorySchedule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.InventorySchedule
|
|
if *v == nil {
|
|
sv = &types.InventorySchedule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Frequency", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Frequency = types.InventoryFrequency(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLambdaFunctionConfiguration(v **types.LambdaFunctionConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.LambdaFunctionConfiguration
|
|
if *v == nil {
|
|
sv = &types.LambdaFunctionConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Event", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentEventListUnwrapped(&sv.Events, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentNotificationConfigurationFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("CloudFunction", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.LambdaFunctionArn = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLambdaFunctionConfigurationList(v *[]types.LambdaFunctionConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.LambdaFunctionConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.LambdaFunctionConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.LambdaFunctionConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentLambdaFunctionConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLambdaFunctionConfigurationListUnwrapped(v *[]types.LambdaFunctionConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.LambdaFunctionConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.LambdaFunctionConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.LambdaFunctionConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentLambdaFunctionConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentLifecycleExpiration(v **types.LifecycleExpiration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.LifecycleExpiration
|
|
if *v == nil {
|
|
sv = &types.LifecycleExpiration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Date", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Date = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Days", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Days = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("ExpiredObjectDeleteMarker", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected ExpiredObjectDeleteMarker to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.ExpiredObjectDeleteMarker = ptr.Bool(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLifecycleRule(v **types.LifecycleRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.LifecycleRule
|
|
if *v == nil {
|
|
sv = &types.LifecycleRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AbortIncompleteMultipartUpload", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(&sv.AbortIncompleteMultipartUpload, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Expiration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentLifecycleExpiration(&sv.Expiration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentLifecycleRuleFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ID = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("NoncurrentVersionExpiration", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentNoncurrentVersionExpiration(&sv.NoncurrentVersionExpiration, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("NoncurrentVersionTransition", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentNoncurrentVersionTransitionListUnwrapped(&sv.NoncurrentVersionTransitions, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.ExpirationStatus(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Transition", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTransitionListUnwrapped(&sv.Transitions, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLifecycleRuleAndOperator(v **types.LifecycleRuleAndOperator, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.LifecycleRuleAndOperator
|
|
if *v == nil {
|
|
sv = &types.LifecycleRuleAndOperator{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ObjectSizeGreaterThan = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("ObjectSizeLessThan", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.ObjectSizeLessThan = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSetUnwrapped(&sv.Tags, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLifecycleRuleFilter(v *types.LifecycleRuleFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var uv types.LifecycleRuleFilter
|
|
var memberFound bool
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
if memberFound {
|
|
if err = decoder.Decoder.Skip(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("And", t.Name.Local):
|
|
var mv types.LifecycleRuleAndOperator
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentLifecycleRuleAndOperator(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.LifecycleRuleFilterMemberAnd{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("ObjectSizeGreaterThan", t.Name.Local):
|
|
var mv int64
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
mv = i64
|
|
}
|
|
uv = &types.LifecycleRuleFilterMemberObjectSizeGreaterThan{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("ObjectSizeLessThan", t.Name.Local):
|
|
var mv int64
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
mv = i64
|
|
}
|
|
uv = &types.LifecycleRuleFilterMemberObjectSizeLessThan{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
var mv string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
uv = &types.LifecycleRuleFilterMemberPrefix{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
var mv types.Tag
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.LifecycleRuleFilterMemberTag{Value: mv}
|
|
memberFound = true
|
|
|
|
default:
|
|
uv = &types.UnknownUnionMember{Tag: t.Name.Local}
|
|
memberFound = true
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = uv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLifecycleRules(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.LifecycleRule
|
|
if *v == nil {
|
|
sv = make([]types.LifecycleRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.LifecycleRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentLifecycleRulesUnwrapped(v *[]types.LifecycleRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.LifecycleRule
|
|
if *v == nil {
|
|
sv = make([]types.LifecycleRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.LifecycleRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentLifecycleRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentLoggingEnabled(v **types.LoggingEnabled, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.LoggingEnabled
|
|
if *v == nil {
|
|
sv = &types.LoggingEnabled{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("TargetBucket", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.TargetBucket = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("TargetGrants", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTargetGrants(&sv.TargetGrants, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("TargetObjectKeyFormat", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTargetObjectKeyFormat(&sv.TargetObjectKeyFormat, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("TargetPrefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.TargetPrefix = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMetrics(v **types.Metrics, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Metrics
|
|
if *v == nil {
|
|
sv = &types.Metrics{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("EventThreshold", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicationTimeValue(&sv.EventThreshold, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.MetricsStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMetricsAndOperator(v **types.MetricsAndOperator, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.MetricsAndOperator
|
|
if *v == nil {
|
|
sv = &types.MetricsAndOperator{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessPointArn", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.AccessPointArn = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSetUnwrapped(&sv.Tags, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMetricsConfiguration(v **types.MetricsConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.MetricsConfiguration
|
|
if *v == nil {
|
|
sv = &types.MetricsConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentMetricsFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMetricsConfigurationList(v *[]types.MetricsConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.MetricsConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.MetricsConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.MetricsConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentMetricsConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMetricsConfigurationListUnwrapped(v *[]types.MetricsConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.MetricsConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.MetricsConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.MetricsConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentMetricsConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentMetricsFilter(v *types.MetricsFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var uv types.MetricsFilter
|
|
var memberFound bool
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
if memberFound {
|
|
if err = decoder.Decoder.Skip(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessPointArn", t.Name.Local):
|
|
var mv string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
uv = &types.MetricsFilterMemberAccessPointArn{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("And", t.Name.Local):
|
|
var mv types.MetricsAndOperator
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentMetricsAndOperator(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.MetricsFilterMemberAnd{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
var mv string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
uv = &types.MetricsFilterMemberPrefix{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
var mv types.Tag
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.MetricsFilterMemberTag{Value: mv}
|
|
memberFound = true
|
|
|
|
default:
|
|
uv = &types.UnknownUnionMember{Tag: t.Name.Local}
|
|
memberFound = true
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = uv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMultipartUpload(v **types.MultipartUpload, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.MultipartUpload
|
|
if *v == nil {
|
|
sv = &types.MultipartUpload{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumAlgorithm", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumAlgorithm = types.ChecksumAlgorithm(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Initiated", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Initiated = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Initiator", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentInitiator(&sv.Initiator, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.StorageClass(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("UploadId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.UploadId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMultipartUploadList(v *[]types.MultipartUpload, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.MultipartUpload
|
|
if *v == nil {
|
|
sv = make([]types.MultipartUpload, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.MultipartUpload
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentMultipartUpload(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentMultipartUploadListUnwrapped(v *[]types.MultipartUpload, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.MultipartUpload
|
|
if *v == nil {
|
|
sv = make([]types.MultipartUpload, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.MultipartUpload
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentMultipartUpload(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentNoncurrentVersionExpiration(v **types.NoncurrentVersionExpiration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NoncurrentVersionExpiration
|
|
if *v == nil {
|
|
sv = &types.NoncurrentVersionExpiration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("NewerNoncurrentVersions", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.NewerNoncurrentVersions = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("NoncurrentDays", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.NoncurrentDays = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNoncurrentVersionTransition(v **types.NoncurrentVersionTransition, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NoncurrentVersionTransition
|
|
if *v == nil {
|
|
sv = &types.NoncurrentVersionTransition{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("NewerNoncurrentVersions", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.NewerNoncurrentVersions = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("NoncurrentDays", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.NoncurrentDays = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.TransitionStorageClass(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNoncurrentVersionTransitionList(v *[]types.NoncurrentVersionTransition, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.NoncurrentVersionTransition
|
|
if *v == nil {
|
|
sv = make([]types.NoncurrentVersionTransition, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.NoncurrentVersionTransition
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentNoncurrentVersionTransition(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNoncurrentVersionTransitionListUnwrapped(v *[]types.NoncurrentVersionTransition, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.NoncurrentVersionTransition
|
|
if *v == nil {
|
|
sv = make([]types.NoncurrentVersionTransition, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.NoncurrentVersionTransition
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentNoncurrentVersionTransition(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentNoSuchBucket(v **types.NoSuchBucket, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NoSuchBucket
|
|
if *v == nil {
|
|
sv = &types.NoSuchBucket{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNoSuchKey(v **types.NoSuchKey, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NoSuchKey
|
|
if *v == nil {
|
|
sv = &types.NoSuchKey{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNoSuchUpload(v **types.NoSuchUpload, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NoSuchUpload
|
|
if *v == nil {
|
|
sv = &types.NoSuchUpload{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNotFound(v **types.NotFound, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NotFound
|
|
if *v == nil {
|
|
sv = &types.NotFound{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentNotificationConfigurationFilter(v **types.NotificationConfigurationFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.NotificationConfigurationFilter
|
|
if *v == nil {
|
|
sv = &types.NotificationConfigurationFilter{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("S3Key", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentS3KeyFilter(&sv.Key, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObject(v **types.Object, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Object
|
|
if *v == nil {
|
|
sv = &types.Object{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumAlgorithm", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentChecksumAlgorithmListUnwrapped(&sv.ChecksumAlgorithm, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("LastModified", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("RestoreStatus", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentRestoreStatus(&sv.RestoreStatus, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Size", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Size = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.ObjectStorageClass(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectAlreadyInActiveTierError(v **types.ObjectAlreadyInActiveTierError, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectAlreadyInActiveTierError
|
|
if *v == nil {
|
|
sv = &types.ObjectAlreadyInActiveTierError{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectList(v *[]types.Object, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Object
|
|
if *v == nil {
|
|
sv = make([]types.Object, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.Object
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentObject(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectListUnwrapped(v *[]types.Object, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Object
|
|
if *v == nil {
|
|
sv = make([]types.Object, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Object
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentObject(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentObjectLockConfiguration(v **types.ObjectLockConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectLockConfiguration
|
|
if *v == nil {
|
|
sv = &types.ObjectLockConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ObjectLockEnabled", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ObjectLockEnabled = types.ObjectLockEnabled(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Rule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentObjectLockRule(&sv.Rule, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectLockLegalHold(v **types.ObjectLockLegalHold, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectLockLegalHold
|
|
if *v == nil {
|
|
sv = &types.ObjectLockLegalHold{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.ObjectLockLegalHoldStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectLockRetention(v **types.ObjectLockRetention, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectLockRetention
|
|
if *v == nil {
|
|
sv = &types.ObjectLockRetention{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Mode", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Mode = types.ObjectLockRetentionMode(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("RetainUntilDate", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.RetainUntilDate = ptr.Time(t)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectLockRule(v **types.ObjectLockRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectLockRule
|
|
if *v == nil {
|
|
sv = &types.ObjectLockRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DefaultRetention", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentDefaultRetention(&sv.DefaultRetention, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectNotInActiveTierError(v **types.ObjectNotInActiveTierError, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectNotInActiveTierError
|
|
if *v == nil {
|
|
sv = &types.ObjectNotInActiveTierError{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectPart(v **types.ObjectPart, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectPart
|
|
if *v == nil {
|
|
sv = &types.ObjectPart{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumCRC32", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32C", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32C = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA1", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA1 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA256", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA256 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("PartNumber", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.PartNumber = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("Size", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Size = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectVersion(v **types.ObjectVersion, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ObjectVersion
|
|
if *v == nil {
|
|
sv = &types.ObjectVersion{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumAlgorithm", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentChecksumAlgorithmListUnwrapped(&sv.ChecksumAlgorithm, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IsLatest", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsLatest to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsLatest = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("LastModified", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Owner", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwner(&sv.Owner, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("RestoreStatus", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentRestoreStatus(&sv.RestoreStatus, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Size", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Size = ptr.Int64(i64)
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.ObjectVersionStorageClass(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("VersionId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.VersionId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectVersionList(v *[]types.ObjectVersion, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.ObjectVersion
|
|
if *v == nil {
|
|
sv = make([]types.ObjectVersion, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.ObjectVersion
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentObjectVersion(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentObjectVersionListUnwrapped(v *[]types.ObjectVersion, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.ObjectVersion
|
|
if *v == nil {
|
|
sv = make([]types.ObjectVersion, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.ObjectVersion
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentObjectVersion(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentOwner(v **types.Owner, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Owner
|
|
if *v == nil {
|
|
sv = &types.Owner{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DisplayName", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.DisplayName = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ID = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentOwnershipControls(v **types.OwnershipControls, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.OwnershipControls
|
|
if *v == nil {
|
|
sv = &types.OwnershipControls{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Rule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentOwnershipControlsRulesUnwrapped(&sv.Rules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentOwnershipControlsRule(v **types.OwnershipControlsRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.OwnershipControlsRule
|
|
if *v == nil {
|
|
sv = &types.OwnershipControlsRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ObjectOwnership", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ObjectOwnership = types.ObjectOwnership(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentOwnershipControlsRules(v *[]types.OwnershipControlsRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.OwnershipControlsRule
|
|
if *v == nil {
|
|
sv = make([]types.OwnershipControlsRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.OwnershipControlsRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentOwnershipControlsRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentOwnershipControlsRulesUnwrapped(v *[]types.OwnershipControlsRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.OwnershipControlsRule
|
|
if *v == nil {
|
|
sv = make([]types.OwnershipControlsRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.OwnershipControlsRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentOwnershipControlsRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentPart(v **types.Part, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Part
|
|
if *v == nil {
|
|
sv = &types.Part{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ChecksumCRC32", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumCRC32C", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumCRC32C = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA1", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA1 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ChecksumSHA256", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ChecksumSHA256 = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ETag", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ETag = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("LastModified", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.LastModified = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("PartNumber", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.PartNumber = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("Size", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Size = ptr.Int64(i64)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentPartitionedPrefix(v **types.PartitionedPrefix, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.PartitionedPrefix
|
|
if *v == nil {
|
|
sv = &types.PartitionedPrefix{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("PartitionDateSource", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.PartitionDateSource = types.PartitionDateSource(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentParts(v *[]types.Part, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Part
|
|
if *v == nil {
|
|
sv = make([]types.Part, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.Part
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentPart(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentPartsUnwrapped(v *[]types.Part, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Part
|
|
if *v == nil {
|
|
sv = make([]types.Part, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Part
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentPart(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentPartsList(v *[]types.ObjectPart, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.ObjectPart
|
|
if *v == nil {
|
|
sv = make([]types.ObjectPart, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.ObjectPart
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentObjectPart(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentPartsListUnwrapped(v *[]types.ObjectPart, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.ObjectPart
|
|
if *v == nil {
|
|
sv = make([]types.ObjectPart, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.ObjectPart
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentObjectPart(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentPolicyStatus(v **types.PolicyStatus, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.PolicyStatus
|
|
if *v == nil {
|
|
sv = &types.PolicyStatus{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("IsPublic", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsPublic to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsPublic = ptr.Bool(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentPublicAccessBlockConfiguration(v **types.PublicAccessBlockConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.PublicAccessBlockConfiguration
|
|
if *v == nil {
|
|
sv = &types.PublicAccessBlockConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("BlockPublicAcls", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.BlockPublicAcls = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("BlockPublicPolicy", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.BlockPublicPolicy = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("IgnorePublicAcls", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IgnorePublicAcls = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("RestrictPublicBuckets", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected Setting to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.RestrictPublicBuckets = ptr.Bool(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentQueueConfiguration(v **types.QueueConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.QueueConfiguration
|
|
if *v == nil {
|
|
sv = &types.QueueConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Event", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentEventListUnwrapped(&sv.Events, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentNotificationConfigurationFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Queue", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.QueueArn = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentQueueConfigurationList(v *[]types.QueueConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.QueueConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.QueueConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.QueueConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentQueueConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentQueueConfigurationListUnwrapped(v *[]types.QueueConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.QueueConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.QueueConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.QueueConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentQueueConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentRedirect(v **types.Redirect, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Redirect
|
|
if *v == nil {
|
|
sv = &types.Redirect{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("HostName", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.HostName = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("HttpRedirectCode", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.HttpRedirectCode = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Protocol", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Protocol = types.Protocol(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ReplaceKeyPrefixWith", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ReplaceKeyPrefixWith = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("ReplaceKeyWith", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ReplaceKeyWith = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentRedirectAllRequestsTo(v **types.RedirectAllRequestsTo, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.RedirectAllRequestsTo
|
|
if *v == nil {
|
|
sv = &types.RedirectAllRequestsTo{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("HostName", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.HostName = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Protocol", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Protocol = types.Protocol(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicaModifications(v **types.ReplicaModifications, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ReplicaModifications
|
|
if *v == nil {
|
|
sv = &types.ReplicaModifications{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.ReplicaModificationsStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationConfiguration(v **types.ReplicationConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ReplicationConfiguration
|
|
if *v == nil {
|
|
sv = &types.ReplicationConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Role", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Role = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Rule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicationRulesUnwrapped(&sv.Rules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationRule(v **types.ReplicationRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ReplicationRule
|
|
if *v == nil {
|
|
sv = &types.ReplicationRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DeleteMarkerReplication", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentDeleteMarkerReplication(&sv.DeleteMarkerReplication, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Destination", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentDestination(&sv.Destination, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ExistingObjectReplication", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentExistingObjectReplication(&sv.ExistingObjectReplication, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicationRuleFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("ID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.ID = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Priority", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Priority = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("SourceSelectionCriteria", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentSourceSelectionCriteria(&sv.SourceSelectionCriteria, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.ReplicationRuleStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationRuleAndOperator(v **types.ReplicationRuleAndOperator, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ReplicationRuleAndOperator
|
|
if *v == nil {
|
|
sv = &types.ReplicationRuleAndOperator{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Prefix = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentTagSetUnwrapped(&sv.Tags, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationRuleFilter(v *types.ReplicationRuleFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var uv types.ReplicationRuleFilter
|
|
var memberFound bool
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
if memberFound {
|
|
if err = decoder.Decoder.Skip(); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("And", t.Name.Local):
|
|
var mv types.ReplicationRuleAndOperator
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentReplicationRuleAndOperator(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.ReplicationRuleFilterMemberAnd{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Prefix", t.Name.Local):
|
|
var mv string
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
mv = xtv
|
|
}
|
|
uv = &types.ReplicationRuleFilterMemberPrefix{Value: mv}
|
|
memberFound = true
|
|
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
var mv types.Tag
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
uv = &types.ReplicationRuleFilterMemberTag{Value: mv}
|
|
memberFound = true
|
|
|
|
default:
|
|
uv = &types.UnknownUnionMember{Tag: t.Name.Local}
|
|
memberFound = true
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = uv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationRules(v *[]types.ReplicationRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.ReplicationRule
|
|
if *v == nil {
|
|
sv = make([]types.ReplicationRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.ReplicationRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentReplicationRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationRulesUnwrapped(v *[]types.ReplicationRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.ReplicationRule
|
|
if *v == nil {
|
|
sv = make([]types.ReplicationRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.ReplicationRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentReplicationRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentReplicationTime(v **types.ReplicationTime, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ReplicationTime
|
|
if *v == nil {
|
|
sv = &types.ReplicationTime{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.ReplicationTimeStatus(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Time", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicationTimeValue(&sv.Time, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentReplicationTimeValue(v **types.ReplicationTimeValue, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ReplicationTimeValue
|
|
if *v == nil {
|
|
sv = &types.ReplicationTimeValue{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Minutes", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Minutes = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentRestoreStatus(v **types.RestoreStatus, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.RestoreStatus
|
|
if *v == nil {
|
|
sv = &types.RestoreStatus{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("IsRestoreInProgress", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected IsRestoreInProgress to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.IsRestoreInProgress = ptr.Bool(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("RestoreExpiryDate", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.RestoreExpiryDate = ptr.Time(t)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentRoutingRule(v **types.RoutingRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.RoutingRule
|
|
if *v == nil {
|
|
sv = &types.RoutingRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Condition", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentCondition(&sv.Condition, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Redirect", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentRedirect(&sv.Redirect, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentRoutingRules(v *[]types.RoutingRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.RoutingRule
|
|
if *v == nil {
|
|
sv = make([]types.RoutingRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("RoutingRule", t.Name.Local):
|
|
var col types.RoutingRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentRoutingRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentRoutingRulesUnwrapped(v *[]types.RoutingRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.RoutingRule
|
|
if *v == nil {
|
|
sv = make([]types.RoutingRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.RoutingRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentRoutingRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentS3KeyFilter(v **types.S3KeyFilter, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.S3KeyFilter
|
|
if *v == nil {
|
|
sv = &types.S3KeyFilter{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("FilterRule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentFilterRuleListUnwrapped(&sv.FilterRules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentServerSideEncryptionByDefault(v **types.ServerSideEncryptionByDefault, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ServerSideEncryptionByDefault
|
|
if *v == nil {
|
|
sv = &types.ServerSideEncryptionByDefault{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("KMSMasterKeyID", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.KMSMasterKeyID = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("SSEAlgorithm", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.SSEAlgorithm = types.ServerSideEncryption(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentServerSideEncryptionConfiguration(v **types.ServerSideEncryptionConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ServerSideEncryptionConfiguration
|
|
if *v == nil {
|
|
sv = &types.ServerSideEncryptionConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Rule", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentServerSideEncryptionRulesUnwrapped(&sv.Rules, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentServerSideEncryptionRule(v **types.ServerSideEncryptionRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.ServerSideEncryptionRule
|
|
if *v == nil {
|
|
sv = &types.ServerSideEncryptionRule{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ApplyServerSideEncryptionByDefault", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentServerSideEncryptionByDefault(&sv.ApplyServerSideEncryptionByDefault, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("BucketKeyEnabled", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv, err := strconv.ParseBool(string(val))
|
|
if err != nil {
|
|
return fmt.Errorf("expected BucketKeyEnabled to be of type *bool, got %T instead", val)
|
|
}
|
|
sv.BucketKeyEnabled = ptr.Bool(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentServerSideEncryptionRules(v *[]types.ServerSideEncryptionRule, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.ServerSideEncryptionRule
|
|
if *v == nil {
|
|
sv = make([]types.ServerSideEncryptionRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.ServerSideEncryptionRule
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentServerSideEncryptionRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentServerSideEncryptionRulesUnwrapped(v *[]types.ServerSideEncryptionRule, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.ServerSideEncryptionRule
|
|
if *v == nil {
|
|
sv = make([]types.ServerSideEncryptionRule, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.ServerSideEncryptionRule
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentServerSideEncryptionRule(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentSessionCredentials(v **types.SessionCredentials, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.SessionCredentials
|
|
if *v == nil {
|
|
sv = &types.SessionCredentials{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessKeyId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.AccessKeyId = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Expiration", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Expiration = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("SecretAccessKey", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.SecretAccessKey = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("SessionToken", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.SessionToken = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentSimplePrefix(v **types.SimplePrefix, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.SimplePrefix
|
|
if *v == nil {
|
|
sv = &types.SimplePrefix{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentSourceSelectionCriteria(v **types.SourceSelectionCriteria, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.SourceSelectionCriteria
|
|
if *v == nil {
|
|
sv = &types.SourceSelectionCriteria{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("ReplicaModifications", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentReplicaModifications(&sv.ReplicaModifications, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("SseKmsEncryptedObjects", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentSseKmsEncryptedObjects(&sv.SseKmsEncryptedObjects, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentSSEKMS(v **types.SSEKMS, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.SSEKMS
|
|
if *v == nil {
|
|
sv = &types.SSEKMS{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("KeyId", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.KeyId = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentSseKmsEncryptedObjects(v **types.SseKmsEncryptedObjects, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.SseKmsEncryptedObjects
|
|
if *v == nil {
|
|
sv = &types.SseKmsEncryptedObjects{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Status", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Status = types.SseKmsEncryptedObjectsStatus(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentSSES3(v **types.SSES3, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.SSES3
|
|
if *v == nil {
|
|
sv = &types.SSES3{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentStorageClassAnalysis(v **types.StorageClassAnalysis, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.StorageClassAnalysis
|
|
if *v == nil {
|
|
sv = &types.StorageClassAnalysis{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("DataExport", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentStorageClassAnalysisDataExport(&sv.DataExport, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentStorageClassAnalysisDataExport(v **types.StorageClassAnalysisDataExport, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.StorageClassAnalysisDataExport
|
|
if *v == nil {
|
|
sv = &types.StorageClassAnalysisDataExport{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Destination", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentAnalyticsExportDestination(&sv.Destination, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("OutputSchemaVersion", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.OutputSchemaVersion = types.StorageClassAnalysisSchemaVersion(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTag(v **types.Tag, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Tag
|
|
if *v == nil {
|
|
sv = &types.Tag{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Key", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Key = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Value", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Value = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTagSet(v *[]types.Tag, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Tag
|
|
if *v == nil {
|
|
sv = make([]types.Tag, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("Tag", t.Name.Local):
|
|
var col types.Tag
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTagSetUnwrapped(v *[]types.Tag, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Tag
|
|
if *v == nil {
|
|
sv = make([]types.Tag, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Tag
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTag(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentTargetGrant(v **types.TargetGrant, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.TargetGrant
|
|
if *v == nil {
|
|
sv = &types.TargetGrant{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Grantee", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentGrantee(&sv.Grantee, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Permission", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Permission = types.BucketLogsPermission(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTargetGrants(v *[]types.TargetGrant, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.TargetGrant
|
|
if *v == nil {
|
|
sv = make([]types.TargetGrant, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("Grant", t.Name.Local):
|
|
var col types.TargetGrant
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentTargetGrant(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTargetGrantsUnwrapped(v *[]types.TargetGrant, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.TargetGrant
|
|
if *v == nil {
|
|
sv = make([]types.TargetGrant, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.TargetGrant
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTargetGrant(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentTargetObjectKeyFormat(v **types.TargetObjectKeyFormat, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.TargetObjectKeyFormat
|
|
if *v == nil {
|
|
sv = &types.TargetObjectKeyFormat{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("PartitionedPrefix", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentPartitionedPrefix(&sv.PartitionedPrefix, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("SimplePrefix", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentSimplePrefix(&sv.SimplePrefix, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTiering(v **types.Tiering, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Tiering
|
|
if *v == nil {
|
|
sv = &types.Tiering{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("AccessTier", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.AccessTier = types.IntelligentTieringAccessTier(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Days", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Days = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTieringList(v *[]types.Tiering, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Tiering
|
|
if *v == nil {
|
|
sv = make([]types.Tiering, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.Tiering
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentTiering(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTieringListUnwrapped(v *[]types.Tiering, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Tiering
|
|
if *v == nil {
|
|
sv = make([]types.Tiering, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Tiering
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTiering(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentTopicConfiguration(v **types.TopicConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.TopicConfiguration
|
|
if *v == nil {
|
|
sv = &types.TopicConfiguration{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Event", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentEventListUnwrapped(&sv.Events, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Filter", t.Name.Local):
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
if err := awsRestxml_deserializeDocumentNotificationConfigurationFilter(&sv.Filter, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
|
|
case strings.EqualFold("Id", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.Id = ptr.String(xtv)
|
|
}
|
|
|
|
case strings.EqualFold("Topic", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.TopicArn = ptr.String(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTopicConfigurationList(v *[]types.TopicConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.TopicConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.TopicConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.TopicConfiguration
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentTopicConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTopicConfigurationListUnwrapped(v *[]types.TopicConfiguration, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.TopicConfiguration
|
|
if *v == nil {
|
|
sv = make([]types.TopicConfiguration, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.TopicConfiguration
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTopicConfiguration(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
func awsRestxml_deserializeDocumentTransition(v **types.Transition, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv *types.Transition
|
|
if *v == nil {
|
|
sv = &types.Transition{}
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
originalDecoder := decoder
|
|
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
|
switch {
|
|
case strings.EqualFold("Date", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
t, err := smithytime.ParseDateTime(xtv)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Date = ptr.Time(t)
|
|
}
|
|
|
|
case strings.EqualFold("Days", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
i64, err := strconv.ParseInt(xtv, 10, 64)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sv.Days = ptr.Int32(int32(i64))
|
|
}
|
|
|
|
case strings.EqualFold("StorageClass", t.Name.Local):
|
|
val, err := decoder.Value()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if val == nil {
|
|
break
|
|
}
|
|
{
|
|
xtv := string(val)
|
|
sv.StorageClass = types.TransitionStorageClass(xtv)
|
|
}
|
|
|
|
default:
|
|
// Do nothing and ignore the unexpected tag element
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTransitionList(v *[]types.Transition, decoder smithyxml.NodeDecoder) error {
|
|
if v == nil {
|
|
return fmt.Errorf("unexpected nil of type %T", v)
|
|
}
|
|
var sv []types.Transition
|
|
if *v == nil {
|
|
sv = make([]types.Transition, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
originalDecoder := decoder
|
|
for {
|
|
t, done, err := decoder.Token()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if done {
|
|
break
|
|
}
|
|
switch {
|
|
case strings.EqualFold("member", t.Name.Local):
|
|
var col types.Transition
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &col
|
|
if err := awsRestxml_deserializeDocumentTransition(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
col = *destAddr
|
|
sv = append(sv, col)
|
|
|
|
default:
|
|
err = decoder.Decoder.Skip()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
}
|
|
decoder = originalDecoder
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|
|
|
|
func awsRestxml_deserializeDocumentTransitionListUnwrapped(v *[]types.Transition, decoder smithyxml.NodeDecoder) error {
|
|
var sv []types.Transition
|
|
if *v == nil {
|
|
sv = make([]types.Transition, 0)
|
|
} else {
|
|
sv = *v
|
|
}
|
|
|
|
switch {
|
|
default:
|
|
var mv types.Transition
|
|
t := decoder.StartEl
|
|
_ = t
|
|
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
|
destAddr := &mv
|
|
if err := awsRestxml_deserializeDocumentTransition(&destAddr, nodeDecoder); err != nil {
|
|
return err
|
|
}
|
|
mv = *destAddr
|
|
sv = append(sv, mv)
|
|
}
|
|
*v = sv
|
|
return nil
|
|
}
|