angular.module("c8y.core").factory("c8yMessaging",["$http","$q","c8yBase",function(t,u,a){var o="POST",n={prefix:"service/sms/smsmessaging/v1/outbound/",suffix:"/requests"};return{sendSms:function(e){return e.outboundSMSMessageRequest&&e.outboundSMSMessageRequest.address&&e.outboundSMSMessageRequest.senderAddress&&e.outboundSMSMessageRequest.outboundSMSTextMessage&&e.outboundSMSMessageRequest.outboundSMSTextMessage.message?(e=e,s=a.url(n.prefix+e.outboundSMSMessageRequest.senderAddress+n.suffix),e.outboundSMSMessageRequest.receiptRequest=e.outboundSMSMessageRequest.receiptRequest||{notifyUrl:null,callbackData:null},e.outboundSMSMessageRequest.receiptRequest.notifyUrl=e.outboundSMSMessageRequest.receiptRequest.notifyUrl||null,e.outboundSMSMessageRequest.receiptRequest.callbackData=e.outboundSMSMessageRequest.receiptRequest.callbackData||null,e.outboundSMSMessageRequest.senderName=e.senderName||null,t({method:o,url:s,data:e,headers:{Accept:"application/json","Content-type":"application/json"}})):u.reject("Invalid SMS data");var s}}}]);