slackapi-sdk 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +221 -0
  4. data/bin/console +15 -0
  5. data/lib/slack_web_api/api_helper.rb +10 -0
  6. data/lib/slack_web_api/client.rb +410 -0
  7. data/lib/slack_web_api/configuration.rb +173 -0
  8. data/lib/slack_web_api/controllers/admin_apps_approved_controller.rb +48 -0
  9. data/lib/slack_web_api/controllers/admin_apps_controller.rb +78 -0
  10. data/lib/slack_web_api/controllers/admin_apps_requests_controller.rb +44 -0
  11. data/lib/slack_web_api/controllers/admin_apps_restricted_controller.rb +48 -0
  12. data/lib/slack_web_api/controllers/admin_conversations_controller.rb +472 -0
  13. data/lib/slack_web_api/controllers/admin_conversations_ekm_controller.rb +51 -0
  14. data/lib/slack_web_api/controllers/admin_conversations_restrict_access_controller.rb +129 -0
  15. data/lib/slack_web_api/controllers/admin_emoji_controller.rb +175 -0
  16. data/lib/slack_web_api/controllers/admin_invite_requests_approved_controller.rb +46 -0
  17. data/lib/slack_web_api/controllers/admin_invite_requests_controller.rb +112 -0
  18. data/lib/slack_web_api/controllers/admin_invite_requests_denied_controller.rb +46 -0
  19. data/lib/slack_web_api/controllers/admin_teams_admins_controller.rb +45 -0
  20. data/lib/slack_web_api/controllers/admin_teams_controller.rb +84 -0
  21. data/lib/slack_web_api/controllers/admin_teams_owners_controller.rb +45 -0
  22. data/lib/slack_web_api/controllers/admin_teams_settings_controller.rb +206 -0
  23. data/lib/slack_web_api/controllers/admin_usergroups_controller.rb +161 -0
  24. data/lib/slack_web_api/controllers/admin_users_controller.rb +333 -0
  25. data/lib/slack_web_api/controllers/admin_users_session_controller.rb +80 -0
  26. data/lib/slack_web_api/controllers/api_controller.rb +34 -0
  27. data/lib/slack_web_api/controllers/apps_controller.rb +40 -0
  28. data/lib/slack_web_api/controllers/apps_event_authorizations_controller.rb +45 -0
  29. data/lib/slack_web_api/controllers/apps_permissions_controller.rb +66 -0
  30. data/lib/slack_web_api/controllers/apps_permissions_resources_controller.rb +44 -0
  31. data/lib/slack_web_api/controllers/apps_permissions_scopes_controller.rb +33 -0
  32. data/lib/slack_web_api/controllers/apps_permissions_users_controller.rb +85 -0
  33. data/lib/slack_web_api/controllers/auth_controller.rb +62 -0
  34. data/lib/slack_web_api/controllers/base_controller.rb +67 -0
  35. data/lib/slack_web_api/controllers/bots_controller.rb +36 -0
  36. data/lib/slack_web_api/controllers/calls_controller.rb +174 -0
  37. data/lib/slack_web_api/controllers/calls_participants_controller.rb +79 -0
  38. data/lib/slack_web_api/controllers/chat_controller.rb +528 -0
  39. data/lib/slack_web_api/controllers/chat_scheduled_messages_controller.rb +54 -0
  40. data/lib/slack_web_api/controllers/conversations_controller.rb +628 -0
  41. data/lib/slack_web_api/controllers/dialog_controller.rb +44 -0
  42. data/lib/slack_web_api/controllers/dnd_controller.rb +141 -0
  43. data/lib/slack_web_api/controllers/emoji_controller.rb +33 -0
  44. data/lib/slack_web_api/controllers/files_comments_controller.rb +38 -0
  45. data/lib/slack_web_api/controllers/files_controller.rb +245 -0
  46. data/lib/slack_web_api/controllers/files_remote_controller.rb +250 -0
  47. data/lib/slack_web_api/controllers/migration_controller.rb +47 -0
  48. data/lib/slack_web_api/controllers/oauth_authorization_controller.rb +87 -0
  49. data/lib/slack_web_api/controllers/oauth_controller.rb +88 -0
  50. data/lib/slack_web_api/controllers/oauth_v2_controller.rb +45 -0
  51. data/lib/slack_web_api/controllers/pins_controller.rb +102 -0
  52. data/lib/slack_web_api/controllers/reactions_controller.rb +182 -0
  53. data/lib/slack_web_api/controllers/reminders_controller.rb +151 -0
  54. data/lib/slack_web_api/controllers/rtm_controller.rb +44 -0
  55. data/lib/slack_web_api/controllers/search_controller.rb +56 -0
  56. data/lib/slack_web_api/controllers/stars_controller.rb +130 -0
  57. data/lib/slack_web_api/controllers/team_controller.rb +148 -0
  58. data/lib/slack_web_api/controllers/team_profile_controller.rb +36 -0
  59. data/lib/slack_web_api/controllers/usergroups_controller.rb +205 -0
  60. data/lib/slack_web_api/controllers/usergroups_users_controller.rb +81 -0
  61. data/lib/slack_web_api/controllers/users_controller.rb +327 -0
  62. data/lib/slack_web_api/controllers/users_profile_controller.rb +82 -0
  63. data/lib/slack_web_api/controllers/views_controller.rb +158 -0
  64. data/lib/slack_web_api/controllers/workflows_controller.rb +130 -0
  65. data/lib/slack_web_api/exceptions/admin_conversations_archive_error_schema_exception.rb +50 -0
  66. data/lib/slack_web_api/exceptions/admin_conversations_convert_to_private_error_schema_exception.rb +50 -0
  67. data/lib/slack_web_api/exceptions/admin_conversations_create_error_schema_exception.rb +50 -0
  68. data/lib/slack_web_api/exceptions/admin_conversations_delete_error_schema_exception.rb +50 -0
  69. data/lib/slack_web_api/exceptions/admin_conversations_disconnect_shared_error_schema_exception.rb +50 -0
  70. data/lib/slack_web_api/exceptions/admin_conversations_get_teams_error_schema_exception.rb +50 -0
  71. data/lib/slack_web_api/exceptions/admin_conversations_invite_error_schema_exception.rb +50 -0
  72. data/lib/slack_web_api/exceptions/admin_conversations_search_error_schema_exception.rb +50 -0
  73. data/lib/slack_web_api/exceptions/admin_conversations_set_conversation_prefs_error_schema_exception.rb +50 -0
  74. data/lib/slack_web_api/exceptions/admin_conversations_unarchive_error_schema2_exception.rb +50 -0
  75. data/lib/slack_web_api/exceptions/admin_conversations_unarchive_error_schema3_exception.rb +50 -0
  76. data/lib/slack_web_api/exceptions/admin_conversations_unarchive_error_schema_exception.rb +50 -0
  77. data/lib/slack_web_api/exceptions/api_exception.rb +21 -0
  78. data/lib/slack_web_api/exceptions/api_test_error_schema_exception.rb +50 -0
  79. data/lib/slack_web_api/exceptions/apps_permissions_info_error_schema_exception.rb +56 -0
  80. data/lib/slack_web_api/exceptions/apps_permissions_request_error_schema_exception.rb +56 -0
  81. data/lib/slack_web_api/exceptions/apps_permissions_resources_list_error_schema_exception.rb +56 -0
  82. data/lib/slack_web_api/exceptions/apps_permissions_scopes_list_error_schema_exception.rb +56 -0
  83. data/lib/slack_web_api/exceptions/apps_uninstall_error_schema_exception.rb +56 -0
  84. data/lib/slack_web_api/exceptions/auth_revoke_error_schema_exception.rb +56 -0
  85. data/lib/slack_web_api/exceptions/auth_test_error_schema_exception.rb +56 -0
  86. data/lib/slack_web_api/exceptions/bots_info_error_schema_exception.rb +56 -0
  87. data/lib/slack_web_api/exceptions/chat_delete_error_schema_exception.rb +56 -0
  88. data/lib/slack_web_api/exceptions/chat_delete_scheduled_message_error_schema_exception.rb +56 -0
  89. data/lib/slack_web_api/exceptions/chat_get_permalink_error_schema_exception.rb +56 -0
  90. data/lib/slack_web_api/exceptions/chat_me_message_error_schema_exception.rb +56 -0
  91. data/lib/slack_web_api/exceptions/chat_post_ephemeral_error_schema_exception.rb +56 -0
  92. data/lib/slack_web_api/exceptions/chat_post_message_error_schema_exception.rb +56 -0
  93. data/lib/slack_web_api/exceptions/chat_schedule_message_error_schema_exception.rb +56 -0
  94. data/lib/slack_web_api/exceptions/chat_scheduled_messages_list_error_schema_exception.rb +56 -0
  95. data/lib/slack_web_api/exceptions/chat_unfurl_error_schema_exception.rb +56 -0
  96. data/lib/slack_web_api/exceptions/chat_update_error_schema_exception.rb +56 -0
  97. data/lib/slack_web_api/exceptions/conversations_archive_error_schema_exception.rb +67 -0
  98. data/lib/slack_web_api/exceptions/conversations_close_error_schema_exception.rb +67 -0
  99. data/lib/slack_web_api/exceptions/conversations_create_error_schema_exception.rb +73 -0
  100. data/lib/slack_web_api/exceptions/conversations_history_error_schema_exception.rb +67 -0
  101. data/lib/slack_web_api/exceptions/conversations_info_error_schema_exception.rb +67 -0
  102. data/lib/slack_web_api/exceptions/conversations_invite_error_schema1_exception.rb +82 -0
  103. data/lib/slack_web_api/exceptions/conversations_join_error_schema_exception.rb +67 -0
  104. data/lib/slack_web_api/exceptions/conversations_kick_error_schema_exception.rb +67 -0
  105. data/lib/slack_web_api/exceptions/conversations_leave_error_schema_exception.rb +67 -0
  106. data/lib/slack_web_api/exceptions/conversations_list_error_schema_exception.rb +67 -0
  107. data/lib/slack_web_api/exceptions/conversations_mark_error_schema_exception.rb +67 -0
  108. data/lib/slack_web_api/exceptions/conversations_members_error_schema_exception.rb +56 -0
  109. data/lib/slack_web_api/exceptions/conversations_open_error_schema_exception.rb +56 -0
  110. data/lib/slack_web_api/exceptions/conversations_rename_error_schema_exception.rb +67 -0
  111. data/lib/slack_web_api/exceptions/conversations_replies_error_schema_exception.rb +67 -0
  112. data/lib/slack_web_api/exceptions/conversations_set_purpose_error_schema_exception.rb +67 -0
  113. data/lib/slack_web_api/exceptions/conversations_set_topic_error_schema_exception.rb +67 -0
  114. data/lib/slack_web_api/exceptions/conversations_unarchive_error_schema_exception.rb +67 -0
  115. data/lib/slack_web_api/exceptions/default_error_template_exception.rb +47 -0
  116. data/lib/slack_web_api/exceptions/dialog_open_error_schema_exception.rb +56 -0
  117. data/lib/slack_web_api/exceptions/dnd_end_dnd_error_schema_exception.rb +56 -0
  118. data/lib/slack_web_api/exceptions/dnd_end_snooze_error_schema_exception.rb +56 -0
  119. data/lib/slack_web_api/exceptions/dnd_info_error_schema_exception.rb +56 -0
  120. data/lib/slack_web_api/exceptions/dnd_set_snooze_error_schema_exception.rb +56 -0
  121. data/lib/slack_web_api/exceptions/files_comments_delete_error_schema_exception.rb +56 -0
  122. data/lib/slack_web_api/exceptions/files_delete_error_schema_exception.rb +56 -0
  123. data/lib/slack_web_api/exceptions/files_info_error_schema_exception.rb +56 -0
  124. data/lib/slack_web_api/exceptions/files_list_error_schema_exception.rb +56 -0
  125. data/lib/slack_web_api/exceptions/files_revoke_public_url_error_schema_exception.rb +56 -0
  126. data/lib/slack_web_api/exceptions/files_shared_public_url_error_schema_exception.rb +56 -0
  127. data/lib/slack_web_api/exceptions/files_upload_error_schema_exception.rb +56 -0
  128. data/lib/slack_web_api/exceptions/migration_exchange_error_schema_exception.rb +56 -0
  129. data/lib/slack_web_api/exceptions/oauth_provider_exception.rb +64 -0
  130. data/lib/slack_web_api/exceptions/pins_add_error_schema_exception.rb +56 -0
  131. data/lib/slack_web_api/exceptions/pins_list_error_schema_exception.rb +56 -0
  132. data/lib/slack_web_api/exceptions/pins_remove_error_schema_exception.rb +56 -0
  133. data/lib/slack_web_api/exceptions/reactions_add_error_schema_exception.rb +56 -0
  134. data/lib/slack_web_api/exceptions/reactions_get_error_schema_exception.rb +56 -0
  135. data/lib/slack_web_api/exceptions/reactions_list_error_schema_exception.rb +56 -0
  136. data/lib/slack_web_api/exceptions/reactions_remove_error_schema_exception.rb +56 -0
  137. data/lib/slack_web_api/exceptions/reminders_add_error_schema_exception.rb +56 -0
  138. data/lib/slack_web_api/exceptions/reminders_complete_error_schema_exception.rb +56 -0
  139. data/lib/slack_web_api/exceptions/reminders_delete_error_schema_exception.rb +56 -0
  140. data/lib/slack_web_api/exceptions/reminders_info_error_schema_exception.rb +56 -0
  141. data/lib/slack_web_api/exceptions/reminders_list_error_schema_exception.rb +56 -0
  142. data/lib/slack_web_api/exceptions/rtm_connect_error_schema_exception.rb +56 -0
  143. data/lib/slack_web_api/exceptions/stars_add_error_schema_exception.rb +56 -0
  144. data/lib/slack_web_api/exceptions/stars_list_error_schema_exception.rb +56 -0
  145. data/lib/slack_web_api/exceptions/stars_remove_error_schema_exception.rb +56 -0
  146. data/lib/slack_web_api/exceptions/team_access_logs_error_schema_exception.rb +56 -0
  147. data/lib/slack_web_api/exceptions/team_info_error_schema_exception.rb +56 -0
  148. data/lib/slack_web_api/exceptions/team_integration_logs_error_schema_exception.rb +56 -0
  149. data/lib/slack_web_api/exceptions/team_profile_get_error_schema_exception.rb +56 -0
  150. data/lib/slack_web_api/exceptions/usergroups_create_error_schema_exception.rb +56 -0
  151. data/lib/slack_web_api/exceptions/usergroups_disable_error_schema_exception.rb +56 -0
  152. data/lib/slack_web_api/exceptions/usergroups_enable_error_schema_exception.rb +56 -0
  153. data/lib/slack_web_api/exceptions/usergroups_list_error_schema_exception.rb +56 -0
  154. data/lib/slack_web_api/exceptions/usergroups_update_error_schema_exception.rb +56 -0
  155. data/lib/slack_web_api/exceptions/usergroups_users_list_error_schema_exception.rb +56 -0
  156. data/lib/slack_web_api/exceptions/usergroups_users_update_error_schema_exception.rb +56 -0
  157. data/lib/slack_web_api/exceptions/users_conversations_error_schema_exception.rb +56 -0
  158. data/lib/slack_web_api/exceptions/users_counts_error_schema_exception.rb +50 -0
  159. data/lib/slack_web_api/exceptions/users_delete_photo_error_schema_exception.rb +56 -0
  160. data/lib/slack_web_api/exceptions/users_identity_error_schema_exception.rb +56 -0
  161. data/lib/slack_web_api/exceptions/users_info_error_schema_exception.rb +56 -0
  162. data/lib/slack_web_api/exceptions/users_list_error_schema_exception.rb +56 -0
  163. data/lib/slack_web_api/exceptions/users_lookup_by_email_error_schema_exception.rb +56 -0
  164. data/lib/slack_web_api/exceptions/users_profile_get_error_schema_exception.rb +56 -0
  165. data/lib/slack_web_api/exceptions/users_profile_set_error_schema_exception.rb +56 -0
  166. data/lib/slack_web_api/exceptions/users_set_active_error_schema_exception.rb +56 -0
  167. data/lib/slack_web_api/exceptions/users_set_photo_error_schema_exception.rb +73 -0
  168. data/lib/slack_web_api/exceptions/users_set_presence_error_schema_exception.rb +56 -0
  169. data/lib/slack_web_api/http/api_response.rb +19 -0
  170. data/lib/slack_web_api/http/auth/oauth_2.rb +162 -0
  171. data/lib/slack_web_api/http/http_call_back.rb +10 -0
  172. data/lib/slack_web_api/http/http_method_enum.rb +10 -0
  173. data/lib/slack_web_api/http/http_request.rb +10 -0
  174. data/lib/slack_web_api/http/http_response.rb +10 -0
  175. data/lib/slack_web_api/http/proxy_settings.rb +22 -0
  176. data/lib/slack_web_api/logging/configuration/api_logging_configuration.rb +186 -0
  177. data/lib/slack_web_api/logging/sdk_logger.rb +17 -0
  178. data/lib/slack_web_api/models/admin_conversations_archive_schema.rb +71 -0
  179. data/lib/slack_web_api/models/admin_conversations_convert_to_private_schema.rb +71 -0
  180. data/lib/slack_web_api/models/admin_conversations_create_schema.rb +82 -0
  181. data/lib/slack_web_api/models/admin_conversations_delete_schema.rb +71 -0
  182. data/lib/slack_web_api/models/admin_conversations_get_conversation_prefs_schema.rb +82 -0
  183. data/lib/slack_web_api/models/admin_conversations_get_teams_schema.rb +92 -0
  184. data/lib/slack_web_api/models/admin_conversations_invite_schema.rb +71 -0
  185. data/lib/slack_web_api/models/admin_conversations_rename_schema.rb +71 -0
  186. data/lib/slack_web_api/models/admin_conversations_rename_schema1.rb +71 -0
  187. data/lib/slack_web_api/models/admin_conversations_search_schema.rb +91 -0
  188. data/lib/slack_web_api/models/admin_conversations_set_conversation_prefs_schema.rb +71 -0
  189. data/lib/slack_web_api/models/admin_conversations_unarchive_schema.rb +71 -0
  190. data/lib/slack_web_api/models/api_method_users_get_presence.rb +133 -0
  191. data/lib/slack_web_api/models/api_permissions_scopes_list_success_schema.rb +80 -0
  192. data/lib/slack_web_api/models/api_test_success_schema.rb +71 -0
  193. data/lib/slack_web_api/models/app_home.rb +86 -0
  194. data/lib/slack_web_api/models/apps_permissions_info_schema.rb +80 -0
  195. data/lib/slack_web_api/models/apps_permissions_request_schema.rb +71 -0
  196. data/lib/slack_web_api/models/apps_permissions_resources_list_success_schema.rb +101 -0
  197. data/lib/slack_web_api/models/apps_uninstall_schema.rb +71 -0
  198. data/lib/slack_web_api/models/attachment.rb +125 -0
  199. data/lib/slack_web_api/models/auth_revoke_schema.rb +80 -0
  200. data/lib/slack_web_api/models/auth_test_success_schema.rb +136 -0
  201. data/lib/slack_web_api/models/base_model.rb +110 -0
  202. data/lib/slack_web_api/models/block_kit_block.rb +72 -0
  203. data/lib/slack_web_api/models/bot.rb +128 -0
  204. data/lib/slack_web_api/models/bot_profile_object.rb +126 -0
  205. data/lib/slack_web_api/models/bots_info_schema.rb +80 -0
  206. data/lib/slack_web_api/models/can_thread.rb +85 -0
  207. data/lib/slack_web_api/models/channel.rb +86 -0
  208. data/lib/slack_web_api/models/channel_object.rb +382 -0
  209. data/lib/slack_web_api/models/chat_delete_scheduled_message_schema.rb +71 -0
  210. data/lib/slack_web_api/models/chat_delete_success_schema.rb +88 -0
  211. data/lib/slack_web_api/models/chat_get_permalink_success_schema.rb +88 -0
  212. data/lib/slack_web_api/models/chat_me_message_schema.rb +91 -0
  213. data/lib/slack_web_api/models/chat_post_ephemeral_success_schema.rb +80 -0
  214. data/lib/slack_web_api/models/chat_post_message_success_schema.rb +96 -0
  215. data/lib/slack_web_api/models/chat_schedule_message_success_schema.rb +108 -0
  216. data/lib/slack_web_api/models/chat_scheduled_messages_list_schema.rb +100 -0
  217. data/lib/slack_web_api/models/chat_unfurl_success_schema.rb +71 -0
  218. data/lib/slack_web_api/models/chat_update_success_schema.rb +105 -0
  219. data/lib/slack_web_api/models/conversations_archive_success_schema.rb +71 -0
  220. data/lib/slack_web_api/models/conversations_close_success_schema.rb +93 -0
  221. data/lib/slack_web_api/models/conversations_create_success_schema.rb +80 -0
  222. data/lib/slack_web_api/models/conversations_history_success_schema.rb +127 -0
  223. data/lib/slack_web_api/models/conversations_info_success_schema.rb +80 -0
  224. data/lib/slack_web_api/models/conversations_invite_error_schema.rb +80 -0
  225. data/lib/slack_web_api/models/conversations_join_success_schema.rb +102 -0
  226. data/lib/slack_web_api/models/conversations_kick_success_schema.rb +71 -0
  227. data/lib/slack_web_api/models/conversations_leave_success_schema.rb +83 -0
  228. data/lib/slack_web_api/models/conversations_list_success_schema.rb +92 -0
  229. data/lib/slack_web_api/models/conversations_mark_success_schema.rb +71 -0
  230. data/lib/slack_web_api/models/conversations_members_success_schema.rb +89 -0
  231. data/lib/slack_web_api/models/conversations_open_success_schema.rb +102 -0
  232. data/lib/slack_web_api/models/conversations_rename_success_schema.rb +80 -0
  233. data/lib/slack_web_api/models/conversations_replies_success_schema.rb +90 -0
  234. data/lib/slack_web_api/models/conversations_set_purpose_success_schema.rb +80 -0
  235. data/lib/slack_web_api/models/conversations_set_topic_success_schema.rb +80 -0
  236. data/lib/slack_web_api/models/conversations_unarchive_success_schema.rb +71 -0
  237. data/lib/slack_web_api/models/current.rb +82 -0
  238. data/lib/slack_web_api/models/default_success_template.rb +72 -0
  239. data/lib/slack_web_api/models/dialog_open_schema.rb +71 -0
  240. data/lib/slack_web_api/models/dnd_end_dnd_schema.rb +71 -0
  241. data/lib/slack_web_api/models/dnd_end_snooze_schema.rb +111 -0
  242. data/lib/slack_web_api/models/dnd_info_schema.rb +136 -0
  243. data/lib/slack_web_api/models/dnd_set_snooze_schema.rb +102 -0
  244. data/lib/slack_web_api/models/error.rb +60 -0
  245. data/lib/slack_web_api/models/error1.rb +65 -0
  246. data/lib/slack_web_api/models/error10.rb +60 -0
  247. data/lib/slack_web_api/models/error11.rb +60 -0
  248. data/lib/slack_web_api/models/error12.rb +104 -0
  249. data/lib/slack_web_api/models/error13.rb +120 -0
  250. data/lib/slack_web_api/models/error14.rb +108 -0
  251. data/lib/slack_web_api/models/error16.rb +116 -0
  252. data/lib/slack_web_api/models/error17.rb +100 -0
  253. data/lib/slack_web_api/models/error18.rb +84 -0
  254. data/lib/slack_web_api/models/error19.rb +104 -0
  255. data/lib/slack_web_api/models/error2.rb +60 -0
  256. data/lib/slack_web_api/models/error20.rb +112 -0
  257. data/lib/slack_web_api/models/error21.rb +120 -0
  258. data/lib/slack_web_api/models/error22.rb +108 -0
  259. data/lib/slack_web_api/models/error23.rb +124 -0
  260. data/lib/slack_web_api/models/error24.rb +128 -0
  261. data/lib/slack_web_api/models/error25.rb +92 -0
  262. data/lib/slack_web_api/models/error26.rb +166 -0
  263. data/lib/slack_web_api/models/error27.rb +112 -0
  264. data/lib/slack_web_api/models/error28.rb +120 -0
  265. data/lib/slack_web_api/models/error29.rb +128 -0
  266. data/lib/slack_web_api/models/error3.rb +60 -0
  267. data/lib/slack_web_api/models/error30.rb +133 -0
  268. data/lib/slack_web_api/models/error31.rb +101 -0
  269. data/lib/slack_web_api/models/error32.rb +133 -0
  270. data/lib/slack_web_api/models/error33.rb +96 -0
  271. data/lib/slack_web_api/models/error34.rb +92 -0
  272. data/lib/slack_web_api/models/error35.rb +153 -0
  273. data/lib/slack_web_api/models/error37.rb +121 -0
  274. data/lib/slack_web_api/models/error38.rb +121 -0
  275. data/lib/slack_web_api/models/error39.rb +129 -0
  276. data/lib/slack_web_api/models/error4.rb +80 -0
  277. data/lib/slack_web_api/models/error40.rb +84 -0
  278. data/lib/slack_web_api/models/error41.rb +105 -0
  279. data/lib/slack_web_api/models/error42.rb +100 -0
  280. data/lib/slack_web_api/models/error43.rb +121 -0
  281. data/lib/slack_web_api/models/error44.rb +129 -0
  282. data/lib/slack_web_api/models/error45.rb +96 -0
  283. data/lib/slack_web_api/models/error46.rb +113 -0
  284. data/lib/slack_web_api/models/error48.rb +121 -0
  285. data/lib/slack_web_api/models/error49.rb +136 -0
  286. data/lib/slack_web_api/models/error5.rb +60 -0
  287. data/lib/slack_web_api/models/error50.rb +108 -0
  288. data/lib/slack_web_api/models/error51.rb +112 -0
  289. data/lib/slack_web_api/models/error52.rb +104 -0
  290. data/lib/slack_web_api/models/error53.rb +116 -0
  291. data/lib/slack_web_api/models/error54.rb +92 -0
  292. data/lib/slack_web_api/models/error55.rb +100 -0
  293. data/lib/slack_web_api/models/error56.rb +100 -0
  294. data/lib/slack_web_api/models/error57.rb +100 -0
  295. data/lib/slack_web_api/models/error58.rb +112 -0
  296. data/lib/slack_web_api/models/error59.rb +116 -0
  297. data/lib/slack_web_api/models/error6.rb +60 -0
  298. data/lib/slack_web_api/models/error60.rb +108 -0
  299. data/lib/slack_web_api/models/error61.rb +108 -0
  300. data/lib/slack_web_api/models/error62.rb +120 -0
  301. data/lib/slack_web_api/models/error63.rb +92 -0
  302. data/lib/slack_web_api/models/error64.rb +116 -0
  303. data/lib/slack_web_api/models/error65.rb +116 -0
  304. data/lib/slack_web_api/models/error66.rb +104 -0
  305. data/lib/slack_web_api/models/error67.rb +96 -0
  306. data/lib/slack_web_api/models/error68.rb +120 -0
  307. data/lib/slack_web_api/models/error69.rb +128 -0
  308. data/lib/slack_web_api/models/error7.rb +56 -0
  309. data/lib/slack_web_api/models/error70.rb +116 -0
  310. data/lib/slack_web_api/models/error71.rb +108 -0
  311. data/lib/slack_web_api/models/error74.rb +96 -0
  312. data/lib/slack_web_api/models/error75.rb +128 -0
  313. data/lib/slack_web_api/models/error77.rb +128 -0
  314. data/lib/slack_web_api/models/error78.rb +112 -0
  315. data/lib/slack_web_api/models/error8.rb +56 -0
  316. data/lib/slack_web_api/models/error81.rb +92 -0
  317. data/lib/slack_web_api/models/error82.rb +112 -0
  318. data/lib/slack_web_api/models/error84.rb +116 -0
  319. data/lib/slack_web_api/models/error86.rb +120 -0
  320. data/lib/slack_web_api/models/error89.rb +117 -0
  321. data/lib/slack_web_api/models/error9.rb +68 -0
  322. data/lib/slack_web_api/models/error92.rb +92 -0
  323. data/lib/slack_web_api/models/error93.rb +100 -0
  324. data/lib/slack_web_api/models/error94.rb +100 -0
  325. data/lib/slack_web_api/models/error95.rb +108 -0
  326. data/lib/slack_web_api/models/error96.rb +128 -0
  327. data/lib/slack_web_api/models/error97.rb +100 -0
  328. data/lib/slack_web_api/models/error98.rb +120 -0
  329. data/lib/slack_web_api/models/error99.rb +104 -0
  330. data/lib/slack_web_api/models/errors_is_returned_when_an_error_associates_an_user.rb +90 -0
  331. data/lib/slack_web_api/models/external_org_migrations.rb +91 -0
  332. data/lib/slack_web_api/models/file_comment_object.rb +176 -0
  333. data/lib/slack_web_api/models/file_object.rb +790 -0
  334. data/lib/slack_web_api/models/files_comments_delete_schema.rb +71 -0
  335. data/lib/slack_web_api/models/files_delete_schema.rb +71 -0
  336. data/lib/slack_web_api/models/files_info_schema.rb +133 -0
  337. data/lib/slack_web_api/models/files_list_schema.rb +97 -0
  338. data/lib/slack_web_api/models/files_revoke_public_url_schema.rb +80 -0
  339. data/lib/slack_web_api/models/files_shared_public_url_schema.rb +80 -0
  340. data/lib/slack_web_api/models/files_upload_schema.rb +80 -0
  341. data/lib/slack_web_api/models/group.rb +86 -0
  342. data/lib/slack_web_api/models/icons.rb +90 -0
  343. data/lib/slack_web_api/models/icons1.rb +85 -0
  344. data/lib/slack_web_api/models/im.rb +86 -0
  345. data/lib/slack_web_api/models/info.rb +116 -0
  346. data/lib/slack_web_api/models/log.rb +168 -0
  347. data/lib/slack_web_api/models/login.rb +158 -0
  348. data/lib/slack_web_api/models/message.rb +128 -0
  349. data/lib/slack_web_api/models/message_object.rb +552 -0
  350. data/lib/slack_web_api/models/message_object1.rb +94 -0
  351. data/lib/slack_web_api/models/migration_exchange_success_schema.rb +111 -0
  352. data/lib/slack_web_api/models/mpim.rb +86 -0
  353. data/lib/slack_web_api/models/mself.rb +82 -0
  354. data/lib/slack_web_api/models/oauth_provider_error.rb +62 -0
  355. data/lib/slack_web_api/models/oauth_scope.rb +296 -0
  356. data/lib/slack_web_api/models/oauth_token.rb +96 -0
  357. data/lib/slack_web_api/models/objs_enterprise_user.rb +119 -0
  358. data/lib/slack_web_api/models/objs_icon.rb +147 -0
  359. data/lib/slack_web_api/models/objs_primary_owner.rb +82 -0
  360. data/lib/slack_web_api/models/objs_reminder.rb +129 -0
  361. data/lib/slack_web_api/models/objs_team_profile_field.rb +154 -0
  362. data/lib/slack_web_api/models/objs_team_profile_field_option.rb +112 -0
  363. data/lib/slack_web_api/models/objs_user_profile_short.rb +174 -0
  364. data/lib/slack_web_api/models/paging_object.rb +121 -0
  365. data/lib/slack_web_api/models/pins_add_schema.rb +71 -0
  366. data/lib/slack_web_api/models/pins_remove_schema.rb +71 -0
  367. data/lib/slack_web_api/models/plan.rb +44 -0
  368. data/lib/slack_web_api/models/prefs.rb +82 -0
  369. data/lib/slack_web_api/models/prefs1.rb +86 -0
  370. data/lib/slack_web_api/models/profile.rb +82 -0
  371. data/lib/slack_web_api/models/profile1.rb +146 -0
  372. data/lib/slack_web_api/models/purpose.rb +90 -0
  373. data/lib/slack_web_api/models/reaction_object.rb +90 -0
  374. data/lib/slack_web_api/models/reactions_add_schema.rb +71 -0
  375. data/lib/slack_web_api/models/reactions_list_schema.rb +102 -0
  376. data/lib/slack_web_api/models/reactions_remove_schema.rb +71 -0
  377. data/lib/slack_web_api/models/reminders_add_schema.rb +80 -0
  378. data/lib/slack_web_api/models/reminders_complete_schema.rb +71 -0
  379. data/lib/slack_web_api/models/reminders_delete_schema.rb +71 -0
  380. data/lib/slack_web_api/models/reminders_info_schema.rb +80 -0
  381. data/lib/slack_web_api/models/reminders_list_schema.rb +89 -0
  382. data/lib/slack_web_api/models/resource.rb +85 -0
  383. data/lib/slack_web_api/models/resources_in_info_from_apps_permissions_info.rb +94 -0
  384. data/lib/slack_web_api/models/response_metadata.rb +74 -0
  385. data/lib/slack_web_api/models/response_metadata3.rb +75 -0
  386. data/lib/slack_web_api/models/rtm_connect_schema.rb +96 -0
  387. data/lib/slack_web_api/models/scheduled_message.rb +110 -0
  388. data/lib/slack_web_api/models/scopes.rb +134 -0
  389. data/lib/slack_web_api/models/shares.rb +85 -0
  390. data/lib/slack_web_api/models/sso_provider.rb +95 -0
  391. data/lib/slack_web_api/models/stars_add_schema.rb +71 -0
  392. data/lib/slack_web_api/models/stars_list_schema.rb +90 -0
  393. data/lib/slack_web_api/models/stars_remove_schema.rb +71 -0
  394. data/lib/slack_web_api/models/subteam_usergroup_object.rb +260 -0
  395. data/lib/slack_web_api/models/team.rb +83 -0
  396. data/lib/slack_web_api/models/team1.rb +90 -0
  397. data/lib/slack_web_api/models/team_access_logs_schema.rb +97 -0
  398. data/lib/slack_web_api/models/team_info_schema.rb +80 -0
  399. data/lib/slack_web_api/models/team_integration_logs_schema.rb +97 -0
  400. data/lib/slack_web_api/models/team_object.rb +368 -0
  401. data/lib/slack_web_api/models/team_profile_get_success_schema.rb +80 -0
  402. data/lib/slack_web_api/models/topic.rb +90 -0
  403. data/lib/slack_web_api/models/type.rb +52 -0
  404. data/lib/slack_web_api/models/user_profile_object.rb +542 -0
  405. data/lib/slack_web_api/models/usergroups_create_schema.rb +80 -0
  406. data/lib/slack_web_api/models/usergroups_disable_schema.rb +80 -0
  407. data/lib/slack_web_api/models/usergroups_enable_schema.rb +80 -0
  408. data/lib/slack_web_api/models/usergroups_list_schema.rb +89 -0
  409. data/lib/slack_web_api/models/usergroups_update_schema.rb +80 -0
  410. data/lib/slack_web_api/models/usergroups_users_list_schema.rb +80 -0
  411. data/lib/slack_web_api/models/usergroups_users_update_schema.rb +80 -0
  412. data/lib/slack_web_api/models/users_conversations_success_schema.rb +93 -0
  413. data/lib/slack_web_api/models/users_delete_photo_schema.rb +71 -0
  414. data/lib/slack_web_api/models/users_info_success_schema.rb +80 -0
  415. data/lib/slack_web_api/models/users_list_schema.rb +102 -0
  416. data/lib/slack_web_api/models/users_lookup_by_email_success_schema.rb +80 -0
  417. data/lib/slack_web_api/models/users_profile_get_schema.rb +80 -0
  418. data/lib/slack_web_api/models/users_profile_set_schema.rb +100 -0
  419. data/lib/slack_web_api/models/users_set_active_schema.rb +71 -0
  420. data/lib/slack_web_api/models/users_set_photo_schema.rb +80 -0
  421. data/lib/slack_web_api/models/users_set_presence_schema.rb +71 -0
  422. data/lib/slack_web_api/models/who_can_post.rb +85 -0
  423. data/lib/slack_web_api/utilities/date_time_helper.rb +11 -0
  424. data/lib/slack_web_api/utilities/file_wrapper.rb +28 -0
  425. data/lib/slack_web_api.rb +532 -0
  426. metadata +509 -0
@@ -0,0 +1,19 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Http response received.
8
+ class ApiResponse < CoreLibrary::ApiResponse
9
+ # The constructor
10
+ # @param [HttpResponse] http_response The original, raw response from the api.
11
+ # @param [Object] data The data field specified for the response.
12
+ # @param [Array<String>] errors Any errors returned by the server.
13
+ def initialize(http_response,
14
+ data: nil,
15
+ errors: nil)
16
+ super
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,162 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Utility class for OAuth 2 authorization and token management.
8
+ class Oauth2 < CoreLibrary::HeaderAuth
9
+ include CoreLibrary
10
+ # Display error message on occurrence of authentication failure.
11
+ # @returns [String] The oAuth error message.
12
+ def error_message
13
+ 'AuthorizationCodeAuth: OAuthToken is undefined or expired.'
14
+ end
15
+
16
+ # Initialization constructor.
17
+ def initialize(authorization_code_auth_credentials, config)
18
+ auth_params = {}
19
+ @_oauth_client_id = authorization_code_auth_credentials.oauth_client_id unless
20
+ authorization_code_auth_credentials.nil? || authorization_code_auth_credentials.oauth_client_id.nil?
21
+ @_oauth_client_secret = authorization_code_auth_credentials.oauth_client_secret unless
22
+ authorization_code_auth_credentials.nil? || authorization_code_auth_credentials.oauth_client_secret.nil?
23
+ @_oauth_redirect_uri = authorization_code_auth_credentials.oauth_redirect_uri unless
24
+ authorization_code_auth_credentials.nil? || authorization_code_auth_credentials.oauth_redirect_uri.nil?
25
+ @_oauth_token = authorization_code_auth_credentials.oauth_token unless
26
+ authorization_code_auth_credentials.nil? || authorization_code_auth_credentials.oauth_token.nil?
27
+ @_oauth_scopes = authorization_code_auth_credentials.oauth_scopes unless
28
+ authorization_code_auth_credentials.nil? || authorization_code_auth_credentials.oauth_scopes.nil?
29
+ @_config = config
30
+ @_o_auth_api = OauthAuthorizationController.new(config)
31
+ auth_params[:Authorization] = "Bearer #{@_oauth_token.access_token}" unless @_oauth_token.nil?
32
+
33
+ super auth_params
34
+ end
35
+
36
+ # Validates the oAuth token.
37
+ # @return [Boolean] true if the token is present and not expired.
38
+ def valid
39
+ !@_oauth_token.nil? && !token_expired?(@_oauth_token)
40
+ end
41
+
42
+ # Builds and returns an authorization URL.
43
+ # The user is expected to obtain an authorization code from this URL and then call the
44
+ # fetch token function with that authorization code.
45
+ # @param [String] state An opaque state string.
46
+ # @param [Hash] additional_params Any additional query parameters to be added to the URL.
47
+ # @return [String] The authorization URL.
48
+ def get_authorization_url(state: nil, additional_params: nil)
49
+ auth_url = @_config.get_base_uri_executor.call(Server::AUTH_SERVER)
50
+ auth_url += '/authorize'
51
+ query_params = {
52
+ 'response_type' => 'code',
53
+ 'client_id' => @_oauth_client_id,
54
+ 'redirect_uri' => @_oauth_redirect_uri
55
+ }
56
+ query_params['scope'] = Array(@_o_auth_scopes).compact.join(' ') if @_o_auth_scopes
57
+ query_params['state'] = state if state
58
+ query_params.merge!(additional_params) if additional_params
59
+ auth_url = APIHelper.append_url_with_query_parameters(auth_url,
60
+ query_params)
61
+ APIHelper.clean_url(auth_url)
62
+ end
63
+
64
+ # Builds the basic auth header for endpoints in the OAuth Authorization Controller.
65
+ # @return [String] The value of the Authentication header.
66
+ def build_basic_auth_header
67
+ "Basic #{AuthHelper.get_base64_encoded_value(@_oauth_client_id, @_oauth_client_secret)}"
68
+ end
69
+
70
+ # Fetches the token.
71
+ # @param [String] auth_code The authentication code.
72
+ # @param [Hash] additional_params Any additional form parameters.
73
+ # @return [OAuthToken] The oAuth token instance.
74
+ def fetch_token(auth_code, additional_params: nil)
75
+ token = @_o_auth_api.request_token(
76
+ build_basic_auth_header,
77
+ auth_code,
78
+ @_oauth_redirect_uri,
79
+ _field_parameters: additional_params
80
+ ).data
81
+ if token.respond_to?('expires_in') && !token.expires_in.nil?
82
+ token.expiry = AuthHelper.get_token_expiry(token.expires_in, Time.now.utc.to_i)
83
+ end
84
+ token
85
+ end
86
+
87
+ # Checks if OAuth token has expired.
88
+ # @param [OAuthToken] token The oAuth token instance.
89
+ # @return [Boolean] true if the token is present and not expired.
90
+ def token_expired?(token)
91
+ token.respond_to?('expiry') && AuthHelper.token_expired?(token.expiry)
92
+ end
93
+
94
+ # Refreshes OAuth token.
95
+ # @param [Hash] additional_params Any additional form parameters.
96
+ # @return [OAuthToken] The oAuth token instance.
97
+ def refresh_token(additional_params: nil)
98
+ token = @_o_auth_api.refresh_token(
99
+ build_basic_auth_header,
100
+ @_oauth_token.refresh_token,
101
+ scope: !@_oauth_scopes.nil? ? Array(@_oauth_scopes).compact.join(' ') : nil,
102
+ _field_parameters: additional_params
103
+ ).data
104
+ if token.respond_to?('expires_in') && !token.expires_in.nil?
105
+ token.expiry = AuthHelper.get_token_expiry(token.expires_in, Time.now.utc.to_i)
106
+ end
107
+ token
108
+ end
109
+ end
110
+
111
+ # Data class for AuthorizationCodeAuthCredentials.
112
+ class AuthorizationCodeAuthCredentials
113
+ attr_reader :oauth_client_id, :oauth_client_secret, :oauth_redirect_uri,
114
+ :oauth_token, :oauth_scopes
115
+
116
+ def initialize(oauth_client_id:, oauth_client_secret:, oauth_redirect_uri:,
117
+ oauth_token: nil, oauth_scopes: nil)
118
+ raise ArgumentError, 'oauth_client_id cannot be nil' if oauth_client_id.nil?
119
+ raise ArgumentError, 'oauth_client_secret cannot be nil' if oauth_client_secret.nil?
120
+ raise ArgumentError, 'oauth_redirect_uri cannot be nil' if oauth_redirect_uri.nil?
121
+
122
+ @oauth_client_id = oauth_client_id
123
+ @oauth_client_secret = oauth_client_secret
124
+ @oauth_redirect_uri = oauth_redirect_uri
125
+ @oauth_token = oauth_token
126
+ @oauth_scopes = oauth_scopes
127
+ end
128
+
129
+ def self.from_env
130
+ oauth_client_id = ENV['OAUTH_CLIENT_ID']
131
+ oauth_client_secret = ENV['OAUTH_CLIENT_SECRET']
132
+ oauth_redirect_uri = ENV['OAUTH_REDIRECT_URI']
133
+ oauth_scopes = ENV['OAUTH_SCOPES']
134
+ all_nil = [
135
+ oauth_client_id,
136
+ oauth_client_secret,
137
+ oauth_redirect_uri
138
+ ].all?(&:nil?)
139
+ return nil if all_nil
140
+
141
+ new(oauth_client_id: oauth_client_id,
142
+ oauth_client_secret: oauth_client_secret,
143
+ oauth_redirect_uri: oauth_redirect_uri, oauth_scopes: oauth_scopes)
144
+ end
145
+
146
+ def clone_with(oauth_client_id: nil, oauth_client_secret: nil,
147
+ oauth_redirect_uri: nil, oauth_token: nil, oauth_scopes: nil)
148
+ oauth_client_id ||= self.oauth_client_id
149
+ oauth_client_secret ||= self.oauth_client_secret
150
+ oauth_redirect_uri ||= self.oauth_redirect_uri
151
+ oauth_token ||= self.oauth_token
152
+ oauth_scopes ||= self.oauth_scopes
153
+
154
+ AuthorizationCodeAuthCredentials.new(
155
+ oauth_client_id: oauth_client_id,
156
+ oauth_client_secret: oauth_client_secret,
157
+ oauth_redirect_uri: oauth_redirect_uri, oauth_token: oauth_token,
158
+ oauth_scopes: oauth_scopes
159
+ )
160
+ end
161
+ end
162
+ end
@@ -0,0 +1,10 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # HttpCallBack allows defining callables for pre and post API calls.
8
+ class HttpCallBack < CoreLibrary::HttpCallback
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # HTTP Methods Enumeration.
8
+ class HttpMethodEnum < CoreLibrary::HttpMethod
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Represents a single Http Request.
8
+ class HttpRequest < CoreLibrary::HttpRequest
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Http response received.
8
+ class HttpResponse < CoreLibrary::HttpResponse
9
+ end
10
+ end
@@ -0,0 +1,22 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ ##
8
+ # ProxySettings encapsulates HTTP proxy configuration for Faraday,
9
+ # including optional basic authentication.
10
+ #
11
+ class ProxySettings < CoreLibrary::ProxySettings
12
+ def self.from_env
13
+ address = ENV['PROXY_ADDRESS']
14
+ port = ENV['PROXY_PORT']
15
+ username = ENV['PROXY_USERNAME']
16
+ password = ENV['PROXY_PASSWORD']
17
+ return nil if address.nil? || address.strip.empty?
18
+
19
+ new(address: address, port: port, username: username, password: password)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,186 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Initializes a new instance of RequestLoggingConfiguration.
8
+ class RequestLoggingConfiguration < CoreLibrary::ApiRequestLoggingConfiguration
9
+ # @param log_body [Boolean] Indicates whether the message body should be logged. Default is false.
10
+ # @param log_headers [Boolean] Indicates whether the message headers should be logged. Default is false.
11
+ # @param headers_to_exclude [Array<String>] Array of headers not displayed in logging. Default is an empty array.
12
+ # @param headers_to_include [Array<String>] Array of headers to be displayed in logging. Default is an empty array.
13
+ # @param headers_to_unmask [Array<String>] Array of headers which values are non-sensitive to display in logging.
14
+ # Default is an empty array.
15
+ def initialize(log_body: false, log_headers: false, headers_to_include: nil,
16
+ headers_to_exclude: nil, headers_to_unmask: nil,
17
+ include_query_in_path: false)
18
+ super(
19
+ log_body,
20
+ log_headers,
21
+ headers_to_exclude,
22
+ headers_to_include,
23
+ headers_to_unmask,
24
+ include_query_in_path
25
+ )
26
+ end
27
+
28
+ def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
29
+ headers_to_exclude: nil, headers_to_unmask: nil, include_query_in_path: nil)
30
+ log_body ||= self.log_body
31
+ log_headers ||= self.log_headers
32
+ headers_to_include ||= self.headers_to_include
33
+ headers_to_exclude ||= self.headers_to_exclude
34
+ headers_to_unmask ||= self.headers_to_unmask
35
+ include_query_in_path ||= self.include_query_in_path
36
+
37
+ RequestLoggingConfiguration.new(
38
+ log_body: log_body,
39
+ log_headers: log_headers,
40
+ headers_to_include: headers_to_include,
41
+ headers_to_exclude: headers_to_exclude,
42
+ headers_to_unmask: headers_to_unmask,
43
+ include_query_in_path: include_query_in_path
44
+ )
45
+ end
46
+
47
+ def self.from_env
48
+ log_body = ENV['REQUEST_LOG_BODY']
49
+ log_headers = ENV['REQUEST_LOG_HEADERS']
50
+ headers_to_include = ENV['REQUEST_HEADERS_TO_INCLUDE']
51
+ headers_to_exclude = ENV['REQUEST_HEADERS_TO_EXCLUDE']
52
+ headers_to_unmask = ENV['REQUEST_HEADERS_TO_UNMASK']
53
+ include_query_in_path = ENV['REQUEST_INCLUDE_QUERY_IN_PATH']
54
+
55
+ new(
56
+ log_body: log_body,
57
+ log_headers: log_headers,
58
+ headers_to_include: headers_to_include,
59
+ headers_to_exclude: headers_to_exclude,
60
+ headers_to_unmask: headers_to_unmask,
61
+ include_query_in_path: include_query_in_path
62
+ )
63
+ end
64
+
65
+ def self.any_logging_configured?
66
+ %w[
67
+ REQUEST_LOG_BODY
68
+ REQUEST_LOG_HEADERS
69
+ REQUEST_HEADERS_TO_INCLUDE
70
+ REQUEST_HEADERS_TO_EXCLUDE
71
+ REQUEST_HEADERS_TO_UNMASK
72
+ REQUEST_INCLUDE_QUERY_IN_PATH
73
+ ].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
74
+ end
75
+ end
76
+
77
+ # Initializes a new instance of ResponseLoggingConfiguration.
78
+ class ResponseLoggingConfiguration < CoreLibrary::ApiResponseLoggingConfiguration
79
+ def initialize(log_body: false, log_headers: false, headers_to_include: nil,
80
+ headers_to_exclude: nil, headers_to_unmask: nil)
81
+ super(
82
+ log_body,
83
+ log_headers,
84
+ headers_to_exclude,
85
+ headers_to_include,
86
+ headers_to_unmask
87
+ )
88
+ end
89
+
90
+ def clone_with(log_body: nil, log_headers: nil, headers_to_include: nil,
91
+ headers_to_exclude: nil, headers_to_unmask: nil)
92
+ log_body ||= self.log_body
93
+ log_headers ||= self.log_headers
94
+ headers_to_include ||= self.headers_to_include
95
+ headers_to_exclude ||= self.headers_to_exclude
96
+ headers_to_unmask ||= self.headers_to_unmask
97
+
98
+ ResponseLoggingConfiguration.new(
99
+ log_body: log_body,
100
+ log_headers: log_headers,
101
+ headers_to_include: headers_to_include,
102
+ headers_to_exclude: headers_to_exclude,
103
+ headers_to_unmask: headers_to_unmask
104
+ )
105
+ end
106
+
107
+ def self.from_env
108
+ log_body = ENV['RESPONSE_LOG_BODY']
109
+ log_headers = ENV['RESPONSE_LOG_HEADERS']
110
+ headers_to_include = ENV['RESPONSE_HEADERS_TO_INCLUDE']
111
+ headers_to_exclude = ENV['RESPONSE_HEADERS_TO_EXCLUDE']
112
+ headers_to_unmask = ENV['RESPONSE_HEADERS_TO_UNMASK']
113
+
114
+ new(
115
+ log_body: log_body,
116
+ log_headers: log_headers,
117
+ headers_to_include: headers_to_include,
118
+ headers_to_exclude: headers_to_exclude,
119
+ headers_to_unmask: headers_to_unmask
120
+ )
121
+ end
122
+
123
+ def self.any_logging_configured?
124
+ %w[
125
+ RESPONSE_LOG_BODY
126
+ RESPONSE_LOG_HEADERS
127
+ RESPONSE_HEADERS_TO_INCLUDE
128
+ RESPONSE_HEADERS_TO_EXCLUDE
129
+ RESPONSE_HEADERS_TO_UNMASK
130
+ ].any? { |key| ENV.key?(key) && !ENV[key].nil? && !ENV[key].empty? }
131
+ end
132
+ end
133
+
134
+ # Initializes a new instance of LoggingConfiguration.
135
+ class LoggingConfiguration < CoreLibrary::ApiLoggingConfiguration
136
+ def initialize(logger: nil, log_level: nil, mask_sensitive_headers: true,
137
+ request_logging_config: nil,
138
+ response_logging_config: nil)
139
+ request_logging_config ||= RequestLoggingConfiguration.new
140
+ response_logging_config ||= ResponseLoggingConfiguration.new
141
+ super(
142
+ logger,
143
+ log_level,
144
+ request_logging_config,
145
+ response_logging_config,
146
+ mask_sensitive_headers
147
+ )
148
+ end
149
+
150
+ def clone_with(logger: nil, log_level: nil, mask_sensitive_headers: nil,
151
+ request_logging_config: nil, response_logging_config: nil)
152
+ logger ||= self.logger
153
+ log_level ||= self.log_level
154
+ mask_sensitive_headers ||= self.mask_sensitive_headers
155
+ request_logging_config ||= self.request_logging_config.clone
156
+ response_logging_config ||= self.response_logging_config.clone
157
+
158
+ LoggingConfiguration.new(
159
+ logger: logger,
160
+ log_level: log_level,
161
+ mask_sensitive_headers: mask_sensitive_headers,
162
+ request_logging_config: request_logging_config,
163
+ response_logging_config: response_logging_config
164
+ )
165
+ end
166
+
167
+ def self.from_env
168
+ log_level = ENV['LOG_LEVEL']
169
+ mask_sensitive_headers = ENV['MASK_SENSITIVE_HEADERS']
170
+
171
+ new(
172
+ log_level: log_level,
173
+ mask_sensitive_headers: mask_sensitive_headers,
174
+ request_logging_config: RequestLoggingConfiguration.from_env,
175
+ response_logging_config: ResponseLoggingConfiguration.from_env
176
+ )
177
+ end
178
+
179
+ def self.any_logging_configured?
180
+ RequestLoggingConfiguration.any_logging_configured? ||
181
+ ResponseLoggingConfiguration.any_logging_configured? ||
182
+ ENV.key?('LOG_LEVEL') ||
183
+ ENV.key?('MASK_SENSITIVE_HEADERS')
184
+ end
185
+ end
186
+ end
@@ -0,0 +1,17 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Represents the generic logger facade
8
+ class AbstractLogger < Logger
9
+ # Logs a message with a specified log level and additional parameters.
10
+ # @param level [Symbol] The log level of the message.
11
+ # @param message [String] The message to log.
12
+ # @param params [Hash] Additional parameters to include in the log message.
13
+ def log(level, message, params)
14
+ raise NotImplementedError, 'This method needs to be implemented in a child class.'
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,71 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Schema for successful response of admin.conversations.archive
8
+ class AdminConversationsArchiveSchema < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :ok
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['ok'] = 'ok'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @ok = 'True'
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ AdminConversationsArchiveSchema.new(additional_properties: additional_properties)
57
+ end
58
+
59
+ # Provides a human-readable string representation of the object.
60
+ def to_s
61
+ class_name = self.class.name.split('::').last
62
+ "<#{class_name} ok: #{@ok}, additional_properties: #{@additional_properties}>"
63
+ end
64
+
65
+ # Provides a debugging-friendly string with detailed object information.
66
+ def inspect
67
+ class_name = self.class.name.split('::').last
68
+ "<#{class_name} ok: #{@ok.inspect}, additional_properties: #{@additional_properties}>"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,71 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Schema for successful response of admin.conversations.convertToPrivate
8
+ class AdminConversationsConvertToPrivateSchema < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_reader :ok
15
+
16
+ # A mapping from model property names to API property names.
17
+ def self.names
18
+ @_hash = {} if @_hash.nil?
19
+ @_hash['ok'] = 'ok'
20
+ @_hash
21
+ end
22
+
23
+ # An array for optional fields
24
+ def self.optionals
25
+ []
26
+ end
27
+
28
+ # An array for nullable fields
29
+ def self.nullables
30
+ []
31
+ end
32
+
33
+ def initialize(additional_properties: nil)
34
+ # Add additional model properties to the instance
35
+ additional_properties = {} if additional_properties.nil?
36
+
37
+ @ok = 'True'
38
+ @additional_properties = additional_properties
39
+ end
40
+
41
+ # Creates an instance of the object from a hash.
42
+ def self.from_hash(hash)
43
+ return nil unless hash
44
+
45
+ # Extract variables from the hash.
46
+
47
+
48
+ # Create a new hash for additional properties, removing known properties.
49
+ new_hash = hash.reject { |k, _| names.value?(k) }
50
+
51
+ additional_properties = APIHelper.get_additional_properties(
52
+ new_hash, proc { |value| value }
53
+ )
54
+
55
+ # Create object from extracted values.
56
+ AdminConversationsConvertToPrivateSchema.new(additional_properties: additional_properties)
57
+ end
58
+
59
+ # Provides a human-readable string representation of the object.
60
+ def to_s
61
+ class_name = self.class.name.split('::').last
62
+ "<#{class_name} ok: #{@ok}, additional_properties: #{@additional_properties}>"
63
+ end
64
+
65
+ # Provides a debugging-friendly string with detailed object information.
66
+ def inspect
67
+ class_name = self.class.name.split('::').last
68
+ "<#{class_name} ok: #{@ok.inspect}, additional_properties: #{@additional_properties}>"
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,82 @@
1
+ # slack_web_api
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module SlackWebApi
7
+ # Schema for successful response of admin.conversations.create
8
+ class AdminConversationsCreateSchema < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [String]
14
+ attr_accessor :channel_id
15
+
16
+ # TODO: Write general description for this method
17
+ # @return [String]
18
+ attr_reader :ok
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['channel_id'] = 'channel_id'
24
+ @_hash['ok'] = 'ok'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ channel_id
32
+ ]
33
+ end
34
+
35
+ # An array for nullable fields
36
+ def self.nullables
37
+ []
38
+ end
39
+
40
+ def initialize(channel_id: SKIP, additional_properties: nil)
41
+ # Add additional model properties to the instance
42
+ additional_properties = {} if additional_properties.nil?
43
+
44
+ @channel_id = channel_id unless channel_id == SKIP
45
+ @ok = 'True'
46
+ @additional_properties = additional_properties
47
+ end
48
+
49
+ # Creates an instance of the object from a hash.
50
+ def self.from_hash(hash)
51
+ return nil unless hash
52
+
53
+ # Extract variables from the hash.
54
+ channel_id = hash.key?('channel_id') ? hash['channel_id'] : SKIP
55
+
56
+ # Create a new hash for additional properties, removing known properties.
57
+ new_hash = hash.reject { |k, _| names.value?(k) }
58
+
59
+ additional_properties = APIHelper.get_additional_properties(
60
+ new_hash, proc { |value| value }
61
+ )
62
+
63
+ # Create object from extracted values.
64
+ AdminConversationsCreateSchema.new(channel_id: channel_id,
65
+ additional_properties: additional_properties)
66
+ end
67
+
68
+ # Provides a human-readable string representation of the object.
69
+ def to_s
70
+ class_name = self.class.name.split('::').last
71
+ "<#{class_name} channel_id: #{@channel_id}, ok: #{@ok}, additional_properties:"\
72
+ " #{@additional_properties}>"
73
+ end
74
+
75
+ # Provides a debugging-friendly string with detailed object information.
76
+ def inspect
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} channel_id: #{@channel_id.inspect}, ok: #{@ok.inspect},"\
79
+ " additional_properties: #{@additional_properties}>"
80
+ end
81
+ end
82
+ end