|
| 1 | +# frozen_string_literal: true |
| 2 | +# This file was auto-generated by lib/tasks/web.rake |
| 3 | + |
| 4 | +module Slack |
| 5 | + module Web |
| 6 | + module Api |
| 7 | + module Endpoints |
| 8 | + module AppsDatastore |
| 9 | + # |
| 10 | + # Delete an item from a datastore |
| 11 | + # |
| 12 | + # @option options [string] :datastore |
| 13 | + # name of the datastore. |
| 14 | + # @option options [string] :id |
| 15 | + # item id. |
| 16 | + # @option options [Object] :app_id |
| 17 | + # . |
| 18 | + # @see https://api.slack.com/methods/apps.datastore.delete |
| 19 | + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.delete.json |
| 20 | + def apps_datastore_delete(options = {}) |
| 21 | + raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil? |
| 22 | + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? |
| 23 | + post('apps.datastore.delete', options) |
| 24 | + end |
| 25 | + |
| 26 | + # |
| 27 | + # Get an item from a datastore |
| 28 | + # |
| 29 | + # @option options [string] :datastore |
| 30 | + # name of the datastore. |
| 31 | + # @option options [string] :id |
| 32 | + # item id. |
| 33 | + # @option options [Object] :app_id |
| 34 | + # . |
| 35 | + # @see https://api.slack.com/methods/apps.datastore.get |
| 36 | + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.get.json |
| 37 | + def apps_datastore_get(options = {}) |
| 38 | + raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil? |
| 39 | + raise ArgumentError, 'Required arguments :id missing' if options[:id].nil? |
| 40 | + post('apps.datastore.get', options) |
| 41 | + end |
| 42 | + |
| 43 | + # |
| 44 | + # Creates a new item, or replaces an old item with a new item. |
| 45 | + # |
| 46 | + # @option options [string] :datastore |
| 47 | + # name of the datastore. |
| 48 | + # @option options [object] :item |
| 49 | + # attribute names and values of the item. |
| 50 | + # @option options [Object] :app_id |
| 51 | + # . |
| 52 | + # @see https://api.slack.com/methods/apps.datastore.put |
| 53 | + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.put.json |
| 54 | + def apps_datastore_put(options = {}) |
| 55 | + raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil? |
| 56 | + raise ArgumentError, 'Required arguments :item missing' if options[:item].nil? |
| 57 | + post('apps.datastore.put', options) |
| 58 | + end |
| 59 | + |
| 60 | + # |
| 61 | + # Query a datastore for items |
| 62 | + # |
| 63 | + # @option options [string] :datastore |
| 64 | + # Name of the datastore. |
| 65 | + # @option options [Object] :app_id |
| 66 | + # Required if calling with user token. |
| 67 | + # @option options [string] :cursor |
| 68 | + # Set cursor to next_cursor returned by the previous call to list items in the next page. |
| 69 | + # @option options [string] :expression |
| 70 | + # A query filter expression https://api.slack.com/future/datastores. |
| 71 | + # @option options [object] :expression_attributes |
| 72 | + # A map of attributes referenced in expression. |
| 73 | + # @option options [object] :expression_values |
| 74 | + # A map of values referenced in expression. |
| 75 | + # @option options [integer] :limit |
| 76 | + # 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. |
| 77 | + # @see https://api.slack.com/methods/apps.datastore.query |
| 78 | + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.query.json |
| 79 | + def apps_datastore_query(options = {}) |
| 80 | + raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil? |
| 81 | + if block_given? |
| 82 | + Pagination::Cursor.new(self, :apps_datastore_query, options).each do |page| |
| 83 | + yield page |
| 84 | + end |
| 85 | + else |
| 86 | + post('apps.datastore.query', options) |
| 87 | + end |
| 88 | + end |
| 89 | + |
| 90 | + # |
| 91 | + # Edits an existing item's attributes, or adds a new item if it does not already exist. |
| 92 | + # |
| 93 | + # @option options [string] :datastore |
| 94 | + # name of the datastore. |
| 95 | + # @option options [object] :item |
| 96 | + # attribute names and values to be updated. |
| 97 | + # @option options [Object] :app_id |
| 98 | + # . |
| 99 | + # @see https://api.slack.com/methods/apps.datastore.update |
| 100 | + # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/apps.datastore/apps.datastore.update.json |
| 101 | + def apps_datastore_update(options = {}) |
| 102 | + raise ArgumentError, 'Required arguments :datastore missing' if options[:datastore].nil? |
| 103 | + raise ArgumentError, 'Required arguments :item missing' if options[:item].nil? |
| 104 | + post('apps.datastore.update', options) |
| 105 | + end |
| 106 | + end |
| 107 | + end |
| 108 | + end |
| 109 | + end |
| 110 | +end |
0 commit comments