class Aws::DynamoDB::Table

def attribute_definitions

Returns:
  • (Array) -
def attribute_definitions
  data[:attribute_definitions]
end

def billing_mode_summary

Returns:
  • (Types::BillingModeSummary) -
def billing_mode_summary
  data[:billing_mode_summary]
end

def client

Returns:
  • (Client) -
def client
  @client
end

def creation_date_time

Returns:
  • (Time) -
def creation_date_time
  data[:creation_date_time]
end

def data

Returns:
  • (Types::TableDescription) -
def data
  load unless @data
  @data
end

def data_loaded?

Returns:
  • (Boolean) -
def data_loaded?
  !!@data
end

def delete(options = {})

Returns:
  • (Types::DeleteTableOutput) -

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def delete(options = {})
  options = options.merge(table_name: @name)
  resp = @client.delete_table(options)
  resp.data
end

def delete_item(options = {})

Returns:
  • (Types::DeleteItemOutput) -

Options Hash: (**options)
  • :expression_attribute_values (Hash) --
  • :expression_attribute_names (Hash) --
  • :condition_expression (String) --
  • :return_item_collection_metrics (String) --
  • :return_consumed_capacity (String) --
  • :return_values (String) --
  • :conditional_operator (String) --
  • :expected (Hash) --
  • :key (required, Hash) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def delete_item(options = {})
  options = options.merge(table_name: @name)
  resp = @client.delete_item(options)
  resp.data
end

def extract_name(args, options)

def extract_name(args, options)
  value = args[0] || options.delete(:name)
  case value
  when String then value
  when nil then raise ArgumentError, "missing required option :name"
  else
    msg = "expected :name to be a String, got #{value.class}"
    raise ArgumentError, msg
  end
end

def get_item(options = {})

Returns:
  • (Types::GetItemOutput) -

Options Hash: (**options)
  • :expression_attribute_names (Hash) --
  • :projection_expression (String) --
  • :return_consumed_capacity (String) --
  • :consistent_read (Boolean) --
  • :attributes_to_get (Array) --
  • :key (required, Hash) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def get_item(options = {})
  options = options.merge(table_name: @name)
  resp = @client.get_item(options)
  resp.data
end

def global_secondary_indexes

Returns:
  • (Array) -
def global_secondary_indexes
  data[:global_secondary_indexes]
end

def identifiers

Other tags:
    Api: - private

Deprecated:
def identifiers
  { name: @name }
end

def initialize(*args)

Options Hash: (**options)
  • :client (Client) --
  • :name (required, String) --
  • :client (Client) --

Overloads:
  • def initialize(options = {})
  • def initialize(name, options = {})

Parameters:
  • name (String) --
def initialize(*args)
  options = Hash === args.last ? args.pop.dup : {}
  @name = extract_name(args, options)
  @data = options.delete(:data)
  @client = options.delete(:client) || Client.new(options)
end

def item_count

Returns:
  • (Integer) -
def item_count
  data[:item_count]
end

def key_schema

Returns:
  • (Array) -
def key_schema
  data[:key_schema]
end

def latest_stream_arn

Returns:
  • (String) -
def latest_stream_arn
  data[:latest_stream_arn]
end

def latest_stream_label

Returns:
  • (String) -
def latest_stream_label
  data[:latest_stream_label]
end

def load

Returns:
  • (self) -
def load
  resp = @client.describe_table(table_name: @name)
  @data = resp.table
  self
end

def local_secondary_indexes

Returns:
  • (Array) -
def local_secondary_indexes
  data[:local_secondary_indexes]
end

def name

Returns:
  • (String) -
def name
  @name
end

def provisioned_throughput

Returns:
  • (Types::ProvisionedThroughputDescription) -
def provisioned_throughput
  data[:provisioned_throughput]
end

def put_item(options = {})

Returns:
  • (Types::PutItemOutput) -

Options Hash: (**options)
  • :expression_attribute_values (Hash) --
  • :expression_attribute_names (Hash) --
  • :condition_expression (String) --
  • :conditional_operator (String) --
  • :return_item_collection_metrics (String) --
  • :return_consumed_capacity (String) --
  • :return_values (String) --
  • :expected (Hash) --
  • :item (required, Hash) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def put_item(options = {})
  options = options.merge(table_name: @name)
  resp = @client.put_item(options)
  resp.data
end

def query(options = {})

Returns:
  • (Types::QueryOutput) -

Options Hash: (**options)
  • :expression_attribute_values (Hash) --
  • :expression_attribute_names (Hash) --
  • :key_condition_expression (String) --
  • :filter_expression (String) --
  • :projection_expression (String) --
  • :return_consumed_capacity (String) --
  • :exclusive_start_key (Hash) --
  • :scan_index_forward (Boolean) --
  • :conditional_operator (String) --
  • :query_filter (Hash) --
  • :key_conditions (Hash) --
  • :consistent_read (Boolean) --
  • :limit (Integer) --
  • :attributes_to_get (Array) --
  • :select (String) --
  • :index_name (String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def query(options = {})
  options = options.merge(table_name: @name)
  resp = @client.query(options)
  resp.data
end

def restore_summary

Returns:
  • (Types::RestoreSummary) -
def restore_summary
  data[:restore_summary]
end

def scan(options = {})

Returns:
  • (Types::ScanOutput) -

Options Hash: (**options)
  • :consistent_read (Boolean) --
  • :expression_attribute_values (Hash) --
  • :expression_attribute_names (Hash) --
  • :filter_expression (String) --
  • :projection_expression (String) --
  • :segment (Integer) --
  • :total_segments (Integer) --
  • :return_consumed_capacity (String) --
  • :exclusive_start_key (Hash) --
  • :conditional_operator (String) --
  • :scan_filter (Hash) --
  • :select (String) --
  • :limit (Integer) --
  • :attributes_to_get (Array) --
  • :index_name (String) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def scan(options = {})
  options = options.merge(table_name: @name)
  resp = @client.scan(options)
  resp.data
end

def sse_description

Returns:
  • (Types::SSEDescription) -
def sse_description
  data[:sse_description]
end

def stream_specification

Returns:
  • (Types::StreamSpecification) -
def stream_specification
  data[:stream_specification]
end

def table_arn

Returns:
  • (String) -
def table_arn
  data[:table_arn]
end

def table_id

Returns:
  • (String) -
def table_id
  data[:table_id]
end

def table_size_bytes

Returns:
  • (Integer) -
def table_size_bytes
  data[:table_size_bytes]
end

def table_status

Returns:
  • (String) -
def table_status
  data[:table_status]
end

def update(options = {})

Returns:
  • (Table) -

Options Hash: (**options)
  • :sse_specification (Types::SSESpecification) --
  • :stream_specification (Types::StreamSpecification) --
  • :global_secondary_index_updates (Array) --
  • :provisioned_throughput (Types::ProvisionedThroughput) --
  • :billing_mode (String) --
  • :attribute_definitions (Array) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def update(options = {})
  options = options.merge(table_name: @name)
  resp = @client.update_table(options)
  Table.new(
    name: @name,
    data: resp.data.table_description,
    client: @client
  )
end

def update_item(options = {})

Returns:
  • (Types::UpdateItemOutput) -

Options Hash: (**options)
  • :expression_attribute_values (Hash) --
  • :expression_attribute_names (Hash) --
  • :condition_expression (String) --
  • :update_expression (String) --
  • :return_item_collection_metrics (String) --
  • :return_consumed_capacity (String) --
  • :return_values (String) --
  • :conditional_operator (String) --
  • :expected (Hash) --
  • :attribute_updates (Hash) --
  • :key (required, Hash) --

Parameters:
  • options (Hash) -- ({})

Other tags:
    Example: Request syntax with placeholder values -
def update_item(options = {})
  options = options.merge(table_name: @name)
  resp = @client.update_item(options)
  resp.data
end

def wait_until(options = {}, &block)

Returns:
  • (Resource) - if the waiter was successful

Options Hash: (**options)
  • :before_wait (Proc) -- Callback
  • :before_attempt (Proc) -- Callback
  • :delay (Integer) -- Delay between each
  • :max_attempts (Integer) -- Maximum number of

Raises:
  • (NotImplementedError) - Raised when the resource does not
  • (Aws::Waiters::Errors::UnexpectedError) - Raised when an error is encountered
  • (Aws::Waiters::Errors::FailureStateError) - Raised when the waiter terminates

Other tags:
    Note: - The waiting operation is performed on a copy. The original resource remains unchanged

Deprecated:
  • Use [Aws::DynamoDB::Client] #wait_until instead
def wait_until(options = {}, &block)
  self_copy = self.dup
  attempts = 0
  options[:max_attempts] = 10 unless options.key?(:max_attempts)
  options[:delay] ||= 10
  options[:poller] = Proc.new do
    attempts += 1
    if block.call(self_copy)
      [:success, self_copy]
    else
      self_copy.reload unless attempts == options[:max_attempts]
      :retry
    end
  end
  Aws::Waiters::Waiter.new(options).wait({})
end