Skip to content

Commit

Permalink
Merge pull request #30 from danieloliveira085/master
Browse files Browse the repository at this point in the history
Change field requirements
  • Loading branch information
hugolgst committed May 25, 2021
2 parents 7960b99 + 5b8be47 commit 9d45f0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
14 changes: 0 additions & 14 deletions client/inputMapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@ type Secrets struct {
}

func mapActivity(activity *Activity) *PayloadActivity {
// Replace empty fields by "none"
if activity.LargeImage == "" {
activity.LargeImage = "none"
}
if activity.LargeText == "" {
activity.LargeText = "none"
}
if activity.SmallImage == "" {
activity.SmallImage = "none"
}
if activity.SmallText == "" {
activity.SmallText = "none"
}

final := &PayloadActivity{
Details: activity.Details,
State: activity.State,
Expand Down
18 changes: 9 additions & 9 deletions client/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ type Args struct {
}

type PayloadActivity struct {
Details string `json:"details"`
State string `json:"state"`
Assets PayloadAssets `json:"assets"`
Details string `json:"details,omitempty"`
State string `json:"state,omitempty"`
Assets PayloadAssets `json:"assets,omitempty"`
Party *PayloadParty `json:"party,omitempty"`
Timestamps *PayloadTimestamps `json:"timestamps,omitempty"`
Secrets *PayloadSecrets `json:"secrets,omitempty"`
Buttons []*PayloadButton `json:"buttons,omitempty"`
}

type PayloadAssets struct {
LargeImage string `json:"large_image"`
LargeText string `json:"large_text"`
SmallImage string `json:"small_image"`
SmallText string `json:"small_text"`
LargeImage string `json:"large_image,omitempty"`
LargeText string `json:"large_text,omitempty"`
SmallImage string `json:"small_image,omitempty"`
SmallText string `json:"small_text,omitempty"`
}

type PayloadParty struct {
ID string `json:"id"`
Size [2]int `json:"size"`
ID string `json:"id,omitempty"`
Size [2]int `json:"size,omitempty"`
}

type PayloadTimestamps struct {
Expand Down

0 comments on commit 9d45f0e

Please sign in to comment.