func (c *ApiService) StreamWorkflow(WorkspaceSid string, params *ListWorkflowParams) (chan TaskrouterV1Workflow, error) {
	if params == nil {
		params = &ListWorkflowParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageWorkflow(WorkspaceSid, params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	channel := make(chan TaskrouterV1Workflow, 1)
	go func() {
		for response != nil {
			for item := range response.Workflows {
				channel <- response.Workflows[item]
			}
			var record interface{}
			if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListWorkflowResponse); record == nil || err != nil {
				close(channel)
				return
			}
			response = record.(*ListWorkflowResponse)
		}
		close(channel)
	}()
	return channel, err
}
Streams Workflow 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 CreateWorkflowParams struct {
	AssignmentCallbackUrl *string `json:"AssignmentCallbackUrl,omitempty"`
	Configuration *string `json:"Configuration,omitempty"`
	FallbackAssignmentCallbackUrl *string `json:"FallbackAssignmentCallbackUrl,omitempty"`
	FriendlyName *string `json:"FriendlyName,omitempty"`
	TaskReservationTimeout *int `json:"TaskReservationTimeout,omitempty"`
}
func (params *CreateWorkflowParams) SetAssignmentCallbackUrl(AssignmentCallbackUrl string) *CreateWorkflowParams {
	params.AssignmentCallbackUrl = &AssignmentCallbackUrl
	return params
}
func (params *CreateWorkflowParams) SetConfiguration(Configuration string) *CreateWorkflowParams {
	params.Configuration = &Configuration
	return params
}
func (params *CreateWorkflowParams) SetFallbackAssignmentCallbackUrl(FallbackAssignmentCallbackUrl string) *CreateWorkflowParams {
	params.FallbackAssignmentCallbackUrl = &FallbackAssignmentCallbackUrl
	return params
}
func (params *CreateWorkflowParams) SetFriendlyName(FriendlyName string) *CreateWorkflowParams {
	params.FriendlyName = &FriendlyName
	return params
}
func (params *CreateWorkflowParams) SetTaskReservationTimeout(TaskReservationTimeout int) *CreateWorkflowParams {
	params.TaskReservationTimeout = &TaskReservationTimeout
	return params
}
func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowParams) (*TaskrouterV1Workflow, error) {
	path := "/v1/Workspaces/{WorkspaceSid}/Workflows"
	path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.AssignmentCallbackUrl != nil {
		data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl)
	}
	if params != nil && params.Configuration != nil {
		data.Set("Configuration", *params.Configuration)
	}
	if params != nil && params.FallbackAssignmentCallbackUrl != nil {
		data.Set("FallbackAssignmentCallbackUrl", *params.FallbackAssignmentCallbackUrl)
	}
	if params != nil && params.FriendlyName != nil {
		data.Set("FriendlyName", *params.FriendlyName)
	}
	if params != nil && params.TaskReservationTimeout != nil {
		data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout))
	}
	resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &TaskrouterV1Workflow{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) DeleteWorkflow(WorkspaceSid string, Sid string) error {
	path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}"
	path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1)
	path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	return nil
}
func (c *ApiService) FetchWorkflow(WorkspaceSid string, Sid string) (*TaskrouterV1Workflow, error) {
	path := "/v1/Workspaces/{WorkspaceSid}/Workflows/{Sid}"
	path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1)
	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 := &TaskrouterV1Workflow{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
type ListWorkflowParams struct {
	FriendlyName *string `json:"FriendlyName,omitempty"`
	PageSize *int `json:"PageSize,omitempty"`
	Limit *int `json:"limit,omitempty"`
}
func (params *ListWorkflowParams) SetFriendlyName(FriendlyName string) *ListWorkflowParams {
	params.FriendlyName = &FriendlyName
	return params
}
func (params *ListWorkflowParams) SetPageSize(PageSize int) *ListWorkflowParams {
	params.PageSize = &PageSize
	return params
}
func (params *ListWorkflowParams) SetLimit(Limit int) *ListWorkflowParams {
	params.Limit = &Limit
	return params
}
func (c *ApiService) PageWorkflow(WorkspaceSid string, params *ListWorkflowParams, pageToken, pageNumber string) (*ListWorkflowResponse, error) {
	path := "/v1/Workspaces/{WorkspaceSid}/Workflows"
	path = strings.Replace(path, "{"+"WorkspaceSid"+"}", WorkspaceSid, -1)
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.FriendlyName != nil {
		data.Set("FriendlyName", *params.FriendlyName)
	}
	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 := &ListWorkflowResponse{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
func (c *ApiService) ListWorkflow(WorkspaceSid string, params *ListWorkflowParams) ([]TaskrouterV1Workflow, error) {
	if params == nil {
		params = &ListWorkflowParams{}
	}
	params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit))
	response, err := c.PageWorkflow(WorkspaceSid, params, "", "")
	if err != nil {
		return nil, err
	}
	curRecord := 0
	var records []TaskrouterV1Workflow
	for response != nil {
		records = append(records, response.Workflows...)
		var record interface{}
		if record, err = client.GetNext(c.baseURL, response, &curRecord, params.Limit, c.getNextListWorkflowResponse); record == nil || err != nil {
			return records, err
		}
		response = record.(*ListWorkflowResponse)
	}
	return records, err
}