# HG changeset patch # User Mikael Berthe # Date 1536107603 -7200 # Node ID d13e9a780d917c84ceaf9518edbd11efeadfd5a3 # Parent 69f29aacd5bcd789a036557607f038c505c3e073 Update PostStatus prototype diff -r 69f29aacd5bc -r d13e9a780d91 status.go --- a/status.go Wed Sep 05 02:33:23 2018 +0200 +++ b/status.go Wed Sep 05 02:33:23 2018 +0200 @@ -14,6 +14,16 @@ "github.com/sendgrid/rest" ) +// PostStatusParams contains option fields for the PostStatus command +type PostStatusParams struct { + Text string + InReplyTo int64 + MediaIDs []int64 + Sensitive bool + SpoilerText string + Visibility string +} + // updateStatusOptions contains option fields for POST and DELETE API calls type updateStatusOptions struct { // The ID is used for most commands @@ -196,15 +206,15 @@ // PostStatus posts a new "toot" // All parameters but "text" can be empty. // Visibility must be empty, or one of "direct", "private", "unlisted" and "public". -func (mc *Client) PostStatus(text string, inReplyTo int64, mediaIDs []int64, sensitive bool, spoilerText string, visibility string) (*Status, error) { +func (mc *Client) PostStatus(cmdParams PostStatusParams) (*Status, error) { var status Status o := updateStatusOptions{ - Status: text, - InReplyToID: inReplyTo, - MediaIDs: mediaIDs, - Sensitive: sensitive, - SpoilerText: spoilerText, - Visibility: visibility, + Status: cmdParams.Text, + InReplyToID: cmdParams.InReplyTo, + MediaIDs: cmdParams.MediaIDs, + Sensitive: cmdParams.Sensitive, + SpoilerText: cmdParams.SpoilerText, + Visibility: cmdParams.Visibility, } err := mc.updateStatusData("status", o, &status)