Module: Slack::Web::Api::Endpoints::AppsDatastore

Included in:
Slack::Web::Api::Endpoints
Defined in:
lib/slack/web/api/endpoints/apps_datastore.rb

Instance Method Summary collapse

Instance Method Details

#apps_datastore_delete(options = {}) ⇒ Object

Delete an item from a datastore

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :id (string)

    item id.

  • :app_id (Object)

    .

Raises:

  • (ArgumentError)

See Also:



20
21
22
23
24
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 20

def apps_datastore_delete(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :id missing' if options[:id].nil?
  post('apps.datastore.delete', options)
end

#apps_datastore_get(options = {}) ⇒ Object

Get an item from a datastore

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :id (string)

    item id.

  • :app_id (Object)

    .

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 37

def apps_datastore_get(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :id missing' if options[:id].nil?
  post('apps.datastore.get', options)
end

#apps_datastore_put(options = {}) ⇒ Object

Creates a new item, or replaces an old item with a new item.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :item (object)

    attribute names and values of the item.

  • :app_id (Object)

    .

Raises:

  • (ArgumentError)

See Also:



54
55
56
57
58
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 54

def apps_datastore_put(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :item missing' if options[:item].nil?
  post('apps.datastore.put', options)
end

#apps_datastore_query(options = {}) ⇒ Object

Query a datastore for items

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    Name of the datastore.

  • :app_id (Object)

    Required if calling with user token.

  • :cursor (string)

    Set cursor to next_cursor returned by the previous call to list items in the next page.

  • :expression (string)

    A query filter expression api.slack.com/future/datastores.

  • :expression_attributes (object)

    A map of attributes referenced in expression.

  • :expression_values (object)

    A map of values referenced in expression.

  • :limit (integer)

    The maximum number of items to evaluate for a given request (not necessarily the number of matching items). If the given request dataset size exceeds 1 MB before reaching the limit, the returned item count will likely be less than the limit. In any case where there are more items available beyond an imposed limit, a next_cursor value will be provided for use in subsequent requests.

Raises:

  • (ArgumentError)

See Also:



79
80
81
82
83
84
85
86
87
88
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 79

def apps_datastore_query(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  if block_given?
    Pagination::Cursor.new(self, :apps_datastore_query, options).each do |page|
      yield page
    end
  else
    post('apps.datastore.query', options)
  end
end

#apps_datastore_update(options = {}) ⇒ Object

Edits an existing item’s attributes, or adds a new item if it does not already exist.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :item (object)

    attribute names and values to be updated.

  • :app_id (Object)

    .

Raises:

  • (ArgumentError)

See Also:



101
102
103
104
105
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 101

def apps_datastore_update(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :item missing' if options[:item].nil?
  post('apps.datastore.update', options)
end