Class: Webhookdb::Messages::ErrorSignalwireSendSms

Inherits:
Webhookdb::Message::Template show all
Defined in:
lib/webhookdb/messages/error_signalwire_send_sms.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Webhookdb::Message::Template

#dispatch, #dispatch_email, #extra_fields, #full_template_name, #layout, #layout_path, #liquify, #template_path

Constructor Details

#initialize(service_integration, request_url:, request_method:, response_status:, response_body:) ⇒ ErrorSignalwireSendSms

Returns a new instance of ErrorSignalwireSendSms.



22
23
24
25
26
27
28
29
# File 'lib/webhookdb/messages/error_signalwire_send_sms.rb', line 22

def initialize(service_integration, request_url:, request_method:, response_status:, response_body:)
  @service_integration = service_integration
  @request_url = request_url
  @request_method = request_method
  @response_status = response_status
  @response_body = response_body
  super()
end

Class Method Details

.fixtured(_recipient) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/webhookdb/messages/error_signalwire_send_sms.rb', line 6

def self.fixtured(_recipient)
  sint = Webhookdb::Fixtures.service_integration.create
  return self.new(
    sint,
    response_status: 422,
    request_url: "https://whdbtest.signalwire.com/2010-04-01/Accounts/projid/Messages.json",
    request_method: "POST",
    response_body: {
      code: "21717",
      message: "From must belong to an active campaign.",
      more_info: "https://developer.signalwire.com/compatibility-api/reference/error-codes",
      status: 400,
    }.to_json,
  )
end

Instance Method Details

#liquid_dropsObject



38
39
40
41
42
43
44
45
46
47
# File 'lib/webhookdb/messages/error_signalwire_send_sms.rb', line 38

def liquid_drops
  return super.merge(
    service_name: @service_integration.service_name,
    opaque_id: @service_integration.opaque_id,
    request_method: @request_method,
    request_url: @request_url,
    response_status: @response_status,
    response_body: @response_body,
  )
end

#signatureObject



31
32
33
# File 'lib/webhookdb/messages/error_signalwire_send_sms.rb', line 31

def signature
  return "msg-#{self.full_template_name}-sint:#{@service_integration.id}-req:#{@request_url}"
end

#template_folderObject



35
# File 'lib/webhookdb/messages/error_signalwire_send_sms.rb', line 35

def template_folder = "errors"

#template_nameObject



36
# File 'lib/webhookdb/messages/error_signalwire_send_sms.rb', line 36

def template_name = "signalwire_send_sms"