func (c *ApiService) StreamSmsCommand(params *ListSmsCommandParams) (chan SupersimV1SmsCommand, error) {
	if params == nil {
		params = &ListSmsCommandParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageSmsCommand(params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	channel := make(chan SupersimV1SmsCommand, 1)
	go func() {
		for response != nil {
			for item := range response.SmsCommands {
				channel <- response.SmsCommands[item]
			}
			var record interface{}
			if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListSmsCommandResponse); record == nil || err != nil {
				close(channel)
				return
			}
			response = record.(*ListSmsCommandResponse)
		}
		close(channel)
	}()
	return channel, err
}
Streams SmsCommand 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 CreateSmsCommandParams struct {
	CallbackMethod *string `json:"CallbackMethod,omitempty"`
	CallbackUrl *string `json:"CallbackUrl,omitempty"`
	Payload *string `json:"Payload,omitempty"`
	Sim *string `json:"Sim,omitempty"`
}
func (params *CreateSmsCommandParams) SetCallbackMethod(CallbackMethod string) *CreateSmsCommandParams {
	params.CallbackMethod = &CallbackMethod
	return params
}
func (params *CreateSmsCommandParams) SetCallbackUrl(CallbackUrl string) *CreateSmsCommandParams {
	params.CallbackUrl = &CallbackUrl
	return params
}
func (params *CreateSmsCommandParams) SetPayload(Payload string) *CreateSmsCommandParams {
	params.Payload = &Payload
	return params
}
func (params *CreateSmsCommandParams) SetSim(Sim string) *CreateSmsCommandParams {
	params.Sim = &Sim
	return params
}
func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*SupersimV1SmsCommand, error) {
	path := "/v1/SmsCommands"
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.CallbackMethod != nil {
		data.Set("CallbackMethod", *params.CallbackMethod)
	}
	if params != nil && params.CallbackUrl != nil {
		data.Set("CallbackUrl", *params.CallbackUrl)
	}
	if params != nil && params.Payload != nil {
		data.Set("Payload", *params.Payload)
	}
	if params != nil && params.Sim != nil {
		data.Set("Sim", *params.Sim)
	}
	resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &SupersimV1SmsCommand{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) FetchSmsCommand(Sid string) (*SupersimV1SmsCommand, error) {
	path := "/v1/SmsCommands/{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 := &SupersimV1SmsCommand{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
type ListSmsCommandParams struct {
	Sim *string `json:"Sim,omitempty"`
	Status *string `json:"Status,omitempty"`
	Direction *string `json:"Direction,omitempty"`
	PageSize *int `json:"PageSize,omitempty"`
	Limit *int `json:"limit,omitempty"`
}
func (params *ListSmsCommandParams) SetSim(Sim string) *ListSmsCommandParams {
	params.Sim = &Sim
	return params
}
func (params *ListSmsCommandParams) SetStatus(Status string) *ListSmsCommandParams {
	params.Status = &Status
	return params
}
func (params *ListSmsCommandParams) SetDirection(Direction string) *ListSmsCommandParams {
	params.Direction = &Direction
	return params
}
func (params *ListSmsCommandParams) SetPageSize(PageSize int) *ListSmsCommandParams {
	params.PageSize = &PageSize
	return params
}
func (params *ListSmsCommandParams) SetLimit(Limit int) *ListSmsCommandParams {
	params.Limit = &Limit
	return params
}
func (c *ApiService) PageSmsCommand(params *ListSmsCommandParams, pageToken, pageNumber string) (*ListSmsCommandResponse, error) {
	path := "/v1/SmsCommands"
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.Sim != nil {
		data.Set("Sim", *params.Sim)
	}
	if params != nil && params.Status != nil {
		data.Set("Status", *params.Status)
	}
	if params != nil && params.Direction != nil {
		data.Set("Direction", *params.Direction)
	}
	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 := &ListSmsCommandResponse{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) ListSmsCommand(params *ListSmsCommandParams) ([]SupersimV1SmsCommand, error) {
	if params == nil {
		params = &ListSmsCommandParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageSmsCommand(params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	var records []SupersimV1SmsCommand
	for response != nil {
		records = append(records, response.SmsCommands...)
		var record interface{}
		if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListSmsCommandResponse); record == nil || err != nil {
			return records, err
		}
		response = record.(*ListSmsCommandResponse)
	}
	return records, err
}