func (c *CallService) GetCallsInRange(start time.Time, end time.Time, data url.Values) CallPageIterator {
	if start.After(end) {
		panic("start date is after end date")
	}
	d := url.Values{}
	if data != nil {
		for k, v := range data {
			d[k] = v
		}
	}
	d.Del("StartTime")
	d.Del("Page")  
	if start != Epoch {
		startFormat := start.UTC().Format(APISearchLayout)
		d.Set("StartTime>", startFormat)
	}
	if end != HeatDeath {
		endFormat := end.UTC().Add(24 * time.Hour).Format(APISearchLayout)
		d.Set("StartTime<", endFormat)
	}
	iter := NewPageIterator(c.client, d, callsPathPart)
	return &callDateIterator{
		start: start,
		end:   end,
		p:     iter,
	}
}
GetCallsInRange gets an Iterator containing calls in the range [start, end),
optionally further filtered by data. GetCallsInRange panics if start is not
before end. Any date filters provided in data will be ignored. If you have
an end, but don't want to specify a start, use twilio.Epoch for start. If
you have a start, but don't want to specify an end, use twilio.HeatDeath for
end.

Assumes that Twilio returns resources in chronological order, latest
first. If this assumption is incorrect, your results will not be correct.

Returned CallPages will have at most PageSize results, but may have fewer,
based on filtering.
package twilio
import (
	"context"
	"encoding/json"
	"fmt"
	"net/url"
	"time"
	types "github.com/kevinburke/go-types"
)
const callsPathPart = "Calls"
type CallService struct {
	client *Client
}
type Call struct {
	Sid            string           `json:"sid"`
	From           PhoneNumber      `json:"from"`
	To             PhoneNumber      `json:"to"`
	Status         Status           `json:"status"`
	StartTime      TwilioTime       `json:"start_time"`
	EndTime        TwilioTime       `json:"end_time"`
	Duration       TwilioDuration   `json:"duration"`
	AccountSid     string           `json:"account_sid"`
	Annotation     json.RawMessage  `json:"annotation"`
	AnsweredBy     NullAnsweredBy   `json:"answered_by"`
	CallerName     types.NullString `json:"caller_name"`
	DateCreated    TwilioTime       `json:"date_created"`
	DateUpdated    TwilioTime       `json:"date_updated"`
	Direction      Direction        `json:"direction"`
	ForwardedFrom  PhoneNumber      `json:"forwarded_from"`
	GroupSid       string           `json:"group_sid"`
	ParentCallSid  string           `json:"parent_call_sid"`
	PhoneNumberSid string           `json:"phone_number_sid"`
	Price          string           `json:"price"`
	PriceUnit      string           `json:"price_unit"`
	APIVersion     string           `json:"api_version"`
	URI            string           `json:"uri"`
}
func (c *Call) Ended() bool {
	switch c.Status {
	case StatusCompleted, StatusCanceled, StatusFailed, StatusBusy, StatusNoAnswer:
		return true
	default:
		return false
	}
}
func (c *Call) EndedUnsuccessfully() bool {
	switch c.Status {
	case StatusCanceled, StatusFailed, StatusBusy, StatusNoAnswer:
		return true
	default:
		return false
	}
}
func (c *Call) FriendlyPrice() string {
	if c == nil {
		return ""
	}
	return price(c.PriceUnit, c.Price)
}
type CallPage struct {
	Page
	Calls []*Call `json:"calls"`
}
func (c *CallService) Get(ctx context.Context, sid string) (*Call, error) {
	call := new(Call)
	err := c.client.GetResource(ctx, callsPathPart, sid, call)
	return call, err
}
func (c *CallService) Update(ctx context.Context, sid string, data url.Values) (*Call, error) {
	call := new(Call)
	err := c.client.UpdateResource(ctx, callsPathPart, sid, data, call)
	return call, err
}
func (c *CallService) Cancel(sid string) (*Call, error) {
	data := url.Values{}
	data.Set("Status", string(StatusCanceled))
	return c.Update(context.Background(), sid, data)
}
func (c *CallService) Hangup(sid string) (*Call, error) {
	data := url.Values{}
	data.Set("Status", string(StatusCompleted))
	return c.Update(context.Background(), sid, data)
}
func (c *CallService) Redirect(sid string, u *url.URL) (*Call, error) {
	data := url.Values{}
	data.Set("Url", u.String())
	return c.Update(context.Background(), sid, data)
}
func (c *CallService) Create(ctx context.Context, data url.Values) (*Call, error) {
	call := new(Call)
	err := c.client.CreateResource(ctx, callsPathPart, data, call)
	return call, err
}
func (c *CallService) MakeCall(from string, to string, u *url.URL) (*Call, error) {
	data := url.Values{}
	data.Set("From", from)
	data.Set("To", to)
	data.Set("Url", u.String())
	return c.Create(context.Background(), data)
}
func (c *CallService) GetPage(ctx context.Context, data url.Values) (*CallPage, error) {
	iter := c.GetPageIterator(data)
	return iter.Next(ctx)
}