Skip to content

Commit

Permalink
Make privacy field non-optional in teams
Browse files Browse the repository at this point in the history
The `privacy` field is optional when creating/editing teams, but
has a context dependent default value. When getting the team details,
the field is expected to always be populated due to these default
values.
  • Loading branch information
robbiemcmichael committed Dec 3, 2019
1 parent 452c1c8 commit b2275d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/GitHub/Data/Teams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ data SimpleTeam = SimpleTeam
, simpleTeamName :: !Text -- TODO (0.15.0): unify this and 'simpleTeamSlug' as in 'Team'.
, simpleTeamSlug :: !(Name Team)
, simpleTeamDescription :: !(Maybe Text)
, simpleTeamPrivacy :: !(Maybe Privacy)
, simpleTeamPrivacy :: !Privacy
, simpleTeamPermission :: !Permission
, simpleTeamMembersUrl :: !URL
, simpleTeamRepositoriesUrl :: !URL
Expand All @@ -66,7 +66,7 @@ data Team = Team
, teamName :: !Text
, teamSlug :: !(Name Team)
, teamDescription :: !(Maybe Text)
, teamPrivacy :: !(Maybe Privacy)
, teamPrivacy :: !Privacy
, teamPermission :: !Permission
, teamMembersUrl :: !URL
, teamRepositoriesUrl :: !URL
Expand Down Expand Up @@ -144,7 +144,7 @@ instance FromJSON SimpleTeam where
<*> o .: "name"
<*> o .: "slug"
<*> o .:?"description" .!= Nothing
<*> o .:?"privacy" .!= Nothing
<*> o .: "privacy"
<*> o .: "permission"
<*> o .: "members_url"
<*> o .: "repositories_url"
Expand All @@ -156,7 +156,7 @@ instance FromJSON Team where
<*> o .: "name"
<*> o .: "slug"
<*> o .:?"description" .!= Nothing
<*> o .:?"privacy" .!= Nothing
<*> o .: "privacy"
<*> o .: "permission"
<*> o .: "members_url"
<*> o .: "repositories_url"
Expand Down

0 comments on commit b2275d1

Please sign in to comment.