Class: Channel::MicrosoftTeams::V3
- Inherits:
-
Integration
- Object
- Integration
- Channel::MicrosoftTeams::V3
- Defined in:
- app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb
Constant Summary collapse
- OPTIONS =
[ {key: :incoming_webhook_url, type: :string, default: nil}, {key: :alert_open, type: :boolean, default: false}, {key: :alert_acknowledged, type: :boolean, default: false}, {key: :alert_resolved, type: :boolean, default: false}, {key: :alert_dropped, type: :boolean, default: false}, {key: :outgoing_rules, type: :string, default: nil} ]
Instance Method Summary collapse
- #adapter_outgoing_interest?(event_name) ⇒ Boolean
- #adapter_process_outgoing ⇒ Object
- #adapter_show_outgoing_webhook_delivery? ⇒ Boolean
- #adapter_supports_description_template? ⇒ Boolean
- #adapter_supports_incoming? ⇒ Boolean
- #adapter_supports_outgoing? ⇒ Boolean
- #adapter_supports_title_template? ⇒ Boolean
Instance Method Details
#adapter_outgoing_interest?(event_name) ⇒ Boolean
44 45 46 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 44 def adapter_outgoing_interest?(event_name) try("option_#{event_name}") || false end |
#adapter_process_outgoing ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 48 def adapter_process_outgoing url = adapter_outgoing_event.outgoing_rules_data.dig("webhook_url") || self.option_incoming_webhook_url body = _blocks.merge(adapter_outgoing_event.outgoing_rules_data.except("webhook_url")) outgoing_webhook_delivery = OutgoingWebhookDelivery.factory( resource: self, url: url, body: body ) outgoing_webhook_delivery.save! outgoing_webhook_delivery.deliver_later outgoing_webhook_delivery end |
#adapter_show_outgoing_webhook_delivery? ⇒ Boolean
32 33 34 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 32 def adapter_show_outgoing_webhook_delivery? true end |
#adapter_supports_description_template? ⇒ Boolean
40 41 42 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 40 def adapter_supports_description_template? false end |
#adapter_supports_incoming? ⇒ Boolean
24 25 26 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 24 def adapter_supports_incoming? false end |
#adapter_supports_outgoing? ⇒ Boolean
28 29 30 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 28 def adapter_supports_outgoing? true end |
#adapter_supports_title_template? ⇒ Boolean
36 37 38 |
# File 'app/models/pager_tree/integrations/channel/microsoft_teams/v3.rb', line 36 def adapter_supports_title_template? false end |