github.com/twilio/twilio-go@v1.20.1/twiml/messaging_response.go (about) 1 //This code was generated by 2 //\ / _ _ _| _ _ 3 // | (_)\/(_)(_|\/| |(/_ v1.0.0 4 // / / 5 6 package twiml 7 8 func Messages(verbs []Element) (string, error) { 9 doc, response := CreateDocument() 10 if verbs != nil { 11 AddAllVerbs(response, verbs) 12 } 13 return ToXML(doc) 14 } 15 16 //MessagingRedirect <Redirect> TwiML Verb 17 type MessagingRedirect struct { 18 // url: Redirect URL 19 // method: Redirect URL method 20 // OptionalAttributes: additional attributes 21 Url string 22 Method string 23 InnerElements []Element 24 OptionalAttributes map[string]string 25 } 26 27 func (m MessagingRedirect) GetName() string { 28 return "Redirect" 29 } 30 31 func (m MessagingRedirect) GetText() string { 32 return m.Url 33 } 34 35 func (m MessagingRedirect) GetAttr() (map[string]string, map[string]string) { 36 paramsAttr := map[string]string{ 37 "Method": m.Method, 38 } 39 return m.OptionalAttributes, paramsAttr 40 } 41 42 func (m MessagingRedirect) GetInnerElements() []Element { 43 return m.InnerElements 44 } 45 46 //MessagingMessage <Message> TwiML Verb 47 type MessagingMessage struct { 48 // body: Message Body 49 // to: Phone Number to send Message to 50 // from: Phone Number to send Message from 51 // action: A URL specifying where Twilio should send status callbacks for the created outbound message. 52 // method: Action URL Method 53 // status_callback: Status callback URL. Deprecated in favor of action. 54 // OptionalAttributes: additional attributes 55 Body string 56 To string 57 From string 58 Action string 59 Method string 60 StatusCallback string 61 InnerElements []Element 62 OptionalAttributes map[string]string 63 } 64 65 func (m MessagingMessage) GetName() string { 66 return "Message" 67 } 68 69 func (m MessagingMessage) GetText() string { 70 return m.Body 71 } 72 73 func (m MessagingMessage) GetAttr() (map[string]string, map[string]string) { 74 paramsAttr := map[string]string{ 75 "To": m.To, 76 "From": m.From, 77 "Action": m.Action, 78 "Method": m.Method, 79 "StatusCallback": m.StatusCallback, 80 } 81 return m.OptionalAttributes, paramsAttr 82 } 83 84 func (m MessagingMessage) GetInnerElements() []Element { 85 return m.InnerElements 86 } 87 88 //MessagingMedia <Media> TwiML Noun 89 type MessagingMedia struct { 90 // url: Media URL 91 // OptionalAttributes: additional attributes 92 Url string 93 InnerElements []Element 94 OptionalAttributes map[string]string 95 } 96 97 func (m MessagingMedia) GetName() string { 98 return "Media" 99 } 100 101 func (m MessagingMedia) GetText() string { 102 return m.Url 103 } 104 105 func (m MessagingMedia) GetAttr() (map[string]string, map[string]string) { 106 return m.OptionalAttributes, nil 107 } 108 109 func (m MessagingMedia) GetInnerElements() []Element { 110 return m.InnerElements 111 } 112 113 //MessagingBody <Body> TwiML Noun 114 type MessagingBody struct { 115 // message: Message Body 116 // OptionalAttributes: additional attributes 117 Message string 118 InnerElements []Element 119 OptionalAttributes map[string]string 120 } 121 122 func (m MessagingBody) GetName() string { 123 return "Body" 124 } 125 126 func (m MessagingBody) GetText() string { 127 return m.Message 128 } 129 130 func (m MessagingBody) GetAttr() (map[string]string, map[string]string) { 131 return m.OptionalAttributes, nil 132 } 133 134 func (m MessagingBody) GetInnerElements() []Element { 135 return m.InnerElements 136 }