{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.WorkDocs.Types.Product where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.WorkDocs.Types.Sum
data Activity = Activity'
{ _aResourceMetadata :: !(Maybe ResourceMetadata)
, _aInitiator :: !(Maybe UserMetadata)
, _aParticipants :: !(Maybe Participants)
, _aOriginalParent :: !(Maybe ResourceMetadata)
, _aType :: !(Maybe ActivityType)
, _aCommentMetadata :: !(Maybe CommentMetadata)
, _aTimeStamp :: !(Maybe POSIX)
, _aOrganizationId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
activity
:: Activity
activity =
Activity'
{ _aResourceMetadata = Nothing
, _aInitiator = Nothing
, _aParticipants = Nothing
, _aOriginalParent = Nothing
, _aType = Nothing
, _aCommentMetadata = Nothing
, _aTimeStamp = Nothing
, _aOrganizationId = Nothing
}
aResourceMetadata :: Lens' Activity (Maybe ResourceMetadata)
aResourceMetadata = lens _aResourceMetadata (\ s a -> s{_aResourceMetadata = a})
aInitiator :: Lens' Activity (Maybe UserMetadata)
aInitiator = lens _aInitiator (\ s a -> s{_aInitiator = a})
aParticipants :: Lens' Activity (Maybe Participants)
aParticipants = lens _aParticipants (\ s a -> s{_aParticipants = a})
aOriginalParent :: Lens' Activity (Maybe ResourceMetadata)
aOriginalParent = lens _aOriginalParent (\ s a -> s{_aOriginalParent = a})
aType :: Lens' Activity (Maybe ActivityType)
aType = lens _aType (\ s a -> s{_aType = a})
aCommentMetadata :: Lens' Activity (Maybe CommentMetadata)
aCommentMetadata = lens _aCommentMetadata (\ s a -> s{_aCommentMetadata = a})
aTimeStamp :: Lens' Activity (Maybe UTCTime)
aTimeStamp = lens _aTimeStamp (\ s a -> s{_aTimeStamp = a}) . mapping _Time
aOrganizationId :: Lens' Activity (Maybe Text)
aOrganizationId = lens _aOrganizationId (\ s a -> s{_aOrganizationId = a})
instance FromJSON Activity where
parseJSON
= withObject "Activity"
(\ x ->
Activity' <$>
(x .:? "ResourceMetadata") <*> (x .:? "Initiator")
<*> (x .:? "Participants")
<*> (x .:? "OriginalParent")
<*> (x .:? "Type")
<*> (x .:? "CommentMetadata")
<*> (x .:? "TimeStamp")
<*> (x .:? "OrganizationId"))
instance Hashable Activity where
instance NFData Activity where
data Comment = Comment'
{ _cStatus :: !(Maybe CommentStatusType)
, _cText :: !(Maybe (Sensitive Text))
, _cVisibility :: !(Maybe CommentVisibilityType)
, _cThreadId :: !(Maybe Text)
, _cContributor :: !(Maybe User)
, _cCreatedTimestamp :: !(Maybe POSIX)
, _cRecipientId :: !(Maybe Text)
, _cParentId :: !(Maybe Text)
, _cCommentId :: !Text
} deriving (Eq, Show, Data, Typeable, Generic)
comment
:: Text
-> Comment
comment pCommentId_ =
Comment'
{ _cStatus = Nothing
, _cText = Nothing
, _cVisibility = Nothing
, _cThreadId = Nothing
, _cContributor = Nothing
, _cCreatedTimestamp = Nothing
, _cRecipientId = Nothing
, _cParentId = Nothing
, _cCommentId = pCommentId_
}
cStatus :: Lens' Comment (Maybe CommentStatusType)
cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
cText :: Lens' Comment (Maybe Text)
cText = lens _cText (\ s a -> s{_cText = a}) . mapping _Sensitive
cVisibility :: Lens' Comment (Maybe CommentVisibilityType)
cVisibility = lens _cVisibility (\ s a -> s{_cVisibility = a})
cThreadId :: Lens' Comment (Maybe Text)
cThreadId = lens _cThreadId (\ s a -> s{_cThreadId = a})
cContributor :: Lens' Comment (Maybe User)
cContributor = lens _cContributor (\ s a -> s{_cContributor = a})
cCreatedTimestamp :: Lens' Comment (Maybe UTCTime)
cCreatedTimestamp = lens _cCreatedTimestamp (\ s a -> s{_cCreatedTimestamp = a}) . mapping _Time
cRecipientId :: Lens' Comment (Maybe Text)
cRecipientId = lens _cRecipientId (\ s a -> s{_cRecipientId = a})
cParentId :: Lens' Comment (Maybe Text)
cParentId = lens _cParentId (\ s a -> s{_cParentId = a})
cCommentId :: Lens' Comment Text
cCommentId = lens _cCommentId (\ s a -> s{_cCommentId = a})
instance FromJSON Comment where
parseJSON
= withObject "Comment"
(\ x ->
Comment' <$>
(x .:? "Status") <*> (x .:? "Text") <*>
(x .:? "Visibility")
<*> (x .:? "ThreadId")
<*> (x .:? "Contributor")
<*> (x .:? "CreatedTimestamp")
<*> (x .:? "RecipientId")
<*> (x .:? "ParentId")
<*> (x .: "CommentId"))
instance Hashable Comment where
instance NFData Comment where
data CommentMetadata = CommentMetadata'
{ _cmCommentStatus :: !(Maybe CommentStatusType)
, _cmContributor :: !(Maybe User)
, _cmCommentId :: !(Maybe Text)
, _cmCreatedTimestamp :: !(Maybe POSIX)
, _cmRecipientId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
commentMetadata
:: CommentMetadata
commentMetadata =
CommentMetadata'
{ _cmCommentStatus = Nothing
, _cmContributor = Nothing
, _cmCommentId = Nothing
, _cmCreatedTimestamp = Nothing
, _cmRecipientId = Nothing
}
cmCommentStatus :: Lens' CommentMetadata (Maybe CommentStatusType)
cmCommentStatus = lens _cmCommentStatus (\ s a -> s{_cmCommentStatus = a})
cmContributor :: Lens' CommentMetadata (Maybe User)
cmContributor = lens _cmContributor (\ s a -> s{_cmContributor = a})
cmCommentId :: Lens' CommentMetadata (Maybe Text)
cmCommentId = lens _cmCommentId (\ s a -> s{_cmCommentId = a})
cmCreatedTimestamp :: Lens' CommentMetadata (Maybe UTCTime)
cmCreatedTimestamp = lens _cmCreatedTimestamp (\ s a -> s{_cmCreatedTimestamp = a}) . mapping _Time
cmRecipientId :: Lens' CommentMetadata (Maybe Text)
cmRecipientId = lens _cmRecipientId (\ s a -> s{_cmRecipientId = a})
instance FromJSON CommentMetadata where
parseJSON
= withObject "CommentMetadata"
(\ x ->
CommentMetadata' <$>
(x .:? "CommentStatus") <*> (x .:? "Contributor") <*>
(x .:? "CommentId")
<*> (x .:? "CreatedTimestamp")
<*> (x .:? "RecipientId"))
instance Hashable CommentMetadata where
instance NFData CommentMetadata where
data DocumentMetadata = DocumentMetadata'
{ _dmLatestVersionMetadata :: !(Maybe DocumentVersionMetadata)
, _dmParentFolderId :: !(Maybe Text)
, _dmModifiedTimestamp :: !(Maybe POSIX)
, _dmId :: !(Maybe Text)
, _dmLabels :: !(Maybe [Text])
, _dmResourceState :: !(Maybe ResourceStateType)
, _dmCreatedTimestamp :: !(Maybe POSIX)
, _dmCreatorId :: !(Maybe Text)
} deriving (Eq, Show, Data, Typeable, Generic)
documentMetadata
:: DocumentMetadata
documentMetadata =
DocumentMetadata'
{ _dmLatestVersionMetadata = Nothing
, _dmParentFolderId = Nothing
, _dmModifiedTimestamp = Nothing
, _dmId = Nothing
, _dmLabels = Nothing
, _dmResourceState = Nothing
, _dmCreatedTimestamp = Nothing
, _dmCreatorId = Nothing
}
dmLatestVersionMetadata :: Lens' DocumentMetadata (Maybe DocumentVersionMetadata)
dmLatestVersionMetadata = lens _dmLatestVersionMetadata (\ s a -> s{_dmLatestVersionMetadata = a})
dmParentFolderId :: Lens' DocumentMetadata (Maybe Text)
dmParentFolderId = lens _dmParentFolderId (\ s a -> s{_dmParentFolderId = a})
dmModifiedTimestamp :: Lens' DocumentMetadata (Maybe UTCTime)
dmModifiedTimestamp = lens _dmModifiedTimestamp (\ s a -> s{_dmModifiedTimestamp = a}) . mapping _Time
dmId :: Lens' DocumentMetadata (Maybe Text)
dmId = lens _dmId (\ s a -> s{_dmId = a})
dmLabels :: Lens' DocumentMetadata [Text]
dmLabels = lens _dmLabels (\ s a -> s{_dmLabels = a}) . _Default . _Coerce
dmResourceState :: Lens' DocumentMetadata (Maybe ResourceStateType)
dmResourceState = lens _dmResourceState (\ s a -> s{_dmResourceState = a})
dmCreatedTimestamp :: Lens' DocumentMetadata (Maybe UTCTime)
dmCreatedTimestamp = lens _dmCreatedTimestamp (\ s a -> s{_dmCreatedTimestamp = a}) . mapping _Time
dmCreatorId :: Lens' DocumentMetadata (Maybe Text)
dmCreatorId = lens _dmCreatorId (\ s a -> s{_dmCreatorId = a})
instance FromJSON DocumentMetadata where
parseJSON
= withObject "DocumentMetadata"
(\ x ->
DocumentMetadata' <$>
(x .:? "LatestVersionMetadata") <*>
(x .:? "ParentFolderId")
<*> (x .:? "ModifiedTimestamp")
<*> (x .:? "Id")
<*> (x .:? "Labels" .!= mempty)
<*> (x .:? "ResourceState")
<*> (x .:? "CreatedTimestamp")
<*> (x .:? "CreatorId"))
instance Hashable DocumentMetadata where
instance NFData DocumentMetadata where
data DocumentVersionMetadata = DocumentVersionMetadata'
{ _dvmThumbnail :: !(Maybe (Map DocumentThumbnailType (Sensitive Text)))
, _dvmStatus :: !(Maybe DocumentStatusType)
, _dvmSignature :: !(Maybe Text)
, _dvmContentCreatedTimestamp :: !(Maybe POSIX)
, _dvmSize :: !(Maybe Integer)
, _dvmName :: !(Maybe Text)
, _dvmModifiedTimestamp :: !(Maybe POSIX)
, _dvmSource :: !(Maybe (Map DocumentSourceType (Sensitive Text)))
, _dvmId :: !(Maybe Text)
, _dvmCreatedTimestamp :: !(Maybe POSIX)
, _dvmContentModifiedTimestamp :: !(Maybe POSIX)
, _dvmCreatorId :: !(Maybe Text)
, _dvmContentType :: !(Maybe Text)
} deriving (Eq, Show, Data, Typeable, Generic)
documentVersionMetadata
:: DocumentVersionMetadata
documentVersionMetadata =
DocumentVersionMetadata'
{ _dvmThumbnail = Nothing
, _dvmStatus = Nothing
, _dvmSignature = Nothing
, _dvmContentCreatedTimestamp = Nothing
, _dvmSize = Nothing
, _dvmName = Nothing
, _dvmModifiedTimestamp = Nothing
, _dvmSource = Nothing
, _dvmId = Nothing
, _dvmCreatedTimestamp = Nothing
, _dvmContentModifiedTimestamp = Nothing
, _dvmCreatorId = Nothing
, _dvmContentType = Nothing
}
dvmThumbnail :: Lens' DocumentVersionMetadata (HashMap DocumentThumbnailType Text)
dvmThumbnail = lens _dvmThumbnail (\ s a -> s{_dvmThumbnail = a}) . _Default . _Map
dvmStatus :: Lens' DocumentVersionMetadata (Maybe DocumentStatusType)
dvmStatus = lens _dvmStatus (\ s a -> s{_dvmStatus = a})
dvmSignature :: Lens' DocumentVersionMetadata (Maybe Text)
dvmSignature = lens _dvmSignature (\ s a -> s{_dvmSignature = a})
dvmContentCreatedTimestamp :: Lens' DocumentVersionMetadata (Maybe UTCTime)
dvmContentCreatedTimestamp = lens _dvmContentCreatedTimestamp (\ s a -> s{_dvmContentCreatedTimestamp = a}) . mapping _Time
dvmSize :: Lens' DocumentVersionMetadata (Maybe Integer)
dvmSize = lens _dvmSize (\ s a -> s{_dvmSize = a})
dvmName :: Lens' DocumentVersionMetadata (Maybe Text)
dvmName = lens _dvmName (\ s a -> s{_dvmName = a})
dvmModifiedTimestamp :: Lens' DocumentVersionMetadata (Maybe UTCTime)
dvmModifiedTimestamp = lens _dvmModifiedTimestamp (\ s a -> s{_dvmModifiedTimestamp = a}) . mapping _Time
dvmSource :: Lens' DocumentVersionMetadata (HashMap DocumentSourceType Text)
dvmSource = lens _dvmSource (\ s a -> s{_dvmSource = a}) . _Default . _Map
dvmId :: Lens' DocumentVersionMetadata (Maybe Text)
dvmId = lens _dvmId (\ s a -> s{_dvmId = a})
dvmCreatedTimestamp :: Lens' DocumentVersionMetadata (Maybe UTCTime)
dvmCreatedTimestamp = lens _dvmCreatedTimestamp (\ s a -> s{_dvmCreatedTimestamp = a}) . mapping _Time
dvmContentModifiedTimestamp :: Lens' DocumentVersionMetadata (Maybe UTCTime)
dvmContentModifiedTimestamp = lens _dvmContentModifiedTimestamp (\ s a -> s{_dvmContentModifiedTimestamp = a}) . mapping _Time
dvmCreatorId :: Lens' DocumentVersionMetadata (Maybe Text)
dvmCreatorId = lens _dvmCreatorId (\ s a -> s{_dvmCreatorId = a})
dvmContentType :: Lens' DocumentVersionMetadata (Maybe Text)
dvmContentType = lens _dvmContentType (\ s a -> s{_dvmContentType = a})
instance FromJSON DocumentVersionMetadata where
parseJSON
= withObject "DocumentVersionMetadata"
(\ x ->
DocumentVersionMetadata' <$>
(x .:? "Thumbnail" .!= mempty) <*> (x .:? "Status")
<*> (x .:? "Signature")
<*> (x .:? "ContentCreatedTimestamp")
<*> (x .:? "Size")
<*> (x .:? "Name")
<*> (x .:? "ModifiedTimestamp")
<*> (x .:? "Source" .!= mempty)
<*> (x .:? "Id")
<*> (x .:? "CreatedTimestamp")
<*> (x .:? "ContentModifiedTimestamp")
<*> (x .:? "CreatorId")
<*> (x .:? "ContentType"))
instance Hashable DocumentVersionMetadata where
instance NFData DocumentVersionMetadata where
data FolderMetadata = FolderMetadata'
{ _fmSignature :: !(Maybe Text)
, _fmParentFolderId :: !(Maybe Text)
, _fmSize :: !(Maybe Integer)
, _fmLatestVersionSize :: !(Maybe Integer)
, _fmName :: !(Maybe Text)
, _fmModifiedTimestamp :: !(Maybe POSIX)
, _fmId :: !(Maybe Text)
, _fmLabels :: !(Maybe [Text])
, _fmResourceState :: !(Maybe ResourceStateType)
, _fmCreatedTimestamp :: !(Maybe POSIX)
, _fmCreatorId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
folderMetadata
:: FolderMetadata
folderMetadata =
FolderMetadata'
{ _fmSignature = Nothing
, _fmParentFolderId = Nothing
, _fmSize = Nothing
, _fmLatestVersionSize = Nothing
, _fmName = Nothing
, _fmModifiedTimestamp = Nothing
, _fmId = Nothing
, _fmLabels = Nothing
, _fmResourceState = Nothing
, _fmCreatedTimestamp = Nothing
, _fmCreatorId = Nothing
}
fmSignature :: Lens' FolderMetadata (Maybe Text)
fmSignature = lens _fmSignature (\ s a -> s{_fmSignature = a})
fmParentFolderId :: Lens' FolderMetadata (Maybe Text)
fmParentFolderId = lens _fmParentFolderId (\ s a -> s{_fmParentFolderId = a})
fmSize :: Lens' FolderMetadata (Maybe Integer)
fmSize = lens _fmSize (\ s a -> s{_fmSize = a})
fmLatestVersionSize :: Lens' FolderMetadata (Maybe Integer)
fmLatestVersionSize = lens _fmLatestVersionSize (\ s a -> s{_fmLatestVersionSize = a})
fmName :: Lens' FolderMetadata (Maybe Text)
fmName = lens _fmName (\ s a -> s{_fmName = a})
fmModifiedTimestamp :: Lens' FolderMetadata (Maybe UTCTime)
fmModifiedTimestamp = lens _fmModifiedTimestamp (\ s a -> s{_fmModifiedTimestamp = a}) . mapping _Time
fmId :: Lens' FolderMetadata (Maybe Text)
fmId = lens _fmId (\ s a -> s{_fmId = a})
fmLabels :: Lens' FolderMetadata [Text]
fmLabels = lens _fmLabels (\ s a -> s{_fmLabels = a}) . _Default . _Coerce
fmResourceState :: Lens' FolderMetadata (Maybe ResourceStateType)
fmResourceState = lens _fmResourceState (\ s a -> s{_fmResourceState = a})
fmCreatedTimestamp :: Lens' FolderMetadata (Maybe UTCTime)
fmCreatedTimestamp = lens _fmCreatedTimestamp (\ s a -> s{_fmCreatedTimestamp = a}) . mapping _Time
fmCreatorId :: Lens' FolderMetadata (Maybe Text)
fmCreatorId = lens _fmCreatorId (\ s a -> s{_fmCreatorId = a})
instance FromJSON FolderMetadata where
parseJSON
= withObject "FolderMetadata"
(\ x ->
FolderMetadata' <$>
(x .:? "Signature") <*> (x .:? "ParentFolderId") <*>
(x .:? "Size")
<*> (x .:? "LatestVersionSize")
<*> (x .:? "Name")
<*> (x .:? "ModifiedTimestamp")
<*> (x .:? "Id")
<*> (x .:? "Labels" .!= mempty)
<*> (x .:? "ResourceState")
<*> (x .:? "CreatedTimestamp")
<*> (x .:? "CreatorId"))
instance Hashable FolderMetadata where
instance NFData FolderMetadata where
data GroupMetadata = GroupMetadata'
{ _gmName :: !(Maybe Text)
, _gmId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
groupMetadata
:: GroupMetadata
groupMetadata = GroupMetadata' {_gmName = Nothing, _gmId = Nothing}
gmName :: Lens' GroupMetadata (Maybe Text)
gmName = lens _gmName (\ s a -> s{_gmName = a})
gmId :: Lens' GroupMetadata (Maybe Text)
gmId = lens _gmId (\ s a -> s{_gmId = a})
instance FromJSON GroupMetadata where
parseJSON
= withObject "GroupMetadata"
(\ x ->
GroupMetadata' <$> (x .:? "Name") <*> (x .:? "Id"))
instance Hashable GroupMetadata where
instance NFData GroupMetadata where
data NotificationOptions = NotificationOptions'
{ _noEmailMessage :: !(Maybe (Sensitive Text))
, _noSendEmail :: !(Maybe Bool)
} deriving (Eq, Show, Data, Typeable, Generic)
notificationOptions
:: NotificationOptions
notificationOptions =
NotificationOptions' {_noEmailMessage = Nothing, _noSendEmail = Nothing}
noEmailMessage :: Lens' NotificationOptions (Maybe Text)
noEmailMessage = lens _noEmailMessage (\ s a -> s{_noEmailMessage = a}) . mapping _Sensitive
noSendEmail :: Lens' NotificationOptions (Maybe Bool)
noSendEmail = lens _noSendEmail (\ s a -> s{_noSendEmail = a})
instance Hashable NotificationOptions where
instance NFData NotificationOptions where
instance ToJSON NotificationOptions where
toJSON NotificationOptions'{..}
= object
(catMaybes
[("EmailMessage" .=) <$> _noEmailMessage,
("SendEmail" .=) <$> _noSendEmail])
data Participants = Participants'
{ _pGroups :: !(Maybe [GroupMetadata])
, _pUsers :: !(Maybe [UserMetadata])
} deriving (Eq, Read, Show, Data, Typeable, Generic)
participants
:: Participants
participants = Participants' {_pGroups = Nothing, _pUsers = Nothing}
pGroups :: Lens' Participants [GroupMetadata]
pGroups = lens _pGroups (\ s a -> s{_pGroups = a}) . _Default . _Coerce
pUsers :: Lens' Participants [UserMetadata]
pUsers = lens _pUsers (\ s a -> s{_pUsers = a}) . _Default . _Coerce
instance FromJSON Participants where
parseJSON
= withObject "Participants"
(\ x ->
Participants' <$>
(x .:? "Groups" .!= mempty) <*>
(x .:? "Users" .!= mempty))
instance Hashable Participants where
instance NFData Participants where
data PermissionInfo = PermissionInfo'
{ _piRole :: !(Maybe RoleType)
, _piType :: !(Maybe RolePermissionType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
permissionInfo
:: PermissionInfo
permissionInfo = PermissionInfo' {_piRole = Nothing, _piType = Nothing}
piRole :: Lens' PermissionInfo (Maybe RoleType)
piRole = lens _piRole (\ s a -> s{_piRole = a})
piType :: Lens' PermissionInfo (Maybe RolePermissionType)
piType = lens _piType (\ s a -> s{_piType = a})
instance FromJSON PermissionInfo where
parseJSON
= withObject "PermissionInfo"
(\ x ->
PermissionInfo' <$>
(x .:? "Role") <*> (x .:? "Type"))
instance Hashable PermissionInfo where
instance NFData PermissionInfo where
data Principal = Principal'
{ _pRoles :: !(Maybe [PermissionInfo])
, _pId :: !(Maybe Text)
, _pType :: !(Maybe PrincipalType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
principal
:: Principal
principal = Principal' {_pRoles = Nothing, _pId = Nothing, _pType = Nothing}
pRoles :: Lens' Principal [PermissionInfo]
pRoles = lens _pRoles (\ s a -> s{_pRoles = a}) . _Default . _Coerce
pId :: Lens' Principal (Maybe Text)
pId = lens _pId (\ s a -> s{_pId = a})
pType :: Lens' Principal (Maybe PrincipalType)
pType = lens _pType (\ s a -> s{_pType = a})
instance FromJSON Principal where
parseJSON
= withObject "Principal"
(\ x ->
Principal' <$>
(x .:? "Roles" .!= mempty) <*> (x .:? "Id") <*>
(x .:? "Type"))
instance Hashable Principal where
instance NFData Principal where
data ResourceMetadata = ResourceMetadata'
{ _rmVersionId :: !(Maybe Text)
, _rmOwner :: !(Maybe UserMetadata)
, _rmName :: !(Maybe Text)
, _rmId :: !(Maybe Text)
, _rmType :: !(Maybe ResourceType)
, _rmOriginalName :: !(Maybe Text)
, _rmParentId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resourceMetadata
:: ResourceMetadata
resourceMetadata =
ResourceMetadata'
{ _rmVersionId = Nothing
, _rmOwner = Nothing
, _rmName = Nothing
, _rmId = Nothing
, _rmType = Nothing
, _rmOriginalName = Nothing
, _rmParentId = Nothing
}
rmVersionId :: Lens' ResourceMetadata (Maybe Text)
rmVersionId = lens _rmVersionId (\ s a -> s{_rmVersionId = a})
rmOwner :: Lens' ResourceMetadata (Maybe UserMetadata)
rmOwner = lens _rmOwner (\ s a -> s{_rmOwner = a})
rmName :: Lens' ResourceMetadata (Maybe Text)
rmName = lens _rmName (\ s a -> s{_rmName = a})
rmId :: Lens' ResourceMetadata (Maybe Text)
rmId = lens _rmId (\ s a -> s{_rmId = a})
rmType :: Lens' ResourceMetadata (Maybe ResourceType)
rmType = lens _rmType (\ s a -> s{_rmType = a})
rmOriginalName :: Lens' ResourceMetadata (Maybe Text)
rmOriginalName = lens _rmOriginalName (\ s a -> s{_rmOriginalName = a})
rmParentId :: Lens' ResourceMetadata (Maybe Text)
rmParentId = lens _rmParentId (\ s a -> s{_rmParentId = a})
instance FromJSON ResourceMetadata where
parseJSON
= withObject "ResourceMetadata"
(\ x ->
ResourceMetadata' <$>
(x .:? "VersionId") <*> (x .:? "Owner") <*>
(x .:? "Name")
<*> (x .:? "Id")
<*> (x .:? "Type")
<*> (x .:? "OriginalName")
<*> (x .:? "ParentId"))
instance Hashable ResourceMetadata where
instance NFData ResourceMetadata where
newtype ResourcePath = ResourcePath'
{ _rpComponents :: Maybe [ResourcePathComponent]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resourcePath
:: ResourcePath
resourcePath = ResourcePath' {_rpComponents = Nothing}
rpComponents :: Lens' ResourcePath [ResourcePathComponent]
rpComponents = lens _rpComponents (\ s a -> s{_rpComponents = a}) . _Default . _Coerce
instance FromJSON ResourcePath where
parseJSON
= withObject "ResourcePath"
(\ x ->
ResourcePath' <$> (x .:? "Components" .!= mempty))
instance Hashable ResourcePath where
instance NFData ResourcePath where
data ResourcePathComponent = ResourcePathComponent'
{ _rpcName :: !(Maybe Text)
, _rpcId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
resourcePathComponent
:: ResourcePathComponent
resourcePathComponent =
ResourcePathComponent' {_rpcName = Nothing, _rpcId = Nothing}
rpcName :: Lens' ResourcePathComponent (Maybe Text)
rpcName = lens _rpcName (\ s a -> s{_rpcName = a})
rpcId :: Lens' ResourcePathComponent (Maybe Text)
rpcId = lens _rpcId (\ s a -> s{_rpcId = a})
instance FromJSON ResourcePathComponent where
parseJSON
= withObject "ResourcePathComponent"
(\ x ->
ResourcePathComponent' <$>
(x .:? "Name") <*> (x .:? "Id"))
instance Hashable ResourcePathComponent where
instance NFData ResourcePathComponent where
data SharePrincipal = SharePrincipal'
{ _spId :: !Text
, _spType :: !PrincipalType
, _spRole :: !RoleType
} deriving (Eq, Read, Show, Data, Typeable, Generic)
sharePrincipal
:: Text
-> PrincipalType
-> RoleType
-> SharePrincipal
sharePrincipal pId_ pType_ pRole_ =
SharePrincipal' {_spId = pId_, _spType = pType_, _spRole = pRole_}
spId :: Lens' SharePrincipal Text
spId = lens _spId (\ s a -> s{_spId = a})
spType :: Lens' SharePrincipal PrincipalType
spType = lens _spType (\ s a -> s{_spType = a})
spRole :: Lens' SharePrincipal RoleType
spRole = lens _spRole (\ s a -> s{_spRole = a})
instance Hashable SharePrincipal where
instance NFData SharePrincipal where
instance ToJSON SharePrincipal where
toJSON SharePrincipal'{..}
= object
(catMaybes
[Just ("Id" .= _spId), Just ("Type" .= _spType),
Just ("Role" .= _spRole)])
data ShareResult = ShareResult'
{ _srStatus :: !(Maybe ShareStatusType)
, _srPrincipalId :: !(Maybe Text)
, _srRole :: !(Maybe RoleType)
, _srStatusMessage :: !(Maybe (Sensitive Text))
, _srShareId :: !(Maybe Text)
} deriving (Eq, Show, Data, Typeable, Generic)
shareResult
:: ShareResult
shareResult =
ShareResult'
{ _srStatus = Nothing
, _srPrincipalId = Nothing
, _srRole = Nothing
, _srStatusMessage = Nothing
, _srShareId = Nothing
}
srStatus :: Lens' ShareResult (Maybe ShareStatusType)
srStatus = lens _srStatus (\ s a -> s{_srStatus = a})
srPrincipalId :: Lens' ShareResult (Maybe Text)
srPrincipalId = lens _srPrincipalId (\ s a -> s{_srPrincipalId = a})
srRole :: Lens' ShareResult (Maybe RoleType)
srRole = lens _srRole (\ s a -> s{_srRole = a})
srStatusMessage :: Lens' ShareResult (Maybe Text)
srStatusMessage = lens _srStatusMessage (\ s a -> s{_srStatusMessage = a}) . mapping _Sensitive
srShareId :: Lens' ShareResult (Maybe Text)
srShareId = lens _srShareId (\ s a -> s{_srShareId = a})
instance FromJSON ShareResult where
parseJSON
= withObject "ShareResult"
(\ x ->
ShareResult' <$>
(x .:? "Status") <*> (x .:? "PrincipalId") <*>
(x .:? "Role")
<*> (x .:? "StatusMessage")
<*> (x .:? "ShareId"))
instance Hashable ShareResult where
instance NFData ShareResult where
data StorageRuleType = StorageRuleType'
{ _srtStorageAllocatedInBytes :: !(Maybe Nat)
, _srtStorageType :: !(Maybe StorageType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
storageRuleType
:: StorageRuleType
storageRuleType =
StorageRuleType'
{_srtStorageAllocatedInBytes = Nothing, _srtStorageType = Nothing}
srtStorageAllocatedInBytes :: Lens' StorageRuleType (Maybe Natural)
srtStorageAllocatedInBytes = lens _srtStorageAllocatedInBytes (\ s a -> s{_srtStorageAllocatedInBytes = a}) . mapping _Nat
srtStorageType :: Lens' StorageRuleType (Maybe StorageType)
srtStorageType = lens _srtStorageType (\ s a -> s{_srtStorageType = a})
instance FromJSON StorageRuleType where
parseJSON
= withObject "StorageRuleType"
(\ x ->
StorageRuleType' <$>
(x .:? "StorageAllocatedInBytes") <*>
(x .:? "StorageType"))
instance Hashable StorageRuleType where
instance NFData StorageRuleType where
instance ToJSON StorageRuleType where
toJSON StorageRuleType'{..}
= object
(catMaybes
[("StorageAllocatedInBytes" .=) <$>
_srtStorageAllocatedInBytes,
("StorageType" .=) <$> _srtStorageType])
data Subscription = Subscription'
{ _sProtocol :: !(Maybe SubscriptionProtocolType)
, _sEndPoint :: !(Maybe Text)
, _sSubscriptionId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
subscription
:: Subscription
subscription =
Subscription'
{_sProtocol = Nothing, _sEndPoint = Nothing, _sSubscriptionId = Nothing}
sProtocol :: Lens' Subscription (Maybe SubscriptionProtocolType)
sProtocol = lens _sProtocol (\ s a -> s{_sProtocol = a})
sEndPoint :: Lens' Subscription (Maybe Text)
sEndPoint = lens _sEndPoint (\ s a -> s{_sEndPoint = a})
sSubscriptionId :: Lens' Subscription (Maybe Text)
sSubscriptionId = lens _sSubscriptionId (\ s a -> s{_sSubscriptionId = a})
instance FromJSON Subscription where
parseJSON
= withObject "Subscription"
(\ x ->
Subscription' <$>
(x .:? "Protocol") <*> (x .:? "EndPoint") <*>
(x .:? "SubscriptionId"))
instance Hashable Subscription where
instance NFData Subscription where
data UploadMetadata = UploadMetadata'
{ _umUploadURL :: !(Maybe (Sensitive Text))
, _umSignedHeaders :: !(Maybe (Map Text Text))
} deriving (Eq, Show, Data, Typeable, Generic)
uploadMetadata
:: UploadMetadata
uploadMetadata =
UploadMetadata' {_umUploadURL = Nothing, _umSignedHeaders = Nothing}
umUploadURL :: Lens' UploadMetadata (Maybe Text)
umUploadURL = lens _umUploadURL (\ s a -> s{_umUploadURL = a}) . mapping _Sensitive
umSignedHeaders :: Lens' UploadMetadata (HashMap Text Text)
umSignedHeaders = lens _umSignedHeaders (\ s a -> s{_umSignedHeaders = a}) . _Default . _Map
instance FromJSON UploadMetadata where
parseJSON
= withObject "UploadMetadata"
(\ x ->
UploadMetadata' <$>
(x .:? "UploadUrl") <*>
(x .:? "SignedHeaders" .!= mempty))
instance Hashable UploadMetadata where
instance NFData UploadMetadata where
data User = User'
{ _uGivenName :: !(Maybe Text)
, _uStatus :: !(Maybe UserStatusType)
, _uLocale :: !(Maybe LocaleType)
, _uUsername :: !(Maybe Text)
, _uStorage :: !(Maybe UserStorageMetadata)
, _uModifiedTimestamp :: !(Maybe POSIX)
, _uEmailAddress :: !(Maybe Text)
, _uId :: !(Maybe Text)
, _uRootFolderId :: !(Maybe Text)
, _uType :: !(Maybe UserType)
, _uSurname :: !(Maybe Text)
, _uTimeZoneId :: !(Maybe Text)
, _uCreatedTimestamp :: !(Maybe POSIX)
, _uOrganizationId :: !(Maybe Text)
, _uRecycleBinFolderId :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
user
:: User
user =
User'
{ _uGivenName = Nothing
, _uStatus = Nothing
, _uLocale = Nothing
, _uUsername = Nothing
, _uStorage = Nothing
, _uModifiedTimestamp = Nothing
, _uEmailAddress = Nothing
, _uId = Nothing
, _uRootFolderId = Nothing
, _uType = Nothing
, _uSurname = Nothing
, _uTimeZoneId = Nothing
, _uCreatedTimestamp = Nothing
, _uOrganizationId = Nothing
, _uRecycleBinFolderId = Nothing
}
uGivenName :: Lens' User (Maybe Text)
uGivenName = lens _uGivenName (\ s a -> s{_uGivenName = a})
uStatus :: Lens' User (Maybe UserStatusType)
uStatus = lens _uStatus (\ s a -> s{_uStatus = a})
uLocale :: Lens' User (Maybe LocaleType)
uLocale = lens _uLocale (\ s a -> s{_uLocale = a})
uUsername :: Lens' User (Maybe Text)
uUsername = lens _uUsername (\ s a -> s{_uUsername = a})
uStorage :: Lens' User (Maybe UserStorageMetadata)
uStorage = lens _uStorage (\ s a -> s{_uStorage = a})
uModifiedTimestamp :: Lens' User (Maybe UTCTime)
uModifiedTimestamp = lens _uModifiedTimestamp (\ s a -> s{_uModifiedTimestamp = a}) . mapping _Time
uEmailAddress :: Lens' User (Maybe Text)
uEmailAddress = lens _uEmailAddress (\ s a -> s{_uEmailAddress = a})
uId :: Lens' User (Maybe Text)
uId = lens _uId (\ s a -> s{_uId = a})
uRootFolderId :: Lens' User (Maybe Text)
uRootFolderId = lens _uRootFolderId (\ s a -> s{_uRootFolderId = a})
uType :: Lens' User (Maybe UserType)
uType = lens _uType (\ s a -> s{_uType = a})
uSurname :: Lens' User (Maybe Text)
uSurname = lens _uSurname (\ s a -> s{_uSurname = a})
uTimeZoneId :: Lens' User (Maybe Text)
uTimeZoneId = lens _uTimeZoneId (\ s a -> s{_uTimeZoneId = a})
uCreatedTimestamp :: Lens' User (Maybe UTCTime)
uCreatedTimestamp = lens _uCreatedTimestamp (\ s a -> s{_uCreatedTimestamp = a}) . mapping _Time
uOrganizationId :: Lens' User (Maybe Text)
uOrganizationId = lens _uOrganizationId (\ s a -> s{_uOrganizationId = a})
uRecycleBinFolderId :: Lens' User (Maybe Text)
uRecycleBinFolderId = lens _uRecycleBinFolderId (\ s a -> s{_uRecycleBinFolderId = a})
instance FromJSON User where
parseJSON
= withObject "User"
(\ x ->
User' <$>
(x .:? "GivenName") <*> (x .:? "Status") <*>
(x .:? "Locale")
<*> (x .:? "Username")
<*> (x .:? "Storage")
<*> (x .:? "ModifiedTimestamp")
<*> (x .:? "EmailAddress")
<*> (x .:? "Id")
<*> (x .:? "RootFolderId")
<*> (x .:? "Type")
<*> (x .:? "Surname")
<*> (x .:? "TimeZoneId")
<*> (x .:? "CreatedTimestamp")
<*> (x .:? "OrganizationId")
<*> (x .:? "RecycleBinFolderId"))
instance Hashable User where
instance NFData User where
data UserMetadata = UserMetadata'
{ _umGivenName :: !(Maybe Text)
, _umUsername :: !(Maybe Text)
, _umEmailAddress :: !(Maybe Text)
, _umId :: !(Maybe Text)
, _umSurname :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
userMetadata
:: UserMetadata
userMetadata =
UserMetadata'
{ _umGivenName = Nothing
, _umUsername = Nothing
, _umEmailAddress = Nothing
, _umId = Nothing
, _umSurname = Nothing
}
umGivenName :: Lens' UserMetadata (Maybe Text)
umGivenName = lens _umGivenName (\ s a -> s{_umGivenName = a})
umUsername :: Lens' UserMetadata (Maybe Text)
umUsername = lens _umUsername (\ s a -> s{_umUsername = a})
umEmailAddress :: Lens' UserMetadata (Maybe Text)
umEmailAddress = lens _umEmailAddress (\ s a -> s{_umEmailAddress = a})
umId :: Lens' UserMetadata (Maybe Text)
umId = lens _umId (\ s a -> s{_umId = a})
umSurname :: Lens' UserMetadata (Maybe Text)
umSurname = lens _umSurname (\ s a -> s{_umSurname = a})
instance FromJSON UserMetadata where
parseJSON
= withObject "UserMetadata"
(\ x ->
UserMetadata' <$>
(x .:? "GivenName") <*> (x .:? "Username") <*>
(x .:? "EmailAddress")
<*> (x .:? "Id")
<*> (x .:? "Surname"))
instance Hashable UserMetadata where
instance NFData UserMetadata where
data UserStorageMetadata = UserStorageMetadata'
{ _usmStorageUtilizedInBytes :: !(Maybe Integer)
, _usmStorageRule :: !(Maybe StorageRuleType)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
userStorageMetadata
:: UserStorageMetadata
userStorageMetadata =
UserStorageMetadata'
{_usmStorageUtilizedInBytes = Nothing, _usmStorageRule = Nothing}
usmStorageUtilizedInBytes :: Lens' UserStorageMetadata (Maybe Integer)
usmStorageUtilizedInBytes = lens _usmStorageUtilizedInBytes (\ s a -> s{_usmStorageUtilizedInBytes = a})
usmStorageRule :: Lens' UserStorageMetadata (Maybe StorageRuleType)
usmStorageRule = lens _usmStorageRule (\ s a -> s{_usmStorageRule = a})
instance FromJSON UserStorageMetadata where
parseJSON
= withObject "UserStorageMetadata"
(\ x ->
UserStorageMetadata' <$>
(x .:? "StorageUtilizedInBytes") <*>
(x .:? "StorageRule"))
instance Hashable UserStorageMetadata where
instance NFData UserStorageMetadata where