class Aws::DynamoDB::Plugins::SimpleAttributes


}

“age”=> <struct s=nil, n=“35”, b=nil, ss=nil, ns=nil, bs=nil, m=nil, l=nil, null=nil, bool=nil>
“id”=> <struct s=‘uuid’, n=nil, b=nil, ss=nil, ns=nil, bs=nil, m=nil, l=nil, null=nil, bool=nil>
{
resp.item
resp = dynamodb.get(table_name: ‘aws-sdk’, key: { ‘id’ => { s: ‘uuid’ }})
# note that the request ‘:key` had to be type prefixed
With this plugin disabled, `simple_attributes: false`:
}
}
last: ’Doe’,
first: ‘John’,
name: {
scores: [5, 4.5, 4.9, nil],
data: StringIO.new(‘data’),
tags: Set.new(%w(simple attributes)),
age: 35,
id: ‘uuid’,
{
resp.item
resp = dynamodb.get(table_name: ‘aws-sdk’, key: { id: ‘uuid’ })
With this plugin enabled, ‘simple_attributes: true`:
## Output Examples
)
}
}
}
’last’ => { s: ‘Doe’ },
‘first’ => { s: ‘John’ },
m: {
‘name’ => {
},
]
{ null: true },
{ n: ‘4.9’ },
{ n: ‘4.5’ },
{ n: ‘5’ },
l: [
‘scores’ => {
‘data’ => { b: ‘data’ },
‘tags’ => { ss: [‘simple’, ‘attributes’] },
‘age’ => { n: ‘35’ },
‘id’ => { s: ‘uuid’ },
item: {
table_name: ‘aws-sdk’,
dynamodb.put_item(
# numeric types must be serialized as strings
# note that all types are prefixed in a hash and that
With this plugin disabled, ‘simple_attributes: false`:
)
}
}
last: ’Doe’,
first: ‘John’,
name: {
scores: [5, 4.5, 4.9, nil],
data: StringIO.new(‘data’),
tags: Set.new(%w(simple attributes)),
age: 35,
id: ‘uuid’,
item: {
table_name: ‘aws-sdk’,
dynamodb.put_item(
With this plugin enabled, ‘simple_attributes: true`:
## Input Examples
* `:bs` => `Set<StringIO>`
* `:ns` => `Set<BigDecimal>`
* `:ss` => `Set<String>`
* `:bool` => `true` or `false`
* `:null` => `nil`
* `:b` => `StringIO`
* `:n` => `BigDecimal`
* `:s` => `String`
* `:l` => `Array`
* `:m` => `Hash`
Members are unmarshalled into the following objects:
* `nil` => `:null`
* `true` or `false` => `:bool`
* `Set<Object>` => `:ss` or `:ns` or `:bs`
* `StringIO` or `IO` => `:b`
* `Numeric` => `:n`
* `String` or `Symbol` or `#to_str` => `:s`
* `Array` => `:l`
* `Hash` or `#to_h` => `:m`
Members are marshalled using the following objects:
ddb = Aws::DynamoDB::Client.new(simple_attributes: false)
`simple_attributes: false` to the client constructor:
objects. You can disable this plugin by passing
This plugin is enabled by default for all {DynamoDB::Client}
Ruby natives.
Translates attribute values for requests and responses to sensible
Simplifies working with Amazon DynamoDB attribute values.

def add_handlers(handlers, config)

def add_handlers(handlers, config)
  if config.simple_attributes
    handlers.add(Handler, step: :initialize)
  end
end