conferences.go
func (c *ConferenceService) GetConferencesInRange(start time.Time, end time.Time, data url.Values) ConferencePageIterator {
	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("DateCreated")
	d.Del("Page") // just in case
	if start != Epoch {
		startFormat := start.UTC().Format(APISearchLayout)
		d.Set("DateCreated>", startFormat)
	}
	if end != HeatDeath {
		// If you specify "StartTime<=YYYY-MM-DD", the *latest* result returned
		// will be midnight (the earliest possible second) on DD. We want all
		// of the results for DD so we need to specify DD+1 in the API.
		//
		// TODO validate midnight-instant math more closely, since I don't think
		// Twilio returns the correct results for that instant.
		endFormat := end.UTC().Add(24 * time.Hour).Format(APISearchLayout)
		d.Set("DateCreated<", endFormat)
	}
	iter := NewPageIterator(c.client, d, conferencePathPart)
	return &conferenceDateIterator{
		start: start,
		end:   end,
		p:     iter,
	}
}
func (c *ConferenceService) GetConferencesInRange(start time.Time, end time.Time, data url.Values) ConferencePageIterator {
	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("DateCreated")
	d.Del("Page") // just in case
	if start != Epoch {
		startFormat := start.UTC().Format(APISearchLayout)
		d.Set("DateCreated>", startFormat)
	}
	if end != HeatDeath {
		// If you specify "StartTime<=YYYY-MM-DD", the *latest* result returned
		// will be midnight (the earliest possible second) on DD. We want all
		// of the results for DD so we need to specify DD+1 in the API.
		//
		// TODO validate midnight-instant math more closely, since I don't think
		// Twilio returns the correct results for that instant.
		endFormat := end.UTC().Add(24 * time.Hour).Format(APISearchLayout)
		d.Set("DateCreated<", endFormat)
	}
	iter := NewPageIterator(c.client, d, conferencePathPart)
	return &conferenceDateIterator{
		start: start,
		end:   end,
		p:     iter,
	}
}
func ( c * ConferenceService ) GetConferencesInRange ( start time . Time , end time . Time , data url . Values ) ConferencePageIterator { if start . After ( end ) { panic ( " " ) } d := url . Values { } if data != nil { for k , v := range data { d [ k ] = v } } d . Del ( " " ) d . Del ( " " ) // just in case if start != Epoch { startFormat := start . UTC ( ) . Format ( APISearchLayout ) d . Set ( " " , startFormat ) } if end != HeatDeath { // If you specify "StartTime<=YYYY-MM-DD", the *latest* result returned // will be midnight (the earliest possible second) on DD. We want all // of the results for DD so we need to specify DD+1 in the API. // // TODO validate midnight-instant math more closely, since I don't think // Twilio returns the correct results for that instant. endFormat := end . UTC ( ) . Add ( 24 * time . Hour ) . Format ( APISearchLayout ) d . Set ( " " , endFormat ) } iter := NewPageIterator ( c . client , d , conferencePathPart ) return & conferenceDateIterator { start : start , end : end , p : iter , } }
// GetConferencesInRange gets an Iterator containing conferences in the range
// [start, end), optionally further filtered by data. GetConferencesInRange
// 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 ConferencePages will have at most PageSize results, but may have fewer,
// based on filtering.
GetConferencesInRange gets an Iterator containing conferences in the range [ start end ) optionally further filtered by data . GetConferencesInRange 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 ConferencePages will have at most PageSize results but may have fewer based on filtering .