func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Message, error) {
	path := "/2010-04-01/Accounts/{AccountSid}/Messages.json"
	if params != nil && params.PathAccountSid != nil {
		path = strings.Replace(path, "{"+"AccountSid"+"}", *params.PathAccountSid, -1)
	} else {
		path = strings.Replace(path, "{"+"AccountSid"+"}", c.requestHandler.Client.AccountSid(), -1)
	}
	data := url.Values{}
	headers := make(map[string]interface{})
	if params != nil && params.AddressRetention != nil {
		data.Set("AddressRetention", *params.AddressRetention)
	}
	if params != nil && params.ApplicationSid != nil {
		data.Set("ApplicationSid", *params.ApplicationSid)
	}
	if params != nil && params.Attempt != nil {
		data.Set("Attempt", fmt.Sprint(*params.Attempt))
	}
	if params != nil && params.Body != nil {
		data.Set("Body", *params.Body)
	}
	if params != nil && params.ContentRetention != nil {
		data.Set("ContentRetention", *params.ContentRetention)
	}
	if params != nil && params.ForceDelivery != nil {
		data.Set("ForceDelivery", fmt.Sprint(*params.ForceDelivery))
	}
	if params != nil && params.From != nil {
		data.Set("From", *params.From)
	}
	if params != nil && params.MaxPrice != nil {
		data.Set("MaxPrice", fmt.Sprint(*params.MaxPrice))
	}
	if params != nil && params.MediaUrl != nil {
		for _, item := range *params.MediaUrl {
			data.Add("MediaUrl", item)
		}
	}
	if params != nil && params.MessagingServiceSid != nil {
		data.Set("MessagingServiceSid", *params.MessagingServiceSid)
	}
	if params != nil && params.PersistentAction != nil {
		for _, item := range *params.PersistentAction {
			data.Add("PersistentAction", item)
		}
	}
	if params != nil && params.ProvideFeedback != nil {
		data.Set("ProvideFeedback", fmt.Sprint(*params.ProvideFeedback))
	}
	if params != nil && params.SmartEncoded != nil {
		data.Set("SmartEncoded", fmt.Sprint(*params.SmartEncoded))
	}
	if params != nil && params.StatusCallback != nil {
		data.Set("StatusCallback", *params.StatusCallback)
	}
	if params != nil && params.To != nil {
		data.Set("To", *params.To)
	}
	if params != nil && params.ValidityPeriod != nil {
		data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod))
	}
	resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	ps := &ApiV2010Message{}
	if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
		return nil, err
	}
	return ps, err
}
Send a message from the account used to make the request
package openapi
import (
	"encoding/json"
	"fmt"
	"net/url"
	"strings"
	"time"
	"github.com/twilio/twilio-go/client"
)
type CreateMessageParams struct {
	PathAccountSid *string `json:"PathAccountSid,omitempty"`
	AddressRetention *string `json:"AddressRetention,omitempty"`
	ApplicationSid *string `json:"ApplicationSid,omitempty"`
	Attempt *int `json:"Attempt,omitempty"`
	Body *string `json:"Body,omitempty"`
	ContentRetention *string `json:"ContentRetention,omitempty"`
	ForceDelivery *bool `json:"ForceDelivery,omitempty"`
	From *string `json:"From,omitempty"`
	MaxPrice *float32 `json:"MaxPrice,omitempty"`
	MediaUrl *[]string `json:"MediaUrl,omitempty"`
	MessagingServiceSid *string `json:"MessagingServiceSid,omitempty"`
	PersistentAction *[]string `json:"PersistentAction,omitempty"`
	ProvideFeedback *bool `json:"ProvideFeedback,omitempty"`
	SmartEncoded *bool `json:"SmartEncoded,omitempty"`
	StatusCallback *string `json:"StatusCallback,omitempty"`
	To *string `json:"To,omitempty"`
	ValidityPeriod *int `json:"ValidityPeriod,omitempty"`
}
func (params *CreateMessageParams) SetPathAccountSid(PathAccountSid string) *CreateMessageParams {
	params.PathAccountSid = &PathAccountSid
	return params
}
func (params *CreateMessageParams) SetAddressRetention(AddressRetention string) *CreateMessageParams {
	params.AddressRetention = &AddressRetention
	return params
}
func (params *CreateMessageParams) SetApplicationSid(ApplicationSid string) *CreateMessageParams {
	params.ApplicationSid = &ApplicationSid
	return params
}
func (params *CreateMessageParams) SetAttempt(Attempt int) *CreateMessageParams {
	params.Attempt = &Attempt
	return params
}
func (params *CreateMessageParams) SetBody(Body string) *CreateMessageParams {
	params.Body = &Body
	return params
}
func (params *CreateMessageParams) SetContentRetention(ContentRetention string) *CreateMessageParams {
	params.ContentRetention = &ContentRetention
	return params
}
func (params *CreateMessageParams) SetForceDelivery(ForceDelivery bool) *CreateMessageParams {
	params.ForceDelivery = &ForceDelivery
	return params
}
func (params *CreateMessageParams) SetFrom(From string) *CreateMessageParams {
	params.From = &From
	return params
}
func (params *CreateMessageParams) SetMaxPrice(MaxPrice float32) *CreateMessageParams {
	params.MaxPrice = &MaxPrice
	return params
}
func (params *CreateMessageParams) SetMediaUrl(MediaUrl []string) *CreateMessageParams {
	params.MediaUrl = &MediaUrl
	return params
}
func (params *CreateMessageParams) SetMessagingServiceSid(MessagingServiceSid string) *CreateMessageParams {
	params.MessagingServiceSid = &MessagingServiceSid
	return params
}
func (params *CreateMessageParams) SetPersistentAction(PersistentAction []string) *CreateMessageParams {
	params.PersistentAction = &PersistentAction
	return params
}
func (params *CreateMessageParams) SetProvideFeedback(ProvideFeedback bool) *CreateMessageParams {
	params.ProvideFeedback = &ProvideFeedback
	return params
}
func (params *CreateMessageParams) SetSmartEncoded(SmartEncoded bool) *CreateMessageParams {
	params.SmartEncoded = &SmartEncoded
	return params
}
func (params *CreateMessageParams) SetStatusCallback(StatusCallback string) *CreateMessageParams {
	params.StatusCallback = &StatusCallback
	return params
}
func (params *CreateMessageParams) SetTo(To string) *CreateMessageParams {
	params.To = &To
	return params
}
func (params *CreateMessageParams) SetValidityPeriod(ValidityPeriod int) *CreateMessageParams {
	params.ValidityPeriod = &ValidityPeriod
	return params
}