# frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake module Slack module Cli class App desc 'AppsDatastore methods.' command 'apps_datastore' do |g| g.desc 'Delete items from a datastore in bulk' g.long_desc %( Delete items from a datastore in bulk ) g.command 'bulkDelete' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'ids', desc: 'IDs of items to be deleted.' c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_bulkDelete(options)) end end g.desc 'Get items from a datastore in bulk' g.long_desc %( Get items from a datastore in bulk ) g.command 'bulkGet' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'ids', desc: "items' ids." c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_bulkGet(options)) end end g.desc 'Creates or replaces existing items in bulk' g.long_desc %( Creates or replaces existing items in bulk ) g.command 'bulkPut' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'items', desc: 'attribute names and values of the items; limit of 25.' c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_bulkPut(options)) end end g.desc 'Count the number of items in a datastore that match a query' g.long_desc %( Count the number of items in a datastore that match a query ) g.command 'count' do |c| c.flag 'datastore', desc: 'Name of the datastore.' c.flag 'app_id', desc: 'Required if calling with user token.' c.flag 'expression', desc: 'A query filter expression https://api.slack.com/future/datastores.' c.flag 'expression_attributes', desc: 'A map of attributes referenced in expression.' c.flag 'expression_values', desc: 'A map of values referenced in expression.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_count(options)) end end g.desc 'Delete an item from a datastore' g.long_desc %( Delete an item from a datastore ) g.command 'delete' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'id', desc: 'item id.' c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_delete(options)) end end g.desc 'Get an item from a datastore' g.long_desc %( Get an item from a datastore ) g.command 'get' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'id', desc: 'item id.' c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_get(options)) end end g.desc 'Creates a new item, or replaces an old item with a new item.' g.long_desc %( Creates a new item, or replaces an old item with a new item. ) g.command 'put' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'item', desc: 'attribute names and values of the item.' c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_put(options)) end end g.desc 'Query a datastore for items' g.long_desc %( Query a datastore for items ) g.command 'query' do |c| c.flag 'datastore', desc: 'Name of the datastore.' c.flag 'app_id', desc: 'Required if calling with user token.' c.flag 'cursor', desc: 'Set cursor to next_cursor returned by the previous call to list items in the next page.' c.flag 'expression', desc: 'A query filter expression https://api.slack.com/future/datastores.' c.flag 'expression_attributes', desc: 'A map of attributes referenced in expression.' c.flag 'expression_values', desc: 'A map of values referenced in expression.' c.flag 'limit', desc: '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.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_query(options)) end end g.desc "Edits an existing item's attributes, or adds a new item if it does not already exist." g.long_desc %( Edits an existing item's attributes, or adds a new item if it does not already exist. ) g.command 'update' do |c| c.flag 'datastore', desc: 'name of the datastore.' c.flag 'item', desc: 'attribute names and values to be updated.' c.flag 'app_id', desc: '.' c.action do |_global_options, options, _args| puts JSON.dump(@client.apps_datastore_update(options)) end end end end end end