{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.CloudIdentity.Types.Product where
import Network.Google.CloudIdentity.Types.Sum
import Network.Google.Prelude
newtype LookupMembershipNameResponse = LookupMembershipNameResponse'
{ _lmnrName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
lookupMembershipNameResponse
:: LookupMembershipNameResponse
lookupMembershipNameResponse =
LookupMembershipNameResponse'
{ _lmnrName = Nothing
}
lmnrName :: Lens' LookupMembershipNameResponse (Maybe Text)
lmnrName = lens _lmnrName (\ s a -> s{_lmnrName = a})
instance FromJSON LookupMembershipNameResponse where
parseJSON
= withObject "LookupMembershipNameResponse"
(\ o ->
LookupMembershipNameResponse' <$> (o .:? "name"))
instance ToJSON LookupMembershipNameResponse where
toJSON LookupMembershipNameResponse'{..}
= object (catMaybes [("name" .=) <$> _lmnrName])
data Status = Status'
{ _sDetails :: !(Maybe [StatusDetailsItem])
, _sCode :: !(Maybe (Textual Int32))
, _sMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
status
:: Status
status =
Status'
{ _sDetails = Nothing
, _sCode = Nothing
, _sMessage = Nothing
}
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
= lens _sDetails (\ s a -> s{_sDetails = a}) .
_Default
. _Coerce
sCode :: Lens' Status (Maybe Int32)
sCode
= lens _sCode (\ s a -> s{_sCode = a}) .
mapping _Coerce
sMessage :: Lens' Status (Maybe Text)
sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
instance FromJSON Status where
parseJSON
= withObject "Status"
(\ o ->
Status' <$>
(o .:? "details" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON Status where
toJSON Status'{..}
= object
(catMaybes
[("details" .=) <$> _sDetails,
("code" .=) <$> _sCode,
("message" .=) <$> _sMessage])
data Group = Group'
{ _gParent :: !(Maybe Text)
, _gGroupKey :: !(Maybe EntityKey)
, _gUpdateTime :: !(Maybe DateTime')
, _gName :: !(Maybe Text)
, _gDisplayName :: !(Maybe Text)
, _gLabels :: !(Maybe GroupLabels)
, _gDescription :: !(Maybe Text)
, _gCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
group'
:: Group
group' =
Group'
{ _gParent = Nothing
, _gGroupKey = Nothing
, _gUpdateTime = Nothing
, _gName = Nothing
, _gDisplayName = Nothing
, _gLabels = Nothing
, _gDescription = Nothing
, _gCreateTime = Nothing
}
gParent :: Lens' Group (Maybe Text)
gParent = lens _gParent (\ s a -> s{_gParent = a})
gGroupKey :: Lens' Group (Maybe EntityKey)
gGroupKey
= lens _gGroupKey (\ s a -> s{_gGroupKey = a})
gUpdateTime :: Lens' Group (Maybe UTCTime)
gUpdateTime
= lens _gUpdateTime (\ s a -> s{_gUpdateTime = a}) .
mapping _DateTime
gName :: Lens' Group (Maybe Text)
gName = lens _gName (\ s a -> s{_gName = a})
gDisplayName :: Lens' Group (Maybe Text)
gDisplayName
= lens _gDisplayName (\ s a -> s{_gDisplayName = a})
gLabels :: Lens' Group (Maybe GroupLabels)
gLabels = lens _gLabels (\ s a -> s{_gLabels = a})
gDescription :: Lens' Group (Maybe Text)
gDescription
= lens _gDescription (\ s a -> s{_gDescription = a})
gCreateTime :: Lens' Group (Maybe UTCTime)
gCreateTime
= lens _gCreateTime (\ s a -> s{_gCreateTime = a}) .
mapping _DateTime
instance FromJSON Group where
parseJSON
= withObject "Group"
(\ o ->
Group' <$>
(o .:? "parent") <*> (o .:? "groupKey") <*>
(o .:? "updateTime")
<*> (o .:? "name")
<*> (o .:? "displayName")
<*> (o .:? "labels")
<*> (o .:? "description")
<*> (o .:? "createTime"))
instance ToJSON Group where
toJSON Group'{..}
= object
(catMaybes
[("parent" .=) <$> _gParent,
("groupKey" .=) <$> _gGroupKey,
("updateTime" .=) <$> _gUpdateTime,
("name" .=) <$> _gName,
("displayName" .=) <$> _gDisplayName,
("labels" .=) <$> _gLabels,
("description" .=) <$> _gDescription,
("createTime" .=) <$> _gCreateTime])
data Membership = Membership'
{ _mRoles :: !(Maybe [MembershipRole])
, _mUpdateTime :: !(Maybe DateTime')
, _mName :: !(Maybe Text)
, _mPreferredMemberKey :: !(Maybe EntityKey)
, _mCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
membership
:: Membership
membership =
Membership'
{ _mRoles = Nothing
, _mUpdateTime = Nothing
, _mName = Nothing
, _mPreferredMemberKey = Nothing
, _mCreateTime = Nothing
}
mRoles :: Lens' Membership [MembershipRole]
mRoles
= lens _mRoles (\ s a -> s{_mRoles = a}) . _Default .
_Coerce
mUpdateTime :: Lens' Membership (Maybe UTCTime)
mUpdateTime
= lens _mUpdateTime (\ s a -> s{_mUpdateTime = a}) .
mapping _DateTime
mName :: Lens' Membership (Maybe Text)
mName = lens _mName (\ s a -> s{_mName = a})
mPreferredMemberKey :: Lens' Membership (Maybe EntityKey)
mPreferredMemberKey
= lens _mPreferredMemberKey
(\ s a -> s{_mPreferredMemberKey = a})
mCreateTime :: Lens' Membership (Maybe UTCTime)
mCreateTime
= lens _mCreateTime (\ s a -> s{_mCreateTime = a}) .
mapping _DateTime
instance FromJSON Membership where
parseJSON
= withObject "Membership"
(\ o ->
Membership' <$>
(o .:? "roles" .!= mempty) <*> (o .:? "updateTime")
<*> (o .:? "name")
<*> (o .:? "preferredMemberKey")
<*> (o .:? "createTime"))
instance ToJSON Membership where
toJSON Membership'{..}
= object
(catMaybes
[("roles" .=) <$> _mRoles,
("updateTime" .=) <$> _mUpdateTime,
("name" .=) <$> _mName,
("preferredMemberKey" .=) <$> _mPreferredMemberKey,
("createTime" .=) <$> _mCreateTime])
data Operation = Operation'
{ _oDone :: !(Maybe Bool)
, _oError :: !(Maybe Status)
, _oResponse :: !(Maybe OperationResponse)
, _oName :: !(Maybe Text)
, _oMetadata :: !(Maybe OperationMetadata)
} deriving (Eq,Show,Data,Typeable,Generic)
operation
:: Operation
operation =
Operation'
{ _oDone = Nothing
, _oError = Nothing
, _oResponse = Nothing
, _oName = Nothing
, _oMetadata = Nothing
}
oDone :: Lens' Operation (Maybe Bool)
oDone = lens _oDone (\ s a -> s{_oDone = a})
oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a})
oResponse :: Lens' Operation (Maybe OperationResponse)
oResponse
= lens _oResponse (\ s a -> s{_oResponse = a})
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
oMetadata :: Lens' Operation (Maybe OperationMetadata)
oMetadata
= lens _oMetadata (\ s a -> s{_oMetadata = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "done") <*> (o .:? "error") <*>
(o .:? "response")
<*> (o .:? "name")
<*> (o .:? "metadata"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("done" .=) <$> _oDone, ("error" .=) <$> _oError,
("response" .=) <$> _oResponse,
("name" .=) <$> _oName,
("metadata" .=) <$> _oMetadata])
data ListGroupsResponse = ListGroupsResponse'
{ _lgrGroups :: !(Maybe [Group])
, _lgrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listGroupsResponse
:: ListGroupsResponse
listGroupsResponse =
ListGroupsResponse'
{ _lgrGroups = Nothing
, _lgrNextPageToken = Nothing
}
lgrGroups :: Lens' ListGroupsResponse [Group]
lgrGroups
= lens _lgrGroups (\ s a -> s{_lgrGroups = a}) .
_Default
. _Coerce
lgrNextPageToken :: Lens' ListGroupsResponse (Maybe Text)
lgrNextPageToken
= lens _lgrNextPageToken
(\ s a -> s{_lgrNextPageToken = a})
instance FromJSON ListGroupsResponse where
parseJSON
= withObject "ListGroupsResponse"
(\ o ->
ListGroupsResponse' <$>
(o .:? "groups" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListGroupsResponse where
toJSON ListGroupsResponse'{..}
= object
(catMaybes
[("groups" .=) <$> _lgrGroups,
("nextPageToken" .=) <$> _lgrNextPageToken])
newtype StatusDetailsItem = StatusDetailsItem'
{ _sdiAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
statusDetailsItem
:: HashMap Text JSONValue
-> StatusDetailsItem
statusDetailsItem pSdiAddtional_ =
StatusDetailsItem'
{ _sdiAddtional = _Coerce # pSdiAddtional_
}
sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
sdiAddtional
= lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
. _Coerce
instance FromJSON StatusDetailsItem where
parseJSON
= withObject "StatusDetailsItem"
(\ o -> StatusDetailsItem' <$> (parseJSONObject o))
instance ToJSON StatusDetailsItem where
toJSON = toJSON . _sdiAddtional
newtype MembershipRole = MembershipRole'
{ _mrName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
membershipRole
:: MembershipRole
membershipRole =
MembershipRole'
{ _mrName = Nothing
}
mrName :: Lens' MembershipRole (Maybe Text)
mrName = lens _mrName (\ s a -> s{_mrName = a})
instance FromJSON MembershipRole where
parseJSON
= withObject "MembershipRole"
(\ o -> MembershipRole' <$> (o .:? "name"))
instance ToJSON MembershipRole where
toJSON MembershipRole'{..}
= object (catMaybes [("name" .=) <$> _mrName])
newtype LookupGroupNameResponse = LookupGroupNameResponse'
{ _lgnrName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
lookupGroupNameResponse
:: LookupGroupNameResponse
lookupGroupNameResponse =
LookupGroupNameResponse'
{ _lgnrName = Nothing
}
lgnrName :: Lens' LookupGroupNameResponse (Maybe Text)
lgnrName = lens _lgnrName (\ s a -> s{_lgnrName = a})
instance FromJSON LookupGroupNameResponse where
parseJSON
= withObject "LookupGroupNameResponse"
(\ o -> LookupGroupNameResponse' <$> (o .:? "name"))
instance ToJSON LookupGroupNameResponse where
toJSON LookupGroupNameResponse'{..}
= object (catMaybes [("name" .=) <$> _lgnrName])
data SearchGroupsResponse = SearchGroupsResponse'
{ _sgrGroups :: !(Maybe [Group])
, _sgrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
searchGroupsResponse
:: SearchGroupsResponse
searchGroupsResponse =
SearchGroupsResponse'
{ _sgrGroups = Nothing
, _sgrNextPageToken = Nothing
}
sgrGroups :: Lens' SearchGroupsResponse [Group]
sgrGroups
= lens _sgrGroups (\ s a -> s{_sgrGroups = a}) .
_Default
. _Coerce
sgrNextPageToken :: Lens' SearchGroupsResponse (Maybe Text)
sgrNextPageToken
= lens _sgrNextPageToken
(\ s a -> s{_sgrNextPageToken = a})
instance FromJSON SearchGroupsResponse where
parseJSON
= withObject "SearchGroupsResponse"
(\ o ->
SearchGroupsResponse' <$>
(o .:? "groups" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON SearchGroupsResponse where
toJSON SearchGroupsResponse'{..}
= object
(catMaybes
[("groups" .=) <$> _sgrGroups,
("nextPageToken" .=) <$> _sgrNextPageToken])
data EntityKey = EntityKey'
{ _ekNamespace :: !(Maybe Text)
, _ekId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
entityKey
:: EntityKey
entityKey =
EntityKey'
{ _ekNamespace = Nothing
, _ekId = Nothing
}
ekNamespace :: Lens' EntityKey (Maybe Text)
ekNamespace
= lens _ekNamespace (\ s a -> s{_ekNamespace = a})
ekId :: Lens' EntityKey (Maybe Text)
ekId = lens _ekId (\ s a -> s{_ekId = a})
instance FromJSON EntityKey where
parseJSON
= withObject "EntityKey"
(\ o ->
EntityKey' <$> (o .:? "namespace") <*> (o .:? "id"))
instance ToJSON EntityKey where
toJSON EntityKey'{..}
= object
(catMaybes
[("namespace" .=) <$> _ekNamespace,
("id" .=) <$> _ekId])
newtype GroupLabels = GroupLabels'
{ _glAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
groupLabels
:: HashMap Text Text
-> GroupLabels
groupLabels pGlAddtional_ =
GroupLabels'
{ _glAddtional = _Coerce # pGlAddtional_
}
glAddtional :: Lens' GroupLabels (HashMap Text Text)
glAddtional
= lens _glAddtional (\ s a -> s{_glAddtional = a}) .
_Coerce
instance FromJSON GroupLabels where
parseJSON
= withObject "GroupLabels"
(\ o -> GroupLabels' <$> (parseJSONObject o))
instance ToJSON GroupLabels where
toJSON = toJSON . _glAddtional
data ListMembershipsResponse = ListMembershipsResponse'
{ _lmrNextPageToken :: !(Maybe Text)
, _lmrMemberships :: !(Maybe [Membership])
} deriving (Eq,Show,Data,Typeable,Generic)
listMembershipsResponse
:: ListMembershipsResponse
listMembershipsResponse =
ListMembershipsResponse'
{ _lmrNextPageToken = Nothing
, _lmrMemberships = Nothing
}
lmrNextPageToken :: Lens' ListMembershipsResponse (Maybe Text)
lmrNextPageToken
= lens _lmrNextPageToken
(\ s a -> s{_lmrNextPageToken = a})
lmrMemberships :: Lens' ListMembershipsResponse [Membership]
lmrMemberships
= lens _lmrMemberships
(\ s a -> s{_lmrMemberships = a})
. _Default
. _Coerce
instance FromJSON ListMembershipsResponse where
parseJSON
= withObject "ListMembershipsResponse"
(\ o ->
ListMembershipsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "memberships" .!= mempty))
instance ToJSON ListMembershipsResponse where
toJSON ListMembershipsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lmrNextPageToken,
("memberships" .=) <$> _lmrMemberships])
newtype OperationMetadata = OperationMetadata'
{ _omAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
operationMetadata
:: HashMap Text JSONValue
-> OperationMetadata
operationMetadata pOmAddtional_ =
OperationMetadata'
{ _omAddtional = _Coerce # pOmAddtional_
}
omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
omAddtional
= lens _omAddtional (\ s a -> s{_omAddtional = a}) .
_Coerce
instance FromJSON OperationMetadata where
parseJSON
= withObject "OperationMetadata"
(\ o -> OperationMetadata' <$> (parseJSONObject o))
instance ToJSON OperationMetadata where
toJSON = toJSON . _omAddtional
newtype OperationResponse = OperationResponse'
{ _orAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
operationResponse
:: HashMap Text JSONValue
-> OperationResponse
operationResponse pOrAddtional_ =
OperationResponse'
{ _orAddtional = _Coerce # pOrAddtional_
}
orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
orAddtional
= lens _orAddtional (\ s a -> s{_orAddtional = a}) .
_Coerce
instance FromJSON OperationResponse where
parseJSON
= withObject "OperationResponse"
(\ o -> OperationResponse' <$> (parseJSONObject o))
instance ToJSON OperationResponse where
toJSON = toJSON . _orAddtional