Skip to content

Commit b2275d1

Browse files
Make privacy field non-optional in teams
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.
1 parent 452c1c8 commit b2275d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/GitHub/Data/Teams.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ data SimpleTeam = SimpleTeam
5050
, simpleTeamName :: !Text -- TODO (0.15.0): unify this and 'simpleTeamSlug' as in 'Team'.
5151
, simpleTeamSlug :: !(Name Team)
5252
, simpleTeamDescription :: !(Maybe Text)
53-
, simpleTeamPrivacy :: !(Maybe Privacy)
53+
, simpleTeamPrivacy :: !Privacy
5454
, simpleTeamPermission :: !Permission
5555
, simpleTeamMembersUrl :: !URL
5656
, simpleTeamRepositoriesUrl :: !URL
@@ -66,7 +66,7 @@ data Team = Team
6666
, teamName :: !Text
6767
, teamSlug :: !(Name Team)
6868
, teamDescription :: !(Maybe Text)
69-
, teamPrivacy :: !(Maybe Privacy)
69+
, teamPrivacy :: !Privacy
7070
, teamPermission :: !Permission
7171
, teamMembersUrl :: !URL
7272
, teamRepositoriesUrl :: !URL
@@ -144,7 +144,7 @@ instance FromJSON SimpleTeam where
144144
<*> o .: "name"
145145
<*> o .: "slug"
146146
<*> o .:?"description" .!= Nothing
147-
<*> o .:?"privacy" .!= Nothing
147+
<*> o .: "privacy"
148148
<*> o .: "permission"
149149
<*> o .: "members_url"
150150
<*> o .: "repositories_url"
@@ -156,7 +156,7 @@ instance FromJSON Team where
156156
<*> o .: "name"
157157
<*> o .: "slug"
158158
<*> o .:?"description" .!= Nothing
159-
<*> o .:?"privacy" .!= Nothing
159+
<*> o .: "privacy"
160160
<*> o .: "permission"
161161
<*> o .: "members_url"
162162
<*> o .: "repositories_url"

0 commit comments

Comments
 (0)