class Aws::DynamoDBStreams::Plugins::SimpleAttributes

Simplifies working with Amazon DynamoDBStreams attribute values. Translates attribute values from responses to sensible Ruby natives.

This plugin is disabled by default for all {DynamoDBStreams::Client} objects. You can enable this plugin by passing `simple_attributes: false` to the client constructor:

ddb = Aws::DynamoDBStreams::Client.new(simple_attributes: true)

## Output Examples

With this plugin enabled, `simple_attributes: true`:

resp = dynamodbstreams.get_records(shard_iterator: iterator)
resp.records.first.dynamodb.new_image
{
  id: 'uuid',
  enabled: true,
  tags: #<Set: {"attributes", "simple"}>,
  data: #<StringIO:0x00007fe4061e6bc0>,
  scores: [0.1e1, 0.2e1, 0.3e1, nil],
  name: {
    first: 'John',
    last: 'Doe',
  }
}

With this plugin disabled, `simple_attributes: false`:

resp = dynamodbstreams.get_records(shard_iterator: iterator)
resp.records.first.dynamodb.new_image
{
  "id"=> <struct s='uuid', n=nil, b=nil, ss=nil, ns=nil, bs=nil, m=nil, l=nil, null=nil, bool=nil>
  "enabled"=> <struct s=nil, n=nil, b=nil, ss=nil, ns=nil, bs=nil, m=nil, l=nil, null=nil, bool=true>
  ...
}

Public Instance Methods

add_handlers(handlers, config) click to toggle source
# File lib/aws-sdk-dynamodbstreams/plugins/simple_attributes.rb, line 54
def add_handlers(handlers, config)
  if config.simple_attributes
    handlers.add(Handler, step: :initialize, operations: [:get_records])
  end
end