func (c *ApiService) StreamEvent(params *ListEventParams) (chan MonitorV1Event, error) {
	if params == nil {
		params = &ListEventParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageEvent(params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	channel := make(chan MonitorV1Event, 1)
	go func() {
		for response != nil {
			for item := range response.Events {
				channel <- response.Events[item]
			}
			var record interface{}
			if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListEventResponse); record == nil || err != nil {
				close(channel)
				return
			}
			response = record.(*ListEventResponse)
		}
		close(channel)
	}()
	return channel, err
}
Streams Event 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"
	"time"
	"github.com/twilio/twilio-go/client"
)
func (c *ApiService) FetchEvent(Sid string) (*MonitorV1Event, error) {
	path := "/v1/Events/{Sid}"
	path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	resp, err := c.requestHandler.Get(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &MonitorV1Event{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
type ListEventParams struct {
	ActorSid *string `json:"ActorSid,omitempty"`
	EventType *string `json:"EventType,omitempty"`
	ResourceSid *string `json:"ResourceSid,omitempty"`
	SourceIpAddress *string `json:"SourceIpAddress,omitempty"`
	StartDate *time.Time `json:"StartDate,omitempty"`
	EndDate *time.Time `json:"EndDate,omitempty"`
	PageSize *int `json:"PageSize,omitempty"`
	Limit *int `json:"limit,omitempty"`
}
func (params *ListEventParams) SetActorSid(ActorSid string) *ListEventParams {
	params.ActorSid = &ActorSid
	return params
}
func (params *ListEventParams) SetEventType(EventType string) *ListEventParams {
	params.EventType = &EventType
	return params
}
func (params *ListEventParams) SetResourceSid(ResourceSid string) *ListEventParams {
	params.ResourceSid = &ResourceSid
	return params
}
func (params *ListEventParams) SetSourceIpAddress(SourceIpAddress string) *ListEventParams {
	params.SourceIpAddress = &SourceIpAddress
	return params
}
func (params *ListEventParams) SetStartDate(StartDate time.Time) *ListEventParams {
	params.StartDate = &StartDate
	return params
}
func (params *ListEventParams) SetEndDate(EndDate time.Time) *ListEventParams {
	params.EndDate = &EndDate
	return params
}
func (params *ListEventParams) SetPageSize(PageSize int) *ListEventParams {
	params.PageSize = &PageSize
	return params
}
func (params *ListEventParams) SetLimit(Limit int) *ListEventParams {
	params.Limit = &Limit
	return params
}
func (c *ApiService) PageEvent(params *ListEventParams, pageToken, pageNumber string) (*ListEventResponse, error) {
	path := "/v1/Events"
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.ActorSid != nil {
		data.Set("ActorSid", *params.ActorSid)
	}
	if params != nil && params.EventType != nil {
		data.Set("EventType", *params.EventType)
	}
	if params != nil && params.ResourceSid != nil {
		data.Set("ResourceSid", *params.ResourceSid)
	}
	if params != nil && params.SourceIpAddress != nil {
		data.Set("SourceIpAddress", *params.SourceIpAddress)
	}
	if params != nil && params.StartDate != nil {
		data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339)))
	}
	if params != nil && params.EndDate != nil {
		data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339)))
	}
	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 := &ListEventResponse{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) ListEvent(params *ListEventParams) ([]MonitorV1Event, error) {
	if params == nil {
		params = &ListEventParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageEvent(params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	var records []MonitorV1Event
	for response != nil {
		records = append(records, response.Events...)
		var record interface{}
		if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListEventResponse); record == nil || err != nil {
			return records, err
		}
		response = record.(*ListEventResponse)
	}
	return records, err
}