aws-sdk-dynamodb 1.84.0 → 1.118.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +177 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-dynamodb/client.rb +940 -312
- data/lib/aws-sdk-dynamodb/client_api.rb +204 -34
- data/lib/aws-sdk-dynamodb/customizations/client.rb +5 -3
- data/lib/aws-sdk-dynamodb/endpoint_provider.rb +2 -2
- data/lib/aws-sdk-dynamodb/endpoints.rb +57 -0
- data/lib/aws-sdk-dynamodb/errors.rb +21 -0
- data/lib/aws-sdk-dynamodb/plugins/endpoints.rb +12 -2
- data/lib/aws-sdk-dynamodb/plugins/simple_attributes.rb +21 -7
- data/lib/aws-sdk-dynamodb/resource.rb +62 -18
- data/lib/aws-sdk-dynamodb/table.rb +102 -26
- data/lib/aws-sdk-dynamodb/types.rb +776 -119
- data/lib/aws-sdk-dynamodb.rb +1 -1
- data/sig/client.rbs +1495 -0
- data/sig/errors.rbs +114 -0
- data/sig/resource.rbs +206 -0
- data/sig/table.rbs +359 -0
- data/sig/types.rbs +1811 -0
- data/sig/waiters.rbs +33 -0
- metadata +17 -11
@@ -370,6 +370,14 @@ module Aws::DynamoDB
|
|
370
370
|
data[:deletion_protection_enabled]
|
371
371
|
end
|
372
372
|
|
373
|
+
# The maximum number of read and write units for the specified on-demand
|
374
|
+
# table. If you use this parameter, you must specify
|
375
|
+
# `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
|
376
|
+
# @return [Types::OnDemandThroughput]
|
377
|
+
def on_demand_throughput
|
378
|
+
data[:on_demand_throughput]
|
379
|
+
end
|
380
|
+
|
373
381
|
# @!endgroup
|
374
382
|
|
375
383
|
# @return [Client]
|
@@ -384,7 +392,9 @@ module Aws::DynamoDB
|
|
384
392
|
#
|
385
393
|
# @return [self]
|
386
394
|
def load
|
387
|
-
resp =
|
395
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
396
|
+
@client.describe_table(table_name: @name)
|
397
|
+
end
|
388
398
|
@data = resp.table
|
389
399
|
self
|
390
400
|
end
|
@@ -499,7 +509,9 @@ module Aws::DynamoDB
|
|
499
509
|
:retry
|
500
510
|
end
|
501
511
|
end
|
502
|
-
Aws::
|
512
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
513
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
514
|
+
end
|
503
515
|
end
|
504
516
|
|
505
517
|
# @!group Actions
|
@@ -511,7 +523,9 @@ module Aws::DynamoDB
|
|
511
523
|
# @return [Types::DeleteTableOutput]
|
512
524
|
def delete(options = {})
|
513
525
|
options = options.merge(table_name: @name)
|
514
|
-
resp =
|
526
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
527
|
+
@client.delete_table(options)
|
528
|
+
end
|
515
529
|
resp.data
|
516
530
|
end
|
517
531
|
|
@@ -540,6 +554,7 @@ module Aws::DynamoDB
|
|
540
554
|
# expression_attribute_values: {
|
541
555
|
# "ExpressionAttributeValueVariable" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
|
542
556
|
# },
|
557
|
+
# return_values_on_condition_check_failure: "ALL_OLD", # accepts ALL_OLD, NONE
|
543
558
|
# })
|
544
559
|
# @param [Hash] options ({})
|
545
560
|
# @option options [required, Hash<String,Types::AttributeValue>] :key
|
@@ -702,10 +717,19 @@ module Aws::DynamoDB
|
|
702
717
|
#
|
703
718
|
#
|
704
719
|
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html
|
720
|
+
# @option options [String] :return_values_on_condition_check_failure
|
721
|
+
# An optional parameter that returns the item attributes for a
|
722
|
+
# `DeleteItem` operation that failed a condition check.
|
723
|
+
#
|
724
|
+
# There is no additional cost associated with requesting a return value
|
725
|
+
# aside from the small network and processing overhead of receiving a
|
726
|
+
# larger response. No read capacity units are consumed.
|
705
727
|
# @return [Types::DeleteItemOutput]
|
706
728
|
def delete_item(options = {})
|
707
729
|
options = options.merge(table_name: @name)
|
708
|
-
resp =
|
730
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
731
|
+
@client.delete_item(options)
|
732
|
+
end
|
709
733
|
resp.data
|
710
734
|
end
|
711
735
|
|
@@ -828,7 +852,9 @@ module Aws::DynamoDB
|
|
828
852
|
# @return [Types::GetItemOutput]
|
829
853
|
def get_item(options = {})
|
830
854
|
options = options.merge(table_name: @name)
|
831
|
-
resp =
|
855
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
856
|
+
@client.get_item(options)
|
857
|
+
end
|
832
858
|
resp.data
|
833
859
|
end
|
834
860
|
|
@@ -857,6 +883,7 @@ module Aws::DynamoDB
|
|
857
883
|
# expression_attribute_values: {
|
858
884
|
# "ExpressionAttributeValueVariable" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
|
859
885
|
# },
|
886
|
+
# return_values_on_condition_check_failure: "ALL_OLD", # accepts ALL_OLD, NONE
|
860
887
|
# })
|
861
888
|
# @param [Hash] options ({})
|
862
889
|
# @option options [required, Hash<String,Types::AttributeValue>] :item
|
@@ -1040,10 +1067,19 @@ module Aws::DynamoDB
|
|
1040
1067
|
#
|
1041
1068
|
#
|
1042
1069
|
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html
|
1070
|
+
# @option options [String] :return_values_on_condition_check_failure
|
1071
|
+
# An optional parameter that returns the item attributes for a `PutItem`
|
1072
|
+
# operation that failed a condition check.
|
1073
|
+
#
|
1074
|
+
# There is no additional cost associated with requesting a return value
|
1075
|
+
# aside from the small network and processing overhead of receiving a
|
1076
|
+
# larger response. No read capacity units are consumed.
|
1043
1077
|
# @return [Types::PutItemOutput]
|
1044
1078
|
def put_item(options = {})
|
1045
1079
|
options = options.merge(table_name: @name)
|
1046
|
-
resp =
|
1080
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1081
|
+
@client.put_item(options)
|
1082
|
+
end
|
1047
1083
|
resp.data
|
1048
1084
|
end
|
1049
1085
|
|
@@ -1270,7 +1306,7 @@ module Aws::DynamoDB
|
|
1270
1306
|
#
|
1271
1307
|
#
|
1272
1308
|
#
|
1273
|
-
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
|
1309
|
+
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html
|
1274
1310
|
# @option options [String] :key_condition_expression
|
1275
1311
|
# The condition that specifies the key values for items to be retrieved
|
1276
1312
|
# by the `Query` action.
|
@@ -1431,7 +1467,9 @@ module Aws::DynamoDB
|
|
1431
1467
|
# @return [Types::QueryOutput]
|
1432
1468
|
def query(options = {})
|
1433
1469
|
options = options.merge(table_name: @name)
|
1434
|
-
resp =
|
1470
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1471
|
+
@client.query(options)
|
1472
|
+
end
|
1435
1473
|
resp.data
|
1436
1474
|
end
|
1437
1475
|
|
@@ -1651,7 +1689,7 @@ module Aws::DynamoDB
|
|
1651
1689
|
#
|
1652
1690
|
#
|
1653
1691
|
#
|
1654
|
-
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
|
1692
|
+
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.FilterExpression
|
1655
1693
|
# @option options [Hash<String,String>] :expression_attribute_names
|
1656
1694
|
# One or more substitution tokens for attribute names in an expression.
|
1657
1695
|
# The following are some use cases for using `ExpressionAttributeNames`:
|
@@ -1746,7 +1784,9 @@ module Aws::DynamoDB
|
|
1746
1784
|
# @return [Types::ScanOutput]
|
1747
1785
|
def scan(options = {})
|
1748
1786
|
options = options.merge(table_name: @name)
|
1749
|
-
resp =
|
1787
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1788
|
+
@client.scan(options)
|
1789
|
+
end
|
1750
1790
|
resp.data
|
1751
1791
|
end
|
1752
1792
|
|
@@ -1768,10 +1808,14 @@ module Aws::DynamoDB
|
|
1768
1808
|
# {
|
1769
1809
|
# update: {
|
1770
1810
|
# index_name: "IndexName", # required
|
1771
|
-
# provisioned_throughput: {
|
1811
|
+
# provisioned_throughput: {
|
1772
1812
|
# read_capacity_units: 1, # required
|
1773
1813
|
# write_capacity_units: 1, # required
|
1774
1814
|
# },
|
1815
|
+
# on_demand_throughput: {
|
1816
|
+
# max_read_request_units: 1,
|
1817
|
+
# max_write_request_units: 1,
|
1818
|
+
# },
|
1775
1819
|
# },
|
1776
1820
|
# create: {
|
1777
1821
|
# index_name: "IndexName", # required
|
@@ -1789,6 +1833,10 @@ module Aws::DynamoDB
|
|
1789
1833
|
# read_capacity_units: 1, # required
|
1790
1834
|
# write_capacity_units: 1, # required
|
1791
1835
|
# },
|
1836
|
+
# on_demand_throughput: {
|
1837
|
+
# max_read_request_units: 1,
|
1838
|
+
# max_write_request_units: 1,
|
1839
|
+
# },
|
1792
1840
|
# },
|
1793
1841
|
# delete: {
|
1794
1842
|
# index_name: "IndexName", # required
|
@@ -1812,12 +1860,18 @@ module Aws::DynamoDB
|
|
1812
1860
|
# provisioned_throughput_override: {
|
1813
1861
|
# read_capacity_units: 1,
|
1814
1862
|
# },
|
1863
|
+
# on_demand_throughput_override: {
|
1864
|
+
# max_read_request_units: 1,
|
1865
|
+
# },
|
1815
1866
|
# global_secondary_indexes: [
|
1816
1867
|
# {
|
1817
1868
|
# index_name: "IndexName", # required
|
1818
1869
|
# provisioned_throughput_override: {
|
1819
1870
|
# read_capacity_units: 1,
|
1820
1871
|
# },
|
1872
|
+
# on_demand_throughput_override: {
|
1873
|
+
# max_read_request_units: 1,
|
1874
|
+
# },
|
1821
1875
|
# },
|
1822
1876
|
# ],
|
1823
1877
|
# table_class_override: "STANDARD", # accepts STANDARD, STANDARD_INFREQUENT_ACCESS
|
@@ -1828,12 +1882,18 @@ module Aws::DynamoDB
|
|
1828
1882
|
# provisioned_throughput_override: {
|
1829
1883
|
# read_capacity_units: 1,
|
1830
1884
|
# },
|
1885
|
+
# on_demand_throughput_override: {
|
1886
|
+
# max_read_request_units: 1,
|
1887
|
+
# },
|
1831
1888
|
# global_secondary_indexes: [
|
1832
1889
|
# {
|
1833
1890
|
# index_name: "IndexName", # required
|
1834
1891
|
# provisioned_throughput_override: {
|
1835
1892
|
# read_capacity_units: 1,
|
1836
1893
|
# },
|
1894
|
+
# on_demand_throughput_override: {
|
1895
|
+
# max_read_request_units: 1,
|
1896
|
+
# },
|
1837
1897
|
# },
|
1838
1898
|
# ],
|
1839
1899
|
# table_class_override: "STANDARD", # accepts STANDARD, STANDARD_INFREQUENT_ACCESS
|
@@ -1845,6 +1905,10 @@ module Aws::DynamoDB
|
|
1845
1905
|
# ],
|
1846
1906
|
# table_class: "STANDARD", # accepts STANDARD, STANDARD_INFREQUENT_ACCESS
|
1847
1907
|
# deletion_protection_enabled: false,
|
1908
|
+
# on_demand_throughput: {
|
1909
|
+
# max_read_request_units: 1,
|
1910
|
+
# max_write_request_units: 1,
|
1911
|
+
# },
|
1848
1912
|
# })
|
1849
1913
|
# @param [Hash] options ({})
|
1850
1914
|
# @option options [Array<Types::AttributeDefinition>] :attribute_definitions
|
@@ -1862,16 +1926,16 @@ module Aws::DynamoDB
|
|
1862
1926
|
#
|
1863
1927
|
# * `PROVISIONED` - We recommend using `PROVISIONED` for predictable
|
1864
1928
|
# workloads. `PROVISIONED` sets the billing mode to [Provisioned
|
1865
|
-
#
|
1929
|
+
# capacity mode][1].
|
1866
1930
|
#
|
1867
1931
|
# * `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for
|
1868
1932
|
# unpredictable workloads. `PAY_PER_REQUEST` sets the billing mode to
|
1869
|
-
# [On-
|
1933
|
+
# [On-demand capacity mode][2].
|
1870
1934
|
#
|
1871
1935
|
#
|
1872
1936
|
#
|
1873
|
-
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
|
1874
|
-
# [2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/
|
1937
|
+
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html
|
1938
|
+
# [2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html
|
1875
1939
|
# @option options [Types::ProvisionedThroughput] :provisioned_throughput
|
1876
1940
|
# The new provisioned throughput settings for the specified table or
|
1877
1941
|
# index.
|
@@ -1898,9 +1962,9 @@ module Aws::DynamoDB
|
|
1898
1962
|
# @option options [Types::StreamSpecification] :stream_specification
|
1899
1963
|
# Represents the DynamoDB Streams configuration for the table.
|
1900
1964
|
#
|
1901
|
-
# <note markdown="1"> You receive a `
|
1902
|
-
#
|
1903
|
-
#
|
1965
|
+
# <note markdown="1"> You receive a `ValidationException` if you try to enable a stream on a
|
1966
|
+
# table that already has a stream, or if you try to disable a stream on
|
1967
|
+
# a table that doesn't have a stream.
|
1904
1968
|
#
|
1905
1969
|
# </note>
|
1906
1970
|
# @option options [Types::SSESpecification] :sse_specification
|
@@ -1909,24 +1973,26 @@ module Aws::DynamoDB
|
|
1909
1973
|
# A list of replica update actions (create, delete, or update) for the
|
1910
1974
|
# table.
|
1911
1975
|
#
|
1912
|
-
# <note markdown="1">
|
1913
|
-
#
|
1976
|
+
# <note markdown="1"> For global tables, this property only applies to global tables using
|
1977
|
+
# Version 2019.11.21 (Current version).
|
1914
1978
|
#
|
1915
1979
|
# </note>
|
1916
|
-
#
|
1917
|
-
#
|
1918
|
-
#
|
1919
|
-
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html
|
1920
1980
|
# @option options [String] :table_class
|
1921
1981
|
# The table class of the table to be updated. Valid values are
|
1922
1982
|
# `STANDARD` and `STANDARD_INFREQUENT_ACCESS`.
|
1923
1983
|
# @option options [Boolean] :deletion_protection_enabled
|
1924
1984
|
# Indicates whether deletion protection is to be enabled (true) or
|
1925
1985
|
# disabled (false) on the table.
|
1986
|
+
# @option options [Types::OnDemandThroughput] :on_demand_throughput
|
1987
|
+
# Updates the maximum number of read and write units for the specified
|
1988
|
+
# table in on-demand capacity mode. If you use this parameter, you must
|
1989
|
+
# specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both.
|
1926
1990
|
# @return [Table]
|
1927
1991
|
def update(options = {})
|
1928
1992
|
options = options.merge(table_name: @name)
|
1929
|
-
resp =
|
1993
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
1994
|
+
@client.update_table(options)
|
1995
|
+
end
|
1930
1996
|
Table.new(
|
1931
1997
|
name: @name,
|
1932
1998
|
data: resp.data.table_description,
|
@@ -1966,6 +2032,7 @@ module Aws::DynamoDB
|
|
1966
2032
|
# expression_attribute_values: {
|
1967
2033
|
# "ExpressionAttributeValueVariable" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
|
1968
2034
|
# },
|
2035
|
+
# return_values_on_condition_check_failure: "ALL_OLD", # accepts ALL_OLD, NONE
|
1969
2036
|
# })
|
1970
2037
|
# @param [Hash] options ({})
|
1971
2038
|
# @option options [required, Hash<String,Types::AttributeValue>] :key
|
@@ -2229,10 +2296,19 @@ module Aws::DynamoDB
|
|
2229
2296
|
#
|
2230
2297
|
#
|
2231
2298
|
# [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html
|
2299
|
+
# @option options [String] :return_values_on_condition_check_failure
|
2300
|
+
# An optional parameter that returns the item attributes for an
|
2301
|
+
# `UpdateItem` operation that failed a condition check.
|
2302
|
+
#
|
2303
|
+
# There is no additional cost associated with requesting a return value
|
2304
|
+
# aside from the small network and processing overhead of receiving a
|
2305
|
+
# larger response. No read capacity units are consumed.
|
2232
2306
|
# @return [Types::UpdateItemOutput]
|
2233
2307
|
def update_item(options = {})
|
2234
2308
|
options = options.merge(table_name: @name)
|
2235
|
-
resp =
|
2309
|
+
resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
2310
|
+
@client.update_item(options)
|
2311
|
+
end
|
2236
2312
|
resp.data
|
2237
2313
|
end
|
2238
2314
|
|