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_bulkDelete(options = {}) ⇒ Object

Delete items from a datastore in bulk

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :ids (array)

    IDs of items to be deleted.

  • :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_bulkDelete(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :ids missing' if options[:ids].nil?
  post('apps.datastore.bulkDelete', options)
end

#apps_datastore_bulkGet(options = {}) ⇒ Object

Get items from a datastore in bulk

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :ids (array)

    items’ ids.

  • :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_bulkGet(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :ids missing' if options[:ids].nil?
  post('apps.datastore.bulkGet', options)
end

#apps_datastore_bulkPut(options = {}) ⇒ Object

Creates or replaces existing items in bulk

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :datastore (string)

    name of the datastore.

  • :items (array)

    attribute names and values of the items; limit of 25.

  • :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_bulkPut(options = {})
  raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil?
  raise ArgumentError, 'Required arguments :items missing' if options[:items].nil?
  post('apps.datastore.bulkPut', options)
end

#apps_datastore_count(options = {}) ⇒ Object

Count the number of items in a datastore that match a query

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.

  • :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.

Raises:

  • (ArgumentError)

See Also:



75
76
77
78
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 75

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

#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:



91
92
93
94
95
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 91

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:



108
109
110
111
112
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 108

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:



125
126
127
128
129
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 125

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:



150
151
152
153
154
155
156
157
158
159
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 150

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:



172
173
174
175
176
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 172

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