vendor/bundle/ruby/2.7.0/gems/aws-record-2.6.0/lib/aws-record/record/item_operations.rb
# Saves this instance of an item to Amazon DynamoDB. If this item is "new"
# as defined by having new or altered key attributes, will attempt a
# conditional
# {http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html#put_item-instance_method Aws::DynamoDB::Client#put_item}
# call, which will not overwrite an existing item. If the item only has
# altered non-key attributes, will perform an
# {http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html#update_item-instance_method Aws::DynamoDB::Client#update_item}
# call. Uses this item instance's attributes in order to build the
# request on your behalf.
#
# You can use the +:force+ option to perform a simple put/overwrite
# without conditional validation or update logic.
#
# @param [Hash] opts
# @option opts [Boolean] :force if true, will save as a put operation and
#  overwrite any existing item on the remote end. Otherwise, and by
#  default, will either perform a conditional put or an update call.
# @raise [Aws::Record::Errors::KeyMissing] if a required key attribute
#  does not have a value within this item instance.
# @raise [Aws::Record::Errors::ConditionalWriteFailed] if a conditional
#  put fails because the item exists on the remote end.
# @raise [Aws::Record::Errors::ValidationError] if the item responds to
#  +:valid?+ and that call returned false. In such a case, checking root
#  cause is dependent on the validation library you are using.
Saves this instance of an item to Amazon DynamoDB.

You can use the +:force+ option to perform a simple put/overwrite
without conditional validation or update logic.
Saves this instance of an item to Amazon DynamoDB . You can use the + : force + option to perform a simple put / overwrite without conditional validation or update logic .
def save!(opts = {})
        ret = save(opts)
        if ret
          ret
        else
          raise Errors::ValidationError.new("Validation hook returned false!")
        end
      end
def save! ( opts = { } ) ret = save ( opts ) if ret ret else raise Errors :: ValidationError . new ( "Validation hook returned false!" ) end end
Saves this instance of an item to Amazon DynamoDB.
Saves this instance of an item to Amazon DynamoDB .
[Aws::Record::Errors::KeyMissing] if a required key attribute does not have a value within this item instance.
[ Aws :: Record :: Errors :: KeyMissing ] if a required key attribute does not have a value within this item instance .
[Aws::Record::Errors::ConditionalWriteFailed] if a conditional put fails because the item exists on the remote end.
[ Aws :: Record :: Errors :: ConditionalWriteFailed ] if a conditional put fails because the item exists on the remote end .
[Aws::Record::Errors::ValidationError] if the item responds to +:valid?+ and that call returned false. In such a case, checking root cause is dependent on the validation library you are using.
[ Aws :: Record :: Errors :: ValidationError ] if the item responds to + : valid? + and that call returned false . In such a case checking root cause is dependent on the validation library you are using .
opts
:force if true, will save as a put operation and overwrite any existing item on the remote end. Otherwise, and by default, will either perform a conditional put or an update call.
: force if true will save as a put operation and overwrite any existing item on the remote end . Otherwise and by default will either perform a conditional put or an update call .
<not_specific>
None