func awsAwsjson11_deserializeDocumentS3Settings()

in service/databasemigrationservice/deserializers.go [13960:14359]


func awsAwsjson11_deserializeDocumentS3Settings(v **types.S3Settings, value interface{}) error {
	if v == nil {
		return fmt.Errorf("unexpected nil of type %T", v)
	}
	if value == nil {
		return nil
	}

	shape, ok := value.(map[string]interface{})
	if !ok {
		return fmt.Errorf("unexpected JSON type %v", value)
	}

	var sv *types.S3Settings
	if *v == nil {
		sv = &types.S3Settings{}
	} else {
		sv = *v
	}

	for key, value := range shape {
		switch key {
		case "AddColumnName":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.AddColumnName = ptr.Bool(jtv)
			}

		case "BucketFolder":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.BucketFolder = ptr.String(jtv)
			}

		case "BucketName":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.BucketName = ptr.String(jtv)
			}

		case "CannedAclForObjects":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected CannedAclForObjectsValue to be of type string, got %T instead", value)
				}
				sv.CannedAclForObjects = types.CannedAclForObjectsValue(jtv)
			}

		case "CdcInsertsAndUpdates":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.CdcInsertsAndUpdates = ptr.Bool(jtv)
			}

		case "CdcInsertsOnly":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.CdcInsertsOnly = ptr.Bool(jtv)
			}

		case "CdcMaxBatchInterval":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.CdcMaxBatchInterval = ptr.Int32(int32(i64))
			}

		case "CdcMinFileSize":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.CdcMinFileSize = ptr.Int32(int32(i64))
			}

		case "CdcPath":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.CdcPath = ptr.String(jtv)
			}

		case "CompressionType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected CompressionTypeValue to be of type string, got %T instead", value)
				}
				sv.CompressionType = types.CompressionTypeValue(jtv)
			}

		case "CsvDelimiter":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.CsvDelimiter = ptr.String(jtv)
			}

		case "CsvNoSupValue":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.CsvNoSupValue = ptr.String(jtv)
			}

		case "CsvNullValue":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.CsvNullValue = ptr.String(jtv)
			}

		case "CsvRowDelimiter":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.CsvRowDelimiter = ptr.String(jtv)
			}

		case "DataFormat":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DataFormatValue to be of type string, got %T instead", value)
				}
				sv.DataFormat = types.DataFormatValue(jtv)
			}

		case "DataPageSize":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.DataPageSize = ptr.Int32(int32(i64))
			}

		case "DatePartitionDelimiter":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DatePartitionDelimiterValue to be of type string, got %T instead", value)
				}
				sv.DatePartitionDelimiter = types.DatePartitionDelimiterValue(jtv)
			}

		case "DatePartitionEnabled":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.DatePartitionEnabled = ptr.Bool(jtv)
			}

		case "DatePartitionSequence":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected DatePartitionSequenceValue to be of type string, got %T instead", value)
				}
				sv.DatePartitionSequence = types.DatePartitionSequenceValue(jtv)
			}

		case "DatePartitionTimezone":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.DatePartitionTimezone = ptr.String(jtv)
			}

		case "DictPageSizeLimit":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.DictPageSizeLimit = ptr.Int32(int32(i64))
			}

		case "EnableStatistics":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.EnableStatistics = ptr.Bool(jtv)
			}

		case "EncodingType":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected EncodingTypeValue to be of type string, got %T instead", value)
				}
				sv.EncodingType = types.EncodingTypeValue(jtv)
			}

		case "EncryptionMode":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected EncryptionModeValue to be of type string, got %T instead", value)
				}
				sv.EncryptionMode = types.EncryptionModeValue(jtv)
			}

		case "ExternalTableDefinition":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.ExternalTableDefinition = ptr.String(jtv)
			}

		case "IgnoreHeaderRows":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.IgnoreHeaderRows = ptr.Int32(int32(i64))
			}

		case "IncludeOpForFullLoad":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.IncludeOpForFullLoad = ptr.Bool(jtv)
			}

		case "MaxFileSize":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.MaxFileSize = ptr.Int32(int32(i64))
			}

		case "ParquetTimestampInMillisecond":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.ParquetTimestampInMillisecond = ptr.Bool(jtv)
			}

		case "ParquetVersion":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected ParquetVersionValue to be of type string, got %T instead", value)
				}
				sv.ParquetVersion = types.ParquetVersionValue(jtv)
			}

		case "PreserveTransactions":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.PreserveTransactions = ptr.Bool(jtv)
			}

		case "Rfc4180":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.Rfc4180 = ptr.Bool(jtv)
			}

		case "RowGroupLength":
			if value != nil {
				jtv, ok := value.(json.Number)
				if !ok {
					return fmt.Errorf("expected IntegerOptional to be json.Number, got %T instead", value)
				}
				i64, err := jtv.Int64()
				if err != nil {
					return err
				}
				sv.RowGroupLength = ptr.Int32(int32(i64))
			}

		case "ServerSideEncryptionKmsKeyId":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.ServerSideEncryptionKmsKeyId = ptr.String(jtv)
			}

		case "ServiceAccessRoleArn":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.ServiceAccessRoleArn = ptr.String(jtv)
			}

		case "TimestampColumnName":
			if value != nil {
				jtv, ok := value.(string)
				if !ok {
					return fmt.Errorf("expected String to be of type string, got %T instead", value)
				}
				sv.TimestampColumnName = ptr.String(jtv)
			}

		case "UseCsvNoSupValue":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.UseCsvNoSupValue = ptr.Bool(jtv)
			}

		case "UseTaskStartTimeForFullLoadTimestamp":
			if value != nil {
				jtv, ok := value.(bool)
				if !ok {
					return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", value)
				}
				sv.UseTaskStartTimeForFullLoadTimestamp = ptr.Bool(jtv)
			}

		default:
			_, _ = key, value

		}
	}
	*v = sv
	return nil
}