Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

TwiML: add more properties for NumberOpts and ClientOpts #74

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ You can generate a callback parser for all Twilio callbacks that will publish th
[See the SMS example below for an example of how this works.](#sms_example)




## Installation

```
Expand Down Expand Up @@ -44,9 +42,6 @@ act := twilogo.NewAccountFromEnv()
act := twiliogo.NewAccount("AccountSid", "AccountToken")
```




### Making a call

```go
Expand All @@ -59,9 +54,6 @@ resp, err := act.Voice.Call(voice.Post{
})
```




### Sending a text - with a callback handler <a name="sms_example"></a>

```go
Expand Down
7 changes: 5 additions & 2 deletions twiml/noun_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ type client struct {
//
// https://www.twilio.com/docs/api/twiml/client
type ClientOpts struct {
URL string `xml:"url,attr,omitempty"`
Method string `xml:"method,attr,omitempty"`
URL string `xml:"url,attr,omitempty"`
Method string `xml:"method,attr,omitempty"`
StatusCallbackEvent string `xml:"statusCallbackEvent,attr,omitempty"`
StatusCallback string `xml:"statusCallback,attr,omitempty"`
StatusCallbackMethod string `xml:"statusCallbackMethod,attr,omitempty"`
}

func addClient(t twimlResponse, opts *ClientOpts, clients []string) {
Expand Down
9 changes: 6 additions & 3 deletions twiml/noun_number.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ type number struct {
//
// https://www.twilio.com/docs/api/twiml/number
type NumberOpts struct {
SendDigits string `xml:"sendDigits,attr,omitempty"`
URL string `xml:"url,attr,omitempty"`
Method string `xml:"method,attr,omitempty"`
SendDigits string `xml:"sendDigits,attr,omitempty"`
URL string `xml:"url,attr,omitempty"`
Method string `xml:"method,attr,omitempty"`
StatusCallbackEvent string `xml:"statusCallbackEvent,attr,omitempty"`
StatusCallback string `xml:"statusCallback,attr,omitempty"`
StatusCallbackMethod string `xml:"statusCallbackMethod,attr,omitempty"`
}

func addNumber(t twimlResponse, opts *NumberOpts, numbers []string) {
Expand Down
19 changes: 11 additions & 8 deletions twiml/verb_dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ type dial struct {
//
// https://www.twilio.com/docs/api/twiml/dial
type DialOpts struct {
Action string `xml:"action,attr,omitempty"`
Method string `xml:"method,attr,omitempty"`
Timeout int `xml:"timeout,attr,omitempty"`
HangupOnStar bool `xml:"hangupOnStar,attr,omitempty"`
TimeLimit int `xml:"timeLimit,attr,omitempty"`
CallerID string `xml:"callerId,attr,omitempty"`
Record string `xml:"record,attr,omitempty"`
Trim string `xml:"trim,attr,omitempty"`
Action string `xml:"action,attr,omitempty"`
Method string `xml:"method,attr,omitempty"`
Timeout int `xml:"timeout,attr,omitempty"`
HangupOnStar bool `xml:"hangupOnStar,attr,omitempty"`
TimeLimit int `xml:"timeLimit,attr,omitempty"`
CallerID string `xml:"callerId,attr,omitempty"`
Record string `xml:"record,attr,omitempty"`
Trim string `xml:"trim,attr,omitempty"`
RecordingStatusCallback string `xml:"recordingStatusCallback,attr,omitempty"`
RecordingStatusCallbackMethod string `xml:"recordingStatusCallbackMethod,attr,omitempty"`
RingTone string `xml:"ringTone,attr,omitempty"`
}

type dialBody interface {
Expand Down