Class: Slack::Webhook::V3
- Inherits:
-
Integration
- Object
- Integration
- Slack::Webhook::V3
- Defined in:
- app/models/pager_tree/integrations/slack/webhook/v3.rb
Constant Summary collapse
- OPTIONS =
[ {key: :token, type: :string, default: nil} ]
Instance Method Summary collapse
- #adapter_action ⇒ Object
- #adapter_incoming_can_defer? ⇒ Boolean
- #adapter_process_create ⇒ Object
- #adapter_should_block_incoming?(request) ⇒ Boolean
- #adapter_supports_incoming? ⇒ Boolean
- #adapter_supports_outgoing? ⇒ Boolean
- #adapter_thirdparty_id ⇒ Object
Instance Method Details
#adapter_action ⇒ Object
31 32 33 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 31 def adapter_action :create end |
#adapter_incoming_can_defer? ⇒ Boolean
23 24 25 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 23 def adapter_incoming_can_defer? true end |
#adapter_process_create ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 35 def adapter_process_create Alert.new( title: _title, urgency: _urgency, thirdparty_id: adapter_thirdparty_id, dedup_keys: [], additional_data: _additional_datums ) end |
#adapter_should_block_incoming?(request) ⇒ Boolean
11 12 13 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 11 def adapter_should_block_incoming?(request) option_token.present? && (request.params["token"] != option_token) end |
#adapter_supports_incoming? ⇒ Boolean
15 16 17 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 15 def adapter_supports_incoming? true end |
#adapter_supports_outgoing? ⇒ Boolean
19 20 21 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 19 def adapter_supports_outgoing? false end |
#adapter_thirdparty_id ⇒ Object
27 28 29 |
# File 'app/models/pager_tree/integrations/slack/webhook/v3.rb', line 27 def adapter_thirdparty_id [adapter_incoming_request_params.dig("channel_id"), adapter_incoming_request_params.dig("timestamp")].join(".") end |