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
-
#apps_datastore_delete(options = {}) ⇒ Object
Delete an item from a datastore.
-
#apps_datastore_get(options = {}) ⇒ Object
Get an item from a datastore.
-
#apps_datastore_put(options = {}) ⇒ Object
Creates a new item, or replaces an old item with a new item.
-
#apps_datastore_query(options = {}) ⇒ Object
Query a datastore for items.
-
#apps_datastore_update(options = {}) ⇒ Object
Edits an existing item’s attributes, or adds a new item if it does not already exist.
Instance Method Details
#apps_datastore_delete(options = {}) ⇒ Object
Delete an item from a datastore
20 21 22 23 24 |
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 20 def apps_datastore_delete( = {}) raise ArgumentError, 'Required arguments :datastore missing' if [:datastore].nil? raise ArgumentError, 'Required arguments :id missing' if [:id].nil? post('apps.datastore.delete', ) end |
#apps_datastore_get(options = {}) ⇒ Object
Get an item from a datastore
37 38 39 40 41 |
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 37 def apps_datastore_get( = {}) raise ArgumentError, 'Required arguments :datastore missing' if [:datastore].nil? raise ArgumentError, 'Required arguments :id missing' if [:id].nil? post('apps.datastore.get', ) end |
#apps_datastore_put(options = {}) ⇒ Object
Creates a new item, or replaces an old item with a new item.
54 55 56 57 58 |
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 54 def apps_datastore_put( = {}) raise ArgumentError, 'Required arguments :datastore missing' if [:datastore].nil? raise ArgumentError, 'Required arguments :item missing' if [:item].nil? post('apps.datastore.put', ) end |
#apps_datastore_query(options = {}) ⇒ Object
Query a datastore for items
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( = {}) raise ArgumentError, 'Required arguments :datastore missing' if [:datastore].nil? if block_given? Pagination::Cursor.new(self, :apps_datastore_query, ).each do |page| yield page end else post('apps.datastore.query', ) end end |
#apps_datastore_update(options = {}) ⇒ Object
Edits an existing item’s attributes, or adds a new item if it does not already exist.
101 102 103 104 105 |
# File 'lib/slack/web/api/endpoints/apps_datastore.rb', line 101 def apps_datastore_update( = {}) raise ArgumentError, 'Required arguments :datastore missing' if [:datastore].nil? raise ArgumentError, 'Required arguments :item missing' if [:item].nil? post('apps.datastore.update', ) end |