slack-ruby-client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/.github/workflows/integration_test.yml +19 -0
  4. data/.github/workflows/pr_lint.yml +1 -1
  5. data/.github/workflows/test.yml +1 -0
  6. data/CHANGELOG.md +9 -0
  7. data/README.md +18 -14
  8. data/SECURITY.md +9 -0
  9. data/bin/commands/admin_analytics.rb +16 -10
  10. data/bin/commands/admin_apps.rb +48 -42
  11. data/bin/commands/admin_apps_approved.rb +17 -11
  12. data/bin/commands/admin_apps_requests.rb +27 -21
  13. data/bin/commands/admin_apps_restricted.rb +17 -11
  14. data/bin/commands/admin_audit_anomaly_allow.rb +22 -16
  15. data/bin/commands/admin_auth_policy.rb +37 -31
  16. data/bin/commands/admin_barriers.rb +44 -38
  17. data/bin/commands/admin_conversations.rb +221 -165
  18. data/bin/commands/admin_conversations_ekm.rb +17 -11
  19. data/bin/commands/admin_conversations_restrictAccess.rb +35 -29
  20. data/bin/commands/admin_emoji.rb +50 -44
  21. data/bin/commands/admin_inviteRequests.rb +34 -28
  22. data/bin/commands/admin_inviteRequests_approved.rb +16 -10
  23. data/bin/commands/admin_inviteRequests_denied.rb +16 -10
  24. data/bin/commands/admin_roles.rb +46 -0
  25. data/bin/commands/admin_teams.rb +26 -20
  26. data/bin/commands/admin_teams_admins.rb +16 -10
  27. data/bin/commands/admin_teams_owners.rb +16 -10
  28. data/bin/commands/admin_teams_settings.rb +59 -53
  29. data/bin/commands/admin_usergroups.rb +45 -39
  30. data/bin/commands/admin_users.rb +91 -85
  31. data/bin/commands/admin_users_session.rb +72 -66
  32. data/bin/commands/admin_users_unsupportedVersions.rb +15 -9
  33. data/bin/commands/api.rb +14 -8
  34. data/bin/commands/apps.rb +15 -9
  35. data/bin/commands/apps_connections.rb +13 -7
  36. data/bin/commands/apps_event_authorizations.rb +16 -10
  37. data/bin/commands/apps_manifest.rb +48 -42
  38. data/bin/commands/auth.rb +21 -15
  39. data/bin/commands/auth_teams.rb +16 -10
  40. data/bin/commands/bookmarks.rb +50 -44
  41. data/bin/commands/bots.rb +15 -9
  42. data/bin/commands/calls.rb +49 -43
  43. data/bin/commands/calls_participants.rb +24 -18
  44. data/bin/commands/chat.rb +150 -144
  45. data/bin/commands/chat_scheduledMessages.rb +19 -13
  46. data/bin/commands/conversations.rb +233 -227
  47. data/bin/commands/dialog.rb +15 -9
  48. data/bin/commands/dnd.rb +46 -40
  49. data/bin/commands/emoji.rb +14 -7
  50. data/bin/commands/files.rb +110 -105
  51. data/bin/commands/files_comments.rb +15 -9
  52. data/bin/commands/files_remote.rb +73 -67
  53. data/bin/commands/functions_workflows_steps.rb +22 -0
  54. data/bin/commands/functions_workflows_steps_responses.rb +22 -0
  55. data/bin/commands/migration.rb +16 -10
  56. data/bin/commands/oauth.rb +18 -12
  57. data/bin/commands/oauth_v2.rb +28 -22
  58. data/bin/commands/openid_connect.rb +26 -20
  59. data/bin/commands/pins.rb +33 -26
  60. data/bin/commands/reactions.rb +52 -46
  61. data/bin/commands/reminders.rb +53 -47
  62. data/bin/commands/rtm.rb +15 -9
  63. data/bin/commands/search.rb +43 -37
  64. data/bin/commands/stars.rb +38 -32
  65. data/bin/commands/team.rb +47 -39
  66. data/bin/commands/team_billing.rb +13 -7
  67. data/bin/commands/team_preferences.rb +13 -7
  68. data/bin/commands/team_profile.rb +14 -8
  69. data/bin/commands/tooling_tokens.rb +14 -8
  70. data/bin/commands/usergroups.rb +64 -58
  71. data/bin/commands/usergroups_users.rb +27 -21
  72. data/bin/commands/users.rb +111 -105
  73. data/bin/commands/users_admin.rb +28 -22
  74. data/bin/commands/users_prefs.rb +13 -7
  75. data/bin/commands/users_profile.rb +26 -20
  76. data/bin/commands/views.rb +47 -41
  77. data/bin/commands/workflows.rb +36 -30
  78. data/bin/slack +48 -43
  79. data/lib/slack/version.rb +1 -1
  80. data/lib/slack/web/api/endpoints/admin_analytics.rb +1 -1
  81. data/lib/slack/web/api/endpoints/admin_apps_requests.rb +1 -1
  82. data/lib/slack/web/api/endpoints/admin_conversations.rb +78 -0
  83. data/lib/slack/web/api/endpoints/admin_roles.rb +73 -0
  84. data/lib/slack/web/api/endpoints/chat.rb +2 -2
  85. data/lib/slack/web/api/endpoints/conversations.rb +1 -1
  86. data/lib/slack/web/api/endpoints/emoji.rb +2 -0
  87. data/lib/slack/web/api/endpoints/files.rb +0 -2
  88. data/lib/slack/web/api/endpoints/functions_workflows_steps.rb +28 -0
  89. data/lib/slack/web/api/endpoints/functions_workflows_steps_responses.rb +28 -0
  90. data/lib/slack/web/api/endpoints/pins.rb +2 -0
  91. data/lib/slack/web/api/endpoints/team.rb +11 -1
  92. data/lib/slack/web/api/endpoints/usergroups.rb +1 -1
  93. data/lib/slack/web/api/endpoints/users_profile.rb +1 -1
  94. data/lib/slack/web/api/endpoints.rb +6 -0
  95. data/lib/slack/web/api/errors.rb +62 -0
  96. data/lib/slack/web/api/templates/command.erb +18 -12
  97. data/lib/tasks/web.rake +0 -6
  98. data/slack-ruby-client.gemspec +0 -1
  99. data/spec/slack/web/api/endpoints/admin_conversations_spec.rb +31 -0
  100. data/spec/slack/web/api/endpoints/admin_roles_spec.rb +30 -0
  101. data/spec/slack/web/api/endpoints/functions_workflows_steps_responses_spec.rb +13 -0
  102. data/spec/slack/web/api/endpoints/functions_workflows_steps_spec.rb +13 -0
  103. metadata +13 -19
  104. data/bin/commands.rb +0 -69
  105. data/lib/slack/web/api/templates/commands.erb +0 -6
@@ -1,122 +1,128 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Users methods.'
5
- command 'users' do |g|
6
- g.desc 'List conversations the calling user may access.'
7
- g.long_desc %( List conversations the calling user may access. )
8
- g.command 'conversations' do |c|
9
- c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
10
- c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
11
- c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
12
- c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.'
13
- c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
14
- c.flag 'user', desc: "Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership."
15
- c.action do |_global_options, options, _args|
16
- puts JSON.dump($client.users_conversations(options))
17
- end
18
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Users methods.'
8
+ command 'users' do |g|
9
+ g.desc 'List conversations the calling user may access.'
10
+ g.long_desc %( List conversations the calling user may access. )
11
+ g.command 'conversations' do |c|
12
+ c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
13
+ c.flag 'exclude_archived', desc: 'Set to true to exclude archived channels from the list.'
14
+ c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. Must be an integer no larger than 1000."
15
+ c.flag 'team_id', desc: 'encoded team id to list conversations in, required if org token is used.'
16
+ c.flag 'types', desc: 'Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im.'
17
+ c.flag 'user', desc: "Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership."
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump(@client.users_conversations(options))
20
+ end
21
+ end
19
22
 
20
- g.desc 'Delete the user profile photo'
21
- g.long_desc %( Delete the user profile photo )
22
- g.command 'deletePhoto' do |c|
23
- c.action do |_global_options, options, _args|
24
- puts JSON.dump($client.users_deletePhoto(options))
25
- end
26
- end
23
+ g.desc 'Delete the user profile photo'
24
+ g.long_desc %( Delete the user profile photo )
25
+ g.command 'deletePhoto' do |c|
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.users_deletePhoto(options))
28
+ end
29
+ end
27
30
 
28
- g.desc 'Gets user presence information.'
29
- g.long_desc %( Gets user presence information. )
30
- g.command 'getPresence' do |c|
31
- c.flag 'user', desc: 'User to get presence info on. Defaults to the authed user.'
32
- c.action do |_global_options, options, _args|
33
- puts JSON.dump($client.users_getPresence(options))
34
- end
35
- end
31
+ g.desc 'Gets user presence information.'
32
+ g.long_desc %( Gets user presence information. )
33
+ g.command 'getPresence' do |c|
34
+ c.flag 'user', desc: 'User to get presence info on. Defaults to the authed user.'
35
+ c.action do |_global_options, options, _args|
36
+ puts JSON.dump(@client.users_getPresence(options))
37
+ end
38
+ end
36
39
 
37
- g.desc 'This method returns the ID of a team user.'
38
- g.long_desc %( This method returns the ID of a team user. )
39
- g.command 'id' do |c|
40
- c.flag 'user', desc: 'User to get ID for, prefixed with @.'
41
- c.action do |_global_options, options, _args|
42
- puts JSON.dump($client.users_id(options))
43
- end
44
- end
40
+ g.desc 'This method returns the ID of a team user.'
41
+ g.long_desc %( This method returns the ID of a team user. )
42
+ g.command 'id' do |c|
43
+ c.flag 'user', desc: 'User to get ID for, prefixed with @.'
44
+ c.action do |_global_options, options, _args|
45
+ puts JSON.dump(@client.users_id(options))
46
+ end
47
+ end
45
48
 
46
- g.desc "Get a user's identity."
47
- g.long_desc %( Get a user's identity. )
48
- g.command 'identity' do |c|
49
- c.action do |_global_options, options, _args|
50
- puts JSON.dump($client.users_identity(options))
51
- end
52
- end
49
+ g.desc "Get a user's identity."
50
+ g.long_desc %( Get a user's identity. )
51
+ g.command 'identity' do |c|
52
+ c.action do |_global_options, options, _args|
53
+ puts JSON.dump(@client.users_identity(options))
54
+ end
55
+ end
53
56
 
54
- g.desc 'Gets information about a user.'
55
- g.long_desc %( Gets information about a user. )
56
- g.command 'info' do |c|
57
- c.flag 'user', desc: 'User to get info on.'
58
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for this user. Defaults to false.'
59
- c.action do |_global_options, options, _args|
60
- puts JSON.dump($client.users_info(options))
61
- end
62
- end
57
+ g.desc 'Gets information about a user.'
58
+ g.long_desc %( Gets information about a user. )
59
+ g.command 'info' do |c|
60
+ c.flag 'user', desc: 'User to get info on.'
61
+ c.flag 'include_locale', desc: 'Set this to true to receive the locale for this user. Defaults to false.'
62
+ c.action do |_global_options, options, _args|
63
+ puts JSON.dump(@client.users_info(options))
64
+ end
65
+ end
63
66
 
64
- g.desc 'Lists all users in a Slack team.'
65
- g.long_desc %( Lists all users in a Slack team. )
66
- g.command 'list' do |c|
67
- c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
68
- c.flag 'include_locale', desc: 'Set this to true to receive the locale for users. Defaults to false.'
69
- c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors."
70
- c.flag 'team_id', desc: 'encoded team id to list users in, required if org token is used.'
71
- c.action do |_global_options, options, _args|
72
- puts JSON.dump($client.users_list(options))
73
- end
74
- end
67
+ g.desc 'Lists all users in a Slack team.'
68
+ g.long_desc %( Lists all users in a Slack team. )
69
+ g.command 'list' do |c|
70
+ c.flag 'cursor', desc: "Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request's response_metadata. Default value fetches the first 'page' of the collection. See pagination for more detail."
71
+ c.flag 'include_locale', desc: 'Set this to true to receive the locale for users. Defaults to false.'
72
+ c.flag 'limit', desc: "The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn't been reached. Providing no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors."
73
+ c.flag 'team_id', desc: 'encoded team id to list users in, required if org token is used.'
74
+ c.action do |_global_options, options, _args|
75
+ puts JSON.dump(@client.users_list(options))
76
+ end
77
+ end
75
78
 
76
- g.desc 'Find a user with an email address.'
77
- g.long_desc %( Find a user with an email address. )
78
- g.command 'lookupByEmail' do |c|
79
- c.flag 'email', desc: 'An email address belonging to a user in the workspace.'
80
- c.action do |_global_options, options, _args|
81
- puts JSON.dump($client.users_lookupByEmail(options))
82
- end
83
- end
79
+ g.desc 'Find a user with an email address.'
80
+ g.long_desc %( Find a user with an email address. )
81
+ g.command 'lookupByEmail' do |c|
82
+ c.flag 'email', desc: 'An email address belonging to a user in the workspace.'
83
+ c.action do |_global_options, options, _args|
84
+ puts JSON.dump(@client.users_lookupByEmail(options))
85
+ end
86
+ end
84
87
 
85
- g.desc 'This method searches for users.'
86
- g.long_desc %( This method searches for users. )
87
- g.command 'search' do |c|
88
- c.flag 'user', desc: 'User to search for.'
89
- c.action do |_global_options, options, _args|
90
- puts JSON.dump($client.users_search(options))
91
- end
92
- end
88
+ g.desc 'This method searches for users.'
89
+ g.long_desc %( This method searches for users. )
90
+ g.command 'search' do |c|
91
+ c.flag 'user', desc: 'User to search for.'
92
+ c.action do |_global_options, options, _args|
93
+ puts JSON.dump(@client.users_search(options))
94
+ end
95
+ end
93
96
 
94
- g.desc 'Marked a user as active. Deprecated and non-functional.'
95
- g.long_desc %( Marked a user as active. Deprecated and non-functional. )
96
- g.command 'setActive' do |c|
97
- c.action do |_global_options, options, _args|
98
- puts JSON.dump($client.users_setActive(options))
99
- end
100
- end
97
+ g.desc 'Marked a user as active. Deprecated and non-functional.'
98
+ g.long_desc %( Marked a user as active. Deprecated and non-functional. )
99
+ g.command 'setActive' do |c|
100
+ c.action do |_global_options, options, _args|
101
+ puts JSON.dump(@client.users_setActive(options))
102
+ end
103
+ end
101
104
 
102
- g.desc 'Set the user profile photo'
103
- g.long_desc %( Set the user profile photo )
104
- g.command 'setPhoto' do |c|
105
- c.flag 'crop_w', desc: 'Width/height of crop box (always square).'
106
- c.flag 'crop_x', desc: 'X coordinate of top-left corner of crop box.'
107
- c.flag 'crop_y', desc: 'Y coordinate of top-left corner of crop box.'
108
- c.flag 'image', desc: 'File contents via multipart/form-data.'
109
- c.action do |_global_options, options, _args|
110
- puts JSON.dump($client.users_setPhoto(options))
111
- end
112
- end
105
+ g.desc 'Set the user profile photo'
106
+ g.long_desc %( Set the user profile photo )
107
+ g.command 'setPhoto' do |c|
108
+ c.flag 'crop_w', desc: 'Width/height of crop box (always square).'
109
+ c.flag 'crop_x', desc: 'X coordinate of top-left corner of crop box.'
110
+ c.flag 'crop_y', desc: 'Y coordinate of top-left corner of crop box.'
111
+ c.flag 'image', desc: 'File contents via multipart/form-data.'
112
+ c.action do |_global_options, options, _args|
113
+ puts JSON.dump(@client.users_setPhoto(options))
114
+ end
115
+ end
113
116
 
114
- g.desc 'Manually sets user presence.'
115
- g.long_desc %( Manually sets user presence. )
116
- g.command 'setPresence' do |c|
117
- c.flag 'presence', desc: 'Either auto or away.'
118
- c.action do |_global_options, options, _args|
119
- puts JSON.dump($client.users_setPresence(options))
117
+ g.desc 'Manually sets user presence.'
118
+ g.long_desc %( Manually sets user presence. )
119
+ g.command 'setPresence' do |c|
120
+ c.flag 'presence', desc: 'Either auto or away.'
121
+ c.action do |_global_options, options, _args|
122
+ puts JSON.dump(@client.users_setPresence(options))
123
+ end
124
+ end
125
+ end
120
126
  end
121
127
  end
122
128
  end
@@ -1,29 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'UsersAdmin methods.'
5
- command 'users_admin' do |g|
6
- g.desc 'Send an invitation to a new user by email (undocumented)'
7
- g.long_desc %( Send an invitation to a new user by email )
8
- g.command 'invite' do |c|
9
- c.flag 'email', desc: 'Email address of the new user'
10
- c.flag 'channels', desc: 'Comma-separated list of IDs (not names!) for channels, which the new user will auto-join. Both channel IDs for public channels and group IDs for private chanels work.'
11
- c.flag 'first_name', desc: 'Prefilled input for the "First name" field on the "new user registration" page.'
12
- c.flag 'last_name', desc: 'Prefilled input for the "Last name" field on the "new user registration" page.'
13
- c.flag 'resend', desc: 'Resend the invitation email if the user has already been invited and the email was sent some time ago.'
14
- c.flag 'restricted', desc: 'Invite a guest that can use multiple channels'
15
- c.flag 'ultra_restricted', desc: 'Invite a guest that can use one channel only'
16
- c.action do |_global_options, options, _args|
17
- puts JSON.dump($client.users_admin_invite(options))
18
- end
19
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'UsersAdmin methods.'
8
+ command 'users_admin' do |g|
9
+ g.desc 'Send an invitation to a new user by email (undocumented)'
10
+ g.long_desc %( Send an invitation to a new user by email )
11
+ g.command 'invite' do |c|
12
+ c.flag 'email', desc: 'Email address of the new user'
13
+ c.flag 'channels', desc: 'Comma-separated list of IDs (not names!) for channels, which the new user will auto-join. Both channel IDs for public channels and group IDs for private chanels work.'
14
+ c.flag 'first_name', desc: 'Prefilled input for the "First name" field on the "new user registration" page.'
15
+ c.flag 'last_name', desc: 'Prefilled input for the "Last name" field on the "new user registration" page.'
16
+ c.flag 'resend', desc: 'Resend the invitation email if the user has already been invited and the email was sent some time ago.'
17
+ c.flag 'restricted', desc: 'Invite a guest that can use multiple channels'
18
+ c.flag 'ultra_restricted', desc: 'Invite a guest that can use one channel only'
19
+ c.action do |_global_options, options, _args|
20
+ puts JSON.dump(@client.users_admin_invite(options))
21
+ end
22
+ end
20
23
 
21
- g.desc 'Disable a user (undocumented)'
22
- g.long_desc %( Disable a user )
23
- g.command 'setInactive' do |c|
24
- c.flag 'user', desc: 'User to disable'
25
- c.action do |_global_options, options, _args|
26
- puts JSON.dump($client.users_admin_setInactive(options))
24
+ g.desc 'Disable a user (undocumented)'
25
+ g.long_desc %( Disable a user )
26
+ g.command 'setInactive' do |c|
27
+ c.flag 'user', desc: 'User to disable'
28
+ c.action do |_global_options, options, _args|
29
+ puts JSON.dump(@client.users_admin_setInactive(options))
30
+ end
31
+ end
32
+ end
27
33
  end
28
34
  end
29
35
  end
@@ -1,13 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'UsersPrefs methods.'
5
- command 'users_prefs' do |g|
6
- g.desc "Returns the user's preferences (undocumented)"
7
- g.long_desc %( Returns the user's preferences )
8
- g.command 'get' do |c|
9
- c.action do |_global_options, options, _args|
10
- puts JSON.dump($client.users_prefs_get(options))
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'UsersPrefs methods.'
8
+ command 'users_prefs' do |g|
9
+ g.desc "Returns the user's preferences (undocumented)"
10
+ g.long_desc %( Returns the user's preferences )
11
+ g.command 'get' do |c|
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump(@client.users_prefs_get(options))
14
+ end
15
+ end
16
+ end
11
17
  end
12
18
  end
13
19
  end
@@ -1,27 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'UsersProfile methods.'
5
- command 'users_profile' do |g|
6
- g.desc "Retrieve a user's profile information, including their custom status."
7
- g.long_desc %( Retrieve a user's profile information, including their custom status. )
8
- g.command 'get' do |c|
9
- c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.'
10
- c.flag 'user', desc: 'User to retrieve profile info for.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.users_profile_get(options))
13
- end
14
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'UsersProfile methods.'
8
+ command 'users_profile' do |g|
9
+ g.desc "Retrieve a user's profile information, including their custom status."
10
+ g.long_desc %( Retrieve a user's profile information, including their custom status. )
11
+ g.command 'get' do |c|
12
+ c.flag 'include_labels', desc: 'Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended.'
13
+ c.flag 'user', desc: 'User to retrieve profile info for.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.users_profile_get(options))
16
+ end
17
+ end
15
18
 
16
- g.desc "Set a user's profile information, including custom status."
17
- g.long_desc %( Set a user's profile information, including custom status. )
18
- g.command 'set' do |c|
19
- c.flag 'name', desc: 'Name of a single key to set. Usable only if profile is not passed.'
20
- c.flag 'profile', desc: 'Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.'
21
- c.flag 'user', desc: 'ID of user to change. This argument may only be specified by team admins on paid teams.'
22
- c.flag 'value', desc: 'Value to set a single key to. Usable only if profile is not passed.'
23
- c.action do |_global_options, options, _args|
24
- puts JSON.dump($client.users_profile_set(options))
19
+ g.desc "Set a user's profile information, including custom status."
20
+ g.long_desc %( Set a user's profile information, including custom status. )
21
+ g.command 'set' do |c|
22
+ c.flag 'name', desc: 'Name of a single key to set. Usable only if profile is not passed.'
23
+ c.flag 'profile', desc: 'Collection of key:value pairs presented as a URL-encoded JSON hash. At most 50 fields may be set. Each field name is limited to 255 characters.'
24
+ c.flag 'user', desc: 'ID of user to change. This argument may only be specified by admins on paid teams.'
25
+ c.flag 'value', desc: 'Value to set a single key to. Usable only if profile is not passed.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.users_profile_set(options))
28
+ end
29
+ end
30
+ end
25
31
  end
26
32
  end
27
33
  end
@@ -1,50 +1,56 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Views methods.'
5
- command 'views' do |g|
6
- g.desc 'Open a view for a user.'
7
- g.long_desc %( Open a view for a user. )
8
- g.command 'open' do |c|
9
- c.flag 'view', desc: 'A view payload. This must be a JSON-encoded string.'
10
- c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
11
- c.flag 'interactivity_pointer', desc: 'Exchange an interactivity pointer to post to the user.'
12
- c.action do |_global_options, options, _args|
13
- puts JSON.dump($client.views_open(options))
14
- end
15
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Views methods.'
8
+ command 'views' do |g|
9
+ g.desc 'Open a view for a user.'
10
+ g.long_desc %( Open a view for a user. )
11
+ g.command 'open' do |c|
12
+ c.flag 'view', desc: 'A view payload. This must be a JSON-encoded string.'
13
+ c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
14
+ c.flag 'interactivity_pointer', desc: 'Exchange an interactivity pointer to post to the user.'
15
+ c.action do |_global_options, options, _args|
16
+ puts JSON.dump(@client.views_open(options))
17
+ end
18
+ end
16
19
 
17
- g.desc 'Publish a static view for a User.'
18
- g.long_desc %( Publish a static view for a User. )
19
- g.command 'publish' do |c|
20
- c.flag 'user_id', desc: 'id of the user you want publish a view to.'
21
- c.flag 'view', desc: 'A view payload. This must be a JSON-encoded string.'
22
- c.flag 'hash', desc: 'A string that represents view state to protect against possible race conditions.'
23
- c.action do |_global_options, options, _args|
24
- puts JSON.dump($client.views_publish(options))
25
- end
26
- end
20
+ g.desc 'Publish a static view for a User.'
21
+ g.long_desc %( Publish a static view for a User. )
22
+ g.command 'publish' do |c|
23
+ c.flag 'user_id', desc: 'id of the user you want publish a view to.'
24
+ c.flag 'view', desc: 'A view payload. This must be a JSON-encoded string.'
25
+ c.flag 'hash', desc: 'A string that represents view state to protect against possible race conditions.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump(@client.views_publish(options))
28
+ end
29
+ end
27
30
 
28
- g.desc 'Push a view onto the stack of a root view.'
29
- g.long_desc %( Push a view onto the stack of a root view. )
30
- g.command 'push' do |c|
31
- c.flag 'view', desc: 'A view payload. This must be a JSON-encoded string.'
32
- c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
33
- c.flag 'interactivity_pointer', desc: 'Exchange an interactivity pointer to post to the user.'
34
- c.action do |_global_options, options, _args|
35
- puts JSON.dump($client.views_push(options))
36
- end
37
- end
31
+ g.desc 'Push a view onto the stack of a root view.'
32
+ g.long_desc %( Push a view onto the stack of a root view. )
33
+ g.command 'push' do |c|
34
+ c.flag 'view', desc: 'A view payload. This must be a JSON-encoded string.'
35
+ c.flag 'trigger_id', desc: 'Exchange a trigger to post to the user.'
36
+ c.flag 'interactivity_pointer', desc: 'Exchange an interactivity pointer to post to the user.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.views_push(options))
39
+ end
40
+ end
38
41
 
39
- g.desc 'Update an existing view.'
40
- g.long_desc %( Update an existing view. )
41
- g.command 'update' do |c|
42
- c.flag 'view', desc: 'A view object. This must be a JSON-encoded string.'
43
- c.flag 'external_id', desc: 'A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required.'
44
- c.flag 'view_id', desc: 'A unique identifier of the view to be updated. Either view_id or external_id is required.'
45
- c.flag 'hash', desc: 'A string that represents view state to protect against possible race conditions.'
46
- c.action do |_global_options, options, _args|
47
- puts JSON.dump($client.views_update(options))
42
+ g.desc 'Update an existing view.'
43
+ g.long_desc %( Update an existing view. )
44
+ g.command 'update' do |c|
45
+ c.flag 'view', desc: 'A view object. This must be a JSON-encoded string.'
46
+ c.flag 'external_id', desc: 'A unique identifier of the view set by the developer. Must be unique for all views on a team. Max length of 255 characters. Either view_id or external_id is required.'
47
+ c.flag 'view_id', desc: 'A unique identifier of the view to be updated. Either view_id or external_id is required.'
48
+ c.flag 'hash', desc: 'A string that represents view state to protect against possible race conditions.'
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump(@client.views_update(options))
51
+ end
52
+ end
53
+ end
48
54
  end
49
55
  end
50
56
  end
@@ -1,38 +1,44 @@
1
1
  # frozen_string_literal: true
2
2
  # This file was auto-generated by lib/tasks/web.rake
3
3
 
4
- desc 'Workflows methods.'
5
- command 'workflows' do |g|
6
- g.desc "Indicate that an app's step in a workflow completed execution."
7
- g.long_desc %( Indicate that an app's step in a workflow completed execution. )
8
- g.command 'stepCompleted' do |c|
9
- c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
10
- c.flag 'outputs', desc: 'Key-value object of outputs from your step. Keys of this object reflect the configured key properties of your outputs array from your workflow_step object.'
11
- c.action do |_global_options, options, _args|
12
- puts JSON.dump($client.workflows_stepCompleted(options))
13
- end
14
- end
4
+ module Slack
5
+ module Cli
6
+ class App
7
+ desc 'Workflows methods.'
8
+ command 'workflows' do |g|
9
+ g.desc "Indicate that an app's step in a workflow completed execution."
10
+ g.long_desc %( Indicate that an app's step in a workflow completed execution. )
11
+ g.command 'stepCompleted' do |c|
12
+ c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
13
+ c.flag 'outputs', desc: 'Key-value object of outputs from your step. Keys of this object reflect the configured key properties of your outputs array from your workflow_step object.'
14
+ c.action do |_global_options, options, _args|
15
+ puts JSON.dump(@client.workflows_stepCompleted(options))
16
+ end
17
+ end
15
18
 
16
- g.desc "Indicate that an app's step in a workflow failed to execute."
17
- g.long_desc %( Indicate that an app's step in a workflow failed to execute. )
18
- g.command 'stepFailed' do |c|
19
- c.flag 'error', desc: 'A JSON-based object with a message property that should contain a human readable error message.'
20
- c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
21
- c.action do |_global_options, options, _args|
22
- puts JSON.dump($client.workflows_stepFailed(options))
23
- end
24
- end
19
+ g.desc "Indicate that an app's step in a workflow failed to execute."
20
+ g.long_desc %( Indicate that an app's step in a workflow failed to execute. )
21
+ g.command 'stepFailed' do |c|
22
+ c.flag 'error', desc: 'A JSON-based object with a message property that should contain a human readable error message.'
23
+ c.flag 'workflow_step_execute_id', desc: 'Context identifier that maps to the correct workflow step execution.'
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump(@client.workflows_stepFailed(options))
26
+ end
27
+ end
25
28
 
26
- g.desc 'Update the configuration for a workflow step.'
27
- g.long_desc %( Update the configuration for a workflow step. )
28
- g.command 'updateStep' do |c|
29
- c.flag 'workflow_step_edit_id', desc: 'A context identifier provided with view_submission payloads used to call back to workflows.updateStep.'
30
- c.flag 'inputs', desc: 'A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. Please note: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. Read more about variables in workflow steps here.'
31
- c.flag 'outputs', desc: 'An JSON array of output objects used during step execution. This is the data your app agrees to provide when your workflow step was executed.'
32
- c.flag 'step_image_url', desc: 'An optional field that can be used to override app image that is shown in the Workflow Builder.'
33
- c.flag 'step_name', desc: 'An optional field that can be used to override the step name that is shown in the Workflow Builder.'
34
- c.action do |_global_options, options, _args|
35
- puts JSON.dump($client.workflows_updateStep(options))
29
+ g.desc 'Update the configuration for a workflow step.'
30
+ g.long_desc %( Update the configuration for a workflow step. )
31
+ g.command 'updateStep' do |c|
32
+ c.flag 'workflow_step_edit_id', desc: 'A context identifier provided with view_submission payloads used to call back to workflows.updateStep.'
33
+ c.flag 'inputs', desc: 'A JSON key-value map of inputs required from a user during configuration. This is the data your app expects to receive when the workflow step starts. Please note: the embedded variable format is set and replaced by the workflow system. You cannot create custom variables that will be replaced at runtime. Read more about variables in workflow steps here.'
34
+ c.flag 'outputs', desc: 'An JSON array of output objects used during step execution. This is the data your app agrees to provide when your workflow step was executed.'
35
+ c.flag 'step_image_url', desc: 'An optional field that can be used to override app image that is shown in the Workflow Builder.'
36
+ c.flag 'step_name', desc: 'An optional field that can be used to override the step name that is shown in the Workflow Builder.'
37
+ c.action do |_global_options, options, _args|
38
+ puts JSON.dump(@client.workflows_updateStep(options))
39
+ end
40
+ end
41
+ end
36
42
  end
37
43
  end
38
44
  end