func (c *ApiService) StreamDataSession(SimSid string, params *ListDataSessionParams) (chan WirelessV1DataSession, error) {
	if params == nil {
		params = &ListDataSessionParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageDataSession(SimSid, params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	channel := make(chan WirelessV1DataSession, 1)
	go func() {
		for response != nil {
			for item := range response.DataSessions {
				channel <- response.DataSessions[item]
			}
			var record interface{}
			if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListDataSessionResponse); record == nil || err != nil {
				close(channel)
				return
			}
			response = record.(*ListDataSessionResponse)
		}
		close(channel)
	}()
	return channel, err
}
Streams DataSession records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.
package openapi
import (
	"encoding/json"
	"fmt"
	"net/url"
	"strings"
	"github.com/twilio/twilio-go/client"
)
type ListDataSessionParams struct {
	PageSize *int `json:"PageSize,omitempty"`
	Limit *int `json:"limit,omitempty"`
}
func (params *ListDataSessionParams) SetPageSize(PageSize int) *ListDataSessionParams {
	params.PageSize = &PageSize
	return params
}
func (params *ListDataSessionParams) SetLimit(Limit int) *ListDataSessionParams {
	params.Limit = &Limit
	return params
}
func (c *ApiService) PageDataSession(SimSid string, params *ListDataSessionParams, pageToken, pageNumber string) (*ListDataSessionResponse, error) {
	path := "/v1/Sims/{SimSid}/DataSessions"
	path = strings.Replace(path, "{"+"SimSid"+"}", SimSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.PageSize != nil {
		data.Set("PageSize", fmt.Sprint(*params.PageSize))
	}
	if pageToken != "" {
		data.Set("PageToken", pageToken)
	}
	if pageNumber != "" {
		data.Set("Page", pageNumber)
	}
	resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &ListDataSessionResponse{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) ListDataSession(SimSid string, params *ListDataSessionParams) ([]WirelessV1DataSession, error) {
	if params == nil {
		params = &ListDataSessionParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageDataSession(SimSid, params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	var records []WirelessV1DataSession
	for response != nil {
		records = append(records, response.DataSessions...)
		var record interface{}
		if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListDataSessionResponse); record == nil || err != nil {
			return records, err
		}
		response = record.(*ListDataSessionResponse)
	}
	return records, err
}