module Network.AWS.IAM.Types
(
IAM
, RESTError
, ns
, AssignmentStatusType (..)
, PasswordPolicy
, passwordPolicy
, ppAllowUsersToChangePassword
, ppExpirePasswords
, ppHardExpiry
, ppMaxPasswordAge
, ppMinimumPasswordLength
, ppPasswordReusePrevention
, ppRequireLowercaseCharacters
, ppRequireNumbers
, ppRequireSymbols
, ppRequireUppercaseCharacters
, Group
, group
, gArn
, gCreateDate
, gGroupId
, gGroupName
, gPath
, MFADevice
, mfadevice
, mfadEnableDate
, mfadSerialNumber
, mfadUserName
, InstanceProfile
, instanceProfile
, ipArn
, ipCreateDate
, ipInstanceProfileId
, ipInstanceProfileName
, ipPath
, ipRoles
, ReportFormatType (..)
, ServerCertificateMetadata
, serverCertificateMetadata
, scmArn
, scmExpiration
, scmPath
, scmServerCertificateId
, scmServerCertificateName
, scmUploadDate
, OpenIDConnectProviderListEntry
, openIDConnectProviderListEntry
, oidcpleArn
, LoginProfile
, loginProfile
, lpCreateDate
, lpPasswordResetRequired
, lpUserName
, SummaryKeyType (..)
, ReportStateType (..)
, User
, user
, uArn
, uCreateDate
, uPasswordLastUsed
, uPath
, uUserId
, uUserName
, StatusType (..)
, SAMLProviderListEntry
, samlproviderListEntry
, samlpleArn
, samlpleCreateDate
, samlpleValidUntil
, Role
, role
, rArn
, rAssumeRolePolicyDocument
, rCreateDate
, rPath
, rRoleId
, rRoleName
, ServerCertificate
, serverCertificate
, scCertificateBody
, scCertificateChain
, scServerCertificateMetadata
, AccessKey
, accessKey
, akAccessKeyId
, akCreateDate
, akSecretAccessKey
, akStatus
, akUserName
, VirtualMFADevice
, virtualMFADevice
, vmfadBase32StringSeed
, vmfadEnableDate
, vmfadQRCodePNG
, vmfadSerialNumber
, vmfadUser
, SigningCertificate
, signingCertificate
, sc1CertificateBody
, sc1CertificateId
, sc1Status
, sc1UploadDate
, sc1UserName
, AccessKeyMetadata
, accessKeyMetadata
, akmAccessKeyId
, akmCreateDate
, akmStatus
, akmUserName
) where
import Network.AWS.Error
import Network.AWS.Prelude
import Network.AWS.Signing.V4
import qualified GHC.Exts
data IAM
instance AWSService IAM where
type Sg IAM = V4
type Er IAM = RESTError
service = Service
{ _svcEndpoint = global
, _svcAbbrev = "IAM"
, _svcPrefix = "iam"
, _svcVersion = "2010-05-08"
, _svcTargetPrefix = Nothing
, _svcJSONVersion = Nothing
}
handle = restError statusSuccess
ns :: Text
ns = "https://iam.amazonaws.com/doc/2010-05-08/"
data AssignmentStatusType
= Any
| Assigned
| Unassigned
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable AssignmentStatusType
instance FromText AssignmentStatusType where
parser = takeText >>= \case
"Any" -> pure Any
"Assigned" -> pure Assigned
"Unassigned" -> pure Unassigned
e -> fail $
"Failure parsing AssignmentStatusType from " ++ show e
instance ToText AssignmentStatusType where
toText = \case
Any -> "Any"
Assigned -> "Assigned"
Unassigned -> "Unassigned"
instance ToByteString AssignmentStatusType
instance ToHeader AssignmentStatusType
instance ToQuery AssignmentStatusType
instance FromXML AssignmentStatusType where
parseXML = parseXMLText "AssignmentStatusType"
data PasswordPolicy = PasswordPolicy
{ _ppAllowUsersToChangePassword :: Maybe Bool
, _ppExpirePasswords :: Maybe Bool
, _ppHardExpiry :: Maybe Bool
, _ppMaxPasswordAge :: Maybe Nat
, _ppMinimumPasswordLength :: Maybe Nat
, _ppPasswordReusePrevention :: Maybe Nat
, _ppRequireLowercaseCharacters :: Maybe Bool
, _ppRequireNumbers :: Maybe Bool
, _ppRequireSymbols :: Maybe Bool
, _ppRequireUppercaseCharacters :: Maybe Bool
} deriving (Eq, Ord, Show)
passwordPolicy :: PasswordPolicy
passwordPolicy = PasswordPolicy
{ _ppMinimumPasswordLength = Nothing
, _ppRequireSymbols = Nothing
, _ppRequireNumbers = Nothing
, _ppRequireUppercaseCharacters = Nothing
, _ppRequireLowercaseCharacters = Nothing
, _ppAllowUsersToChangePassword = Nothing
, _ppExpirePasswords = Nothing
, _ppMaxPasswordAge = Nothing
, _ppPasswordReusePrevention = Nothing
, _ppHardExpiry = Nothing
}
ppAllowUsersToChangePassword :: Lens' PasswordPolicy (Maybe Bool)
ppAllowUsersToChangePassword =
lens _ppAllowUsersToChangePassword
(\s a -> s { _ppAllowUsersToChangePassword = a })
ppExpirePasswords :: Lens' PasswordPolicy (Maybe Bool)
ppExpirePasswords =
lens _ppExpirePasswords (\s a -> s { _ppExpirePasswords = a })
ppHardExpiry :: Lens' PasswordPolicy (Maybe Bool)
ppHardExpiry = lens _ppHardExpiry (\s a -> s { _ppHardExpiry = a })
ppMaxPasswordAge :: Lens' PasswordPolicy (Maybe Natural)
ppMaxPasswordAge = lens _ppMaxPasswordAge (\s a -> s { _ppMaxPasswordAge = a }) . mapping _Nat
ppMinimumPasswordLength :: Lens' PasswordPolicy (Maybe Natural)
ppMinimumPasswordLength =
lens _ppMinimumPasswordLength (\s a -> s { _ppMinimumPasswordLength = a })
. mapping _Nat
ppPasswordReusePrevention :: Lens' PasswordPolicy (Maybe Natural)
ppPasswordReusePrevention =
lens _ppPasswordReusePrevention
(\s a -> s { _ppPasswordReusePrevention = a })
. mapping _Nat
ppRequireLowercaseCharacters :: Lens' PasswordPolicy (Maybe Bool)
ppRequireLowercaseCharacters =
lens _ppRequireLowercaseCharacters
(\s a -> s { _ppRequireLowercaseCharacters = a })
ppRequireNumbers :: Lens' PasswordPolicy (Maybe Bool)
ppRequireNumbers = lens _ppRequireNumbers (\s a -> s { _ppRequireNumbers = a })
ppRequireSymbols :: Lens' PasswordPolicy (Maybe Bool)
ppRequireSymbols = lens _ppRequireSymbols (\s a -> s { _ppRequireSymbols = a })
ppRequireUppercaseCharacters :: Lens' PasswordPolicy (Maybe Bool)
ppRequireUppercaseCharacters =
lens _ppRequireUppercaseCharacters
(\s a -> s { _ppRequireUppercaseCharacters = a })
instance FromXML PasswordPolicy where
parseXML x = PasswordPolicy
<$> x .@? "AllowUsersToChangePassword"
<*> x .@? "ExpirePasswords"
<*> x .@? "HardExpiry"
<*> x .@? "MaxPasswordAge"
<*> x .@? "MinimumPasswordLength"
<*> x .@? "PasswordReusePrevention"
<*> x .@? "RequireLowercaseCharacters"
<*> x .@? "RequireNumbers"
<*> x .@? "RequireSymbols"
<*> x .@? "RequireUppercaseCharacters"
instance ToQuery PasswordPolicy where
toQuery PasswordPolicy{..} = mconcat
[ "AllowUsersToChangePassword" =? _ppAllowUsersToChangePassword
, "ExpirePasswords" =? _ppExpirePasswords
, "HardExpiry" =? _ppHardExpiry
, "MaxPasswordAge" =? _ppMaxPasswordAge
, "MinimumPasswordLength" =? _ppMinimumPasswordLength
, "PasswordReusePrevention" =? _ppPasswordReusePrevention
, "RequireLowercaseCharacters" =? _ppRequireLowercaseCharacters
, "RequireNumbers" =? _ppRequireNumbers
, "RequireSymbols" =? _ppRequireSymbols
, "RequireUppercaseCharacters" =? _ppRequireUppercaseCharacters
]
data Group = Group
{ _gArn :: Text
, _gCreateDate :: ISO8601
, _gGroupId :: Text
, _gGroupName :: Text
, _gPath :: Text
} deriving (Eq, Ord, Show)
group :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> Group
group p1 p2 p3 p4 p5 = Group
{ _gPath = p1
, _gGroupName = p2
, _gGroupId = p3
, _gArn = p4
, _gCreateDate = withIso _Time (const id) p5
}
gArn :: Lens' Group Text
gArn = lens _gArn (\s a -> s { _gArn = a })
gCreateDate :: Lens' Group UTCTime
gCreateDate = lens _gCreateDate (\s a -> s { _gCreateDate = a }) . _Time
gGroupId :: Lens' Group Text
gGroupId = lens _gGroupId (\s a -> s { _gGroupId = a })
gGroupName :: Lens' Group Text
gGroupName = lens _gGroupName (\s a -> s { _gGroupName = a })
gPath :: Lens' Group Text
gPath = lens _gPath (\s a -> s { _gPath = a })
instance FromXML Group where
parseXML x = Group
<$> x .@ "Arn"
<*> x .@ "CreateDate"
<*> x .@ "GroupId"
<*> x .@ "GroupName"
<*> x .@ "Path"
instance ToQuery Group where
toQuery Group{..} = mconcat
[ "Arn" =? _gArn
, "CreateDate" =? _gCreateDate
, "GroupId" =? _gGroupId
, "GroupName" =? _gGroupName
, "Path" =? _gPath
]
data MFADevice = MFADevice
{ _mfadEnableDate :: ISO8601
, _mfadSerialNumber :: Text
, _mfadUserName :: Text
} deriving (Eq, Ord, Show)
mfadevice :: Text
-> Text
-> UTCTime
-> MFADevice
mfadevice p1 p2 p3 = MFADevice
{ _mfadUserName = p1
, _mfadSerialNumber = p2
, _mfadEnableDate = withIso _Time (const id) p3
}
mfadEnableDate :: Lens' MFADevice UTCTime
mfadEnableDate = lens _mfadEnableDate (\s a -> s { _mfadEnableDate = a }) . _Time
mfadSerialNumber :: Lens' MFADevice Text
mfadSerialNumber = lens _mfadSerialNumber (\s a -> s { _mfadSerialNumber = a })
mfadUserName :: Lens' MFADevice Text
mfadUserName = lens _mfadUserName (\s a -> s { _mfadUserName = a })
instance FromXML MFADevice where
parseXML x = MFADevice
<$> x .@ "EnableDate"
<*> x .@ "SerialNumber"
<*> x .@ "UserName"
instance ToQuery MFADevice where
toQuery MFADevice{..} = mconcat
[ "EnableDate" =? _mfadEnableDate
, "SerialNumber" =? _mfadSerialNumber
, "UserName" =? _mfadUserName
]
data InstanceProfile = InstanceProfile
{ _ipArn :: Text
, _ipCreateDate :: ISO8601
, _ipInstanceProfileId :: Text
, _ipInstanceProfileName :: Text
, _ipPath :: Text
, _ipRoles :: List "Roles" Role
} deriving (Eq, Show)
instanceProfile :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> InstanceProfile
instanceProfile p1 p2 p3 p4 p5 = InstanceProfile
{ _ipPath = p1
, _ipInstanceProfileName = p2
, _ipInstanceProfileId = p3
, _ipArn = p4
, _ipCreateDate = withIso _Time (const id) p5
, _ipRoles = mempty
}
ipArn :: Lens' InstanceProfile Text
ipArn = lens _ipArn (\s a -> s { _ipArn = a })
ipCreateDate :: Lens' InstanceProfile UTCTime
ipCreateDate = lens _ipCreateDate (\s a -> s { _ipCreateDate = a }) . _Time
ipInstanceProfileId :: Lens' InstanceProfile Text
ipInstanceProfileId =
lens _ipInstanceProfileId (\s a -> s { _ipInstanceProfileId = a })
ipInstanceProfileName :: Lens' InstanceProfile Text
ipInstanceProfileName =
lens _ipInstanceProfileName (\s a -> s { _ipInstanceProfileName = a })
ipPath :: Lens' InstanceProfile Text
ipPath = lens _ipPath (\s a -> s { _ipPath = a })
ipRoles :: Lens' InstanceProfile [Role]
ipRoles = lens _ipRoles (\s a -> s { _ipRoles = a }) . _List
instance FromXML InstanceProfile where
parseXML x = InstanceProfile
<$> x .@ "Arn"
<*> x .@ "CreateDate"
<*> x .@ "InstanceProfileId"
<*> x .@ "InstanceProfileName"
<*> x .@ "Path"
<*> x .@ "Roles"
instance ToQuery InstanceProfile where
toQuery InstanceProfile{..} = mconcat
[ "Arn" =? _ipArn
, "CreateDate" =? _ipCreateDate
, "InstanceProfileId" =? _ipInstanceProfileId
, "InstanceProfileName" =? _ipInstanceProfileName
, "Path" =? _ipPath
, "Roles" =? _ipRoles
]
data ReportFormatType
= TextCsv
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ReportFormatType
instance FromText ReportFormatType where
parser = takeText >>= \case
"text/csv" -> pure TextCsv
e -> fail $
"Failure parsing ReportFormatType from " ++ show e
instance ToText ReportFormatType where
toText TextCsv = "text/csv"
instance ToByteString ReportFormatType
instance ToHeader ReportFormatType
instance ToQuery ReportFormatType
instance FromXML ReportFormatType where
parseXML = parseXMLText "ReportFormatType"
data ServerCertificateMetadata = ServerCertificateMetadata
{ _scmArn :: Text
, _scmExpiration :: Maybe ISO8601
, _scmPath :: Text
, _scmServerCertificateId :: Text
, _scmServerCertificateName :: Text
, _scmUploadDate :: Maybe ISO8601
} deriving (Eq, Ord, Show)
serverCertificateMetadata :: Text
-> Text
-> Text
-> Text
-> ServerCertificateMetadata
serverCertificateMetadata p1 p2 p3 p4 = ServerCertificateMetadata
{ _scmPath = p1
, _scmServerCertificateName = p2
, _scmServerCertificateId = p3
, _scmArn = p4
, _scmUploadDate = Nothing
, _scmExpiration = Nothing
}
scmArn :: Lens' ServerCertificateMetadata Text
scmArn = lens _scmArn (\s a -> s { _scmArn = a })
scmExpiration :: Lens' ServerCertificateMetadata (Maybe UTCTime)
scmExpiration = lens _scmExpiration (\s a -> s { _scmExpiration = a }) . mapping _Time
scmPath :: Lens' ServerCertificateMetadata Text
scmPath = lens _scmPath (\s a -> s { _scmPath = a })
scmServerCertificateId :: Lens' ServerCertificateMetadata Text
scmServerCertificateId =
lens _scmServerCertificateId (\s a -> s { _scmServerCertificateId = a })
scmServerCertificateName :: Lens' ServerCertificateMetadata Text
scmServerCertificateName =
lens _scmServerCertificateName
(\s a -> s { _scmServerCertificateName = a })
scmUploadDate :: Lens' ServerCertificateMetadata (Maybe UTCTime)
scmUploadDate = lens _scmUploadDate (\s a -> s { _scmUploadDate = a }) . mapping _Time
instance FromXML ServerCertificateMetadata where
parseXML x = ServerCertificateMetadata
<$> x .@ "Arn"
<*> x .@? "Expiration"
<*> x .@ "Path"
<*> x .@ "ServerCertificateId"
<*> x .@ "ServerCertificateName"
<*> x .@? "UploadDate"
instance ToQuery ServerCertificateMetadata where
toQuery ServerCertificateMetadata{..} = mconcat
[ "Arn" =? _scmArn
, "Expiration" =? _scmExpiration
, "Path" =? _scmPath
, "ServerCertificateId" =? _scmServerCertificateId
, "ServerCertificateName" =? _scmServerCertificateName
, "UploadDate" =? _scmUploadDate
]
newtype OpenIDConnectProviderListEntry = OpenIDConnectProviderListEntry
{ _oidcpleArn :: Maybe Text
} deriving (Eq, Ord, Show, Monoid)
openIDConnectProviderListEntry :: OpenIDConnectProviderListEntry
openIDConnectProviderListEntry = OpenIDConnectProviderListEntry
{ _oidcpleArn = Nothing
}
oidcpleArn :: Lens' OpenIDConnectProviderListEntry (Maybe Text)
oidcpleArn = lens _oidcpleArn (\s a -> s { _oidcpleArn = a })
instance FromXML OpenIDConnectProviderListEntry where
parseXML x = OpenIDConnectProviderListEntry
<$> x .@? "Arn"
instance ToQuery OpenIDConnectProviderListEntry where
toQuery OpenIDConnectProviderListEntry{..} = mconcat
[ "Arn" =? _oidcpleArn
]
data LoginProfile = LoginProfile
{ _lpCreateDate :: ISO8601
, _lpPasswordResetRequired :: Maybe Bool
, _lpUserName :: Text
} deriving (Eq, Ord, Show)
loginProfile :: Text
-> UTCTime
-> LoginProfile
loginProfile p1 p2 = LoginProfile
{ _lpUserName = p1
, _lpCreateDate = withIso _Time (const id) p2
, _lpPasswordResetRequired = Nothing
}
lpCreateDate :: Lens' LoginProfile UTCTime
lpCreateDate = lens _lpCreateDate (\s a -> s { _lpCreateDate = a }) . _Time
lpPasswordResetRequired :: Lens' LoginProfile (Maybe Bool)
lpPasswordResetRequired =
lens _lpPasswordResetRequired (\s a -> s { _lpPasswordResetRequired = a })
lpUserName :: Lens' LoginProfile Text
lpUserName = lens _lpUserName (\s a -> s { _lpUserName = a })
instance FromXML LoginProfile where
parseXML x = LoginProfile
<$> x .@ "CreateDate"
<*> x .@? "PasswordResetRequired"
<*> x .@ "UserName"
instance ToQuery LoginProfile where
toQuery LoginProfile{..} = mconcat
[ "CreateDate" =? _lpCreateDate
, "PasswordResetRequired" =? _lpPasswordResetRequired
, "UserName" =? _lpUserName
]
data SummaryKeyType
= AccessKeysPerUserQuota
| AccountMFAEnabled
| GroupPolicySizeQuota
| Groups
| GroupsPerUserQuota
| GroupsQuota
| MFADevices
| MFADevicesInUse
| ServerCertificates
| ServerCertificatesQuota
| SigningCertificatesPerUserQuota
| UserPolicySizeQuota
| Users
| UsersQuota
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable SummaryKeyType
instance FromText SummaryKeyType where
parser = takeText >>= \case
"AccessKeysPerUserQuota" -> pure AccessKeysPerUserQuota
"AccountMFAEnabled" -> pure AccountMFAEnabled
"GroupPolicySizeQuota" -> pure GroupPolicySizeQuota
"Groups" -> pure Groups
"GroupsPerUserQuota" -> pure GroupsPerUserQuota
"GroupsQuota" -> pure GroupsQuota
"MFADevices" -> pure MFADevices
"MFADevicesInUse" -> pure MFADevicesInUse
"ServerCertificates" -> pure ServerCertificates
"ServerCertificatesQuota" -> pure ServerCertificatesQuota
"SigningCertificatesPerUserQuota" -> pure SigningCertificatesPerUserQuota
"UserPolicySizeQuota" -> pure UserPolicySizeQuota
"Users" -> pure Users
"UsersQuota" -> pure UsersQuota
e -> fail $
"Failure parsing SummaryKeyType from " ++ show e
instance ToText SummaryKeyType where
toText = \case
AccessKeysPerUserQuota -> "AccessKeysPerUserQuota"
AccountMFAEnabled -> "AccountMFAEnabled"
GroupPolicySizeQuota -> "GroupPolicySizeQuota"
Groups -> "Groups"
GroupsPerUserQuota -> "GroupsPerUserQuota"
GroupsQuota -> "GroupsQuota"
MFADevices -> "MFADevices"
MFADevicesInUse -> "MFADevicesInUse"
ServerCertificates -> "ServerCertificates"
ServerCertificatesQuota -> "ServerCertificatesQuota"
SigningCertificatesPerUserQuota -> "SigningCertificatesPerUserQuota"
UserPolicySizeQuota -> "UserPolicySizeQuota"
Users -> "Users"
UsersQuota -> "UsersQuota"
instance ToByteString SummaryKeyType
instance ToHeader SummaryKeyType
instance ToQuery SummaryKeyType
instance FromXML SummaryKeyType where
parseXML = parseXMLText "SummaryKeyType"
data ReportStateType
= Complete
| Inprogress
| Started
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ReportStateType
instance FromText ReportStateType where
parser = takeText >>= \case
"COMPLETE" -> pure Complete
"INPROGRESS" -> pure Inprogress
"STARTED" -> pure Started
e -> fail $
"Failure parsing ReportStateType from " ++ show e
instance ToText ReportStateType where
toText = \case
Complete -> "COMPLETE"
Inprogress -> "INPROGRESS"
Started -> "STARTED"
instance ToByteString ReportStateType
instance ToHeader ReportStateType
instance ToQuery ReportStateType
instance FromXML ReportStateType where
parseXML = parseXMLText "ReportStateType"
data User = User
{ _uArn :: Text
, _uCreateDate :: ISO8601
, _uPasswordLastUsed :: Maybe ISO8601
, _uPath :: Text
, _uUserId :: Text
, _uUserName :: Text
} deriving (Eq, Ord, Show)
user :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> User
user p1 p2 p3 p4 p5 = User
{ _uPath = p1
, _uUserName = p2
, _uUserId = p3
, _uArn = p4
, _uCreateDate = withIso _Time (const id) p5
, _uPasswordLastUsed = Nothing
}
uArn :: Lens' User Text
uArn = lens _uArn (\s a -> s { _uArn = a })
uCreateDate :: Lens' User UTCTime
uCreateDate = lens _uCreateDate (\s a -> s { _uCreateDate = a }) . _Time
uPasswordLastUsed :: Lens' User (Maybe UTCTime)
uPasswordLastUsed =
lens _uPasswordLastUsed (\s a -> s { _uPasswordLastUsed = a })
. mapping _Time
uPath :: Lens' User Text
uPath = lens _uPath (\s a -> s { _uPath = a })
uUserId :: Lens' User Text
uUserId = lens _uUserId (\s a -> s { _uUserId = a })
uUserName :: Lens' User Text
uUserName = lens _uUserName (\s a -> s { _uUserName = a })
instance FromXML User where
parseXML x = User
<$> x .@ "Arn"
<*> x .@ "CreateDate"
<*> x .@? "PasswordLastUsed"
<*> x .@ "Path"
<*> x .@ "UserId"
<*> x .@ "UserName"
instance ToQuery User where
toQuery User{..} = mconcat
[ "Arn" =? _uArn
, "CreateDate" =? _uCreateDate
, "PasswordLastUsed" =? _uPasswordLastUsed
, "Path" =? _uPath
, "UserId" =? _uUserId
, "UserName" =? _uUserName
]
data StatusType
= Active
| Inactive
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable StatusType
instance FromText StatusType where
parser = takeText >>= \case
"Active" -> pure Active
"Inactive" -> pure Inactive
e -> fail $
"Failure parsing StatusType from " ++ show e
instance ToText StatusType where
toText = \case
Active -> "Active"
Inactive -> "Inactive"
instance ToByteString StatusType
instance ToHeader StatusType
instance ToQuery StatusType
instance FromXML StatusType where
parseXML = parseXMLText "StatusType"
data SAMLProviderListEntry = SAMLProviderListEntry
{ _samlpleArn :: Maybe Text
, _samlpleCreateDate :: Maybe ISO8601
, _samlpleValidUntil :: Maybe ISO8601
} deriving (Eq, Ord, Show)
samlproviderListEntry :: SAMLProviderListEntry
samlproviderListEntry = SAMLProviderListEntry
{ _samlpleArn = Nothing
, _samlpleValidUntil = Nothing
, _samlpleCreateDate = Nothing
}
samlpleArn :: Lens' SAMLProviderListEntry (Maybe Text)
samlpleArn = lens _samlpleArn (\s a -> s { _samlpleArn = a })
samlpleCreateDate :: Lens' SAMLProviderListEntry (Maybe UTCTime)
samlpleCreateDate =
lens _samlpleCreateDate (\s a -> s { _samlpleCreateDate = a })
. mapping _Time
samlpleValidUntil :: Lens' SAMLProviderListEntry (Maybe UTCTime)
samlpleValidUntil =
lens _samlpleValidUntil (\s a -> s { _samlpleValidUntil = a })
. mapping _Time
instance FromXML SAMLProviderListEntry where
parseXML x = SAMLProviderListEntry
<$> x .@? "Arn"
<*> x .@? "CreateDate"
<*> x .@? "ValidUntil"
instance ToQuery SAMLProviderListEntry where
toQuery SAMLProviderListEntry{..} = mconcat
[ "Arn" =? _samlpleArn
, "CreateDate" =? _samlpleCreateDate
, "ValidUntil" =? _samlpleValidUntil
]
data Role = Role
{ _rArn :: Text
, _rAssumeRolePolicyDocument :: Maybe Text
, _rCreateDate :: ISO8601
, _rPath :: Text
, _rRoleId :: Text
, _rRoleName :: Text
} deriving (Eq, Ord, Show)
role :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> Role
role p1 p2 p3 p4 p5 = Role
{ _rPath = p1
, _rRoleName = p2
, _rRoleId = p3
, _rArn = p4
, _rCreateDate = withIso _Time (const id) p5
, _rAssumeRolePolicyDocument = Nothing
}
rArn :: Lens' Role Text
rArn = lens _rArn (\s a -> s { _rArn = a })
rAssumeRolePolicyDocument :: Lens' Role (Maybe Text)
rAssumeRolePolicyDocument =
lens _rAssumeRolePolicyDocument
(\s a -> s { _rAssumeRolePolicyDocument = a })
rCreateDate :: Lens' Role UTCTime
rCreateDate = lens _rCreateDate (\s a -> s { _rCreateDate = a }) . _Time
rPath :: Lens' Role Text
rPath = lens _rPath (\s a -> s { _rPath = a })
rRoleId :: Lens' Role Text
rRoleId = lens _rRoleId (\s a -> s { _rRoleId = a })
rRoleName :: Lens' Role Text
rRoleName = lens _rRoleName (\s a -> s { _rRoleName = a })
instance FromXML Role where
parseXML x = Role
<$> x .@ "Arn"
<*> x .@? "AssumeRolePolicyDocument"
<*> x .@ "CreateDate"
<*> x .@ "Path"
<*> x .@ "RoleId"
<*> x .@ "RoleName"
instance ToQuery Role where
toQuery Role{..} = mconcat
[ "Arn" =? _rArn
, "AssumeRolePolicyDocument" =? _rAssumeRolePolicyDocument
, "CreateDate" =? _rCreateDate
, "Path" =? _rPath
, "RoleId" =? _rRoleId
, "RoleName" =? _rRoleName
]
data ServerCertificate = ServerCertificate
{ _scCertificateBody :: Text
, _scCertificateChain :: Maybe Text
, _scServerCertificateMetadata :: ServerCertificateMetadata
} deriving (Eq, Show)
serverCertificate :: ServerCertificateMetadata
-> Text
-> ServerCertificate
serverCertificate p1 p2 = ServerCertificate
{ _scServerCertificateMetadata = p1
, _scCertificateBody = p2
, _scCertificateChain = Nothing
}
scCertificateBody :: Lens' ServerCertificate Text
scCertificateBody =
lens _scCertificateBody (\s a -> s { _scCertificateBody = a })
scCertificateChain :: Lens' ServerCertificate (Maybe Text)
scCertificateChain =
lens _scCertificateChain (\s a -> s { _scCertificateChain = a })
scServerCertificateMetadata :: Lens' ServerCertificate ServerCertificateMetadata
scServerCertificateMetadata =
lens _scServerCertificateMetadata
(\s a -> s { _scServerCertificateMetadata = a })
instance FromXML ServerCertificate where
parseXML x = ServerCertificate
<$> x .@ "CertificateBody"
<*> x .@? "CertificateChain"
<*> x .@ "ServerCertificateMetadata"
instance ToQuery ServerCertificate where
toQuery ServerCertificate{..} = mconcat
[ "CertificateBody" =? _scCertificateBody
, "CertificateChain" =? _scCertificateChain
, "ServerCertificateMetadata" =? _scServerCertificateMetadata
]
data AccessKey = AccessKey
{ _akAccessKeyId :: Text
, _akCreateDate :: Maybe ISO8601
, _akSecretAccessKey :: Sensitive Text
, _akStatus :: StatusType
, _akUserName :: Text
} deriving (Eq, Show)
accessKey :: Text
-> Text
-> StatusType
-> Text
-> AccessKey
accessKey p1 p2 p3 p4 = AccessKey
{ _akUserName = p1
, _akAccessKeyId = p2
, _akStatus = p3
, _akSecretAccessKey = withIso _Sensitive (const id) p4
, _akCreateDate = Nothing
}
akAccessKeyId :: Lens' AccessKey Text
akAccessKeyId = lens _akAccessKeyId (\s a -> s { _akAccessKeyId = a })
akCreateDate :: Lens' AccessKey (Maybe UTCTime)
akCreateDate = lens _akCreateDate (\s a -> s { _akCreateDate = a }) . mapping _Time
akSecretAccessKey :: Lens' AccessKey Text
akSecretAccessKey =
lens _akSecretAccessKey (\s a -> s { _akSecretAccessKey = a })
. _Sensitive
akStatus :: Lens' AccessKey StatusType
akStatus = lens _akStatus (\s a -> s { _akStatus = a })
akUserName :: Lens' AccessKey Text
akUserName = lens _akUserName (\s a -> s { _akUserName = a })
instance FromXML AccessKey where
parseXML x = AccessKey
<$> x .@ "AccessKeyId"
<*> x .@? "CreateDate"
<*> x .@ "SecretAccessKey"
<*> x .@ "Status"
<*> x .@ "UserName"
instance ToQuery AccessKey where
toQuery AccessKey{..} = mconcat
[ "AccessKeyId" =? _akAccessKeyId
, "CreateDate" =? _akCreateDate
, "SecretAccessKey" =? _akSecretAccessKey
, "Status" =? _akStatus
, "UserName" =? _akUserName
]
data VirtualMFADevice = VirtualMFADevice
{ _vmfadBase32StringSeed :: Maybe Base64
, _vmfadEnableDate :: Maybe ISO8601
, _vmfadQRCodePNG :: Maybe Base64
, _vmfadSerialNumber :: Text
, _vmfadUser :: Maybe User
} deriving (Eq, Show)
virtualMFADevice :: Text
-> VirtualMFADevice
virtualMFADevice p1 = VirtualMFADevice
{ _vmfadSerialNumber = p1
, _vmfadBase32StringSeed = Nothing
, _vmfadQRCodePNG = Nothing
, _vmfadUser = Nothing
, _vmfadEnableDate = Nothing
}
vmfadBase32StringSeed :: Lens' VirtualMFADevice (Maybe Base64)
vmfadBase32StringSeed =
lens _vmfadBase32StringSeed (\s a -> s { _vmfadBase32StringSeed = a })
vmfadEnableDate :: Lens' VirtualMFADevice (Maybe UTCTime)
vmfadEnableDate = lens _vmfadEnableDate (\s a -> s { _vmfadEnableDate = a }) . mapping _Time
vmfadQRCodePNG :: Lens' VirtualMFADevice (Maybe Base64)
vmfadQRCodePNG = lens _vmfadQRCodePNG (\s a -> s { _vmfadQRCodePNG = a })
vmfadSerialNumber :: Lens' VirtualMFADevice Text
vmfadSerialNumber =
lens _vmfadSerialNumber (\s a -> s { _vmfadSerialNumber = a })
vmfadUser :: Lens' VirtualMFADevice (Maybe User)
vmfadUser = lens _vmfadUser (\s a -> s { _vmfadUser = a })
instance FromXML VirtualMFADevice where
parseXML x = VirtualMFADevice
<$> x .@? "Base32StringSeed"
<*> x .@? "EnableDate"
<*> x .@? "QRCodePNG"
<*> x .@ "SerialNumber"
<*> x .@? "User"
instance ToQuery VirtualMFADevice where
toQuery VirtualMFADevice{..} = mconcat
[ "Base32StringSeed" =? _vmfadBase32StringSeed
, "EnableDate" =? _vmfadEnableDate
, "QRCodePNG" =? _vmfadQRCodePNG
, "SerialNumber" =? _vmfadSerialNumber
, "User" =? _vmfadUser
]
data SigningCertificate = SigningCertificate
{ _sc1CertificateBody :: Text
, _sc1CertificateId :: Text
, _sc1Status :: StatusType
, _sc1UploadDate :: Maybe ISO8601
, _sc1UserName :: Text
} deriving (Eq, Show)
signingCertificate :: Text
-> Text
-> Text
-> StatusType
-> SigningCertificate
signingCertificate p1 p2 p3 p4 = SigningCertificate
{ _sc1UserName = p1
, _sc1CertificateId = p2
, _sc1CertificateBody = p3
, _sc1Status = p4
, _sc1UploadDate = Nothing
}
sc1CertificateBody :: Lens' SigningCertificate Text
sc1CertificateBody =
lens _sc1CertificateBody (\s a -> s { _sc1CertificateBody = a })
sc1CertificateId :: Lens' SigningCertificate Text
sc1CertificateId = lens _sc1CertificateId (\s a -> s { _sc1CertificateId = a })
sc1Status :: Lens' SigningCertificate StatusType
sc1Status = lens _sc1Status (\s a -> s { _sc1Status = a })
sc1UploadDate :: Lens' SigningCertificate (Maybe UTCTime)
sc1UploadDate = lens _sc1UploadDate (\s a -> s { _sc1UploadDate = a }) . mapping _Time
sc1UserName :: Lens' SigningCertificate Text
sc1UserName = lens _sc1UserName (\s a -> s { _sc1UserName = a })
instance FromXML SigningCertificate where
parseXML x = SigningCertificate
<$> x .@ "CertificateBody"
<*> x .@ "CertificateId"
<*> x .@ "Status"
<*> x .@? "UploadDate"
<*> x .@ "UserName"
instance ToQuery SigningCertificate where
toQuery SigningCertificate{..} = mconcat
[ "CertificateBody" =? _sc1CertificateBody
, "CertificateId" =? _sc1CertificateId
, "Status" =? _sc1Status
, "UploadDate" =? _sc1UploadDate
, "UserName" =? _sc1UserName
]
data AccessKeyMetadata = AccessKeyMetadata
{ _akmAccessKeyId :: Maybe Text
, _akmCreateDate :: Maybe ISO8601
, _akmStatus :: Maybe StatusType
, _akmUserName :: Maybe Text
} deriving (Eq, Show)
accessKeyMetadata :: AccessKeyMetadata
accessKeyMetadata = AccessKeyMetadata
{ _akmUserName = Nothing
, _akmAccessKeyId = Nothing
, _akmStatus = Nothing
, _akmCreateDate = Nothing
}
akmAccessKeyId :: Lens' AccessKeyMetadata (Maybe Text)
akmAccessKeyId = lens _akmAccessKeyId (\s a -> s { _akmAccessKeyId = a })
akmCreateDate :: Lens' AccessKeyMetadata (Maybe UTCTime)
akmCreateDate = lens _akmCreateDate (\s a -> s { _akmCreateDate = a }) . mapping _Time
akmStatus :: Lens' AccessKeyMetadata (Maybe StatusType)
akmStatus = lens _akmStatus (\s a -> s { _akmStatus = a })
akmUserName :: Lens' AccessKeyMetadata (Maybe Text)
akmUserName = lens _akmUserName (\s a -> s { _akmUserName = a })
instance FromXML AccessKeyMetadata where
parseXML x = AccessKeyMetadata
<$> x .@? "AccessKeyId"
<*> x .@? "CreateDate"
<*> x .@? "Status"
<*> x .@? "UserName"
instance ToQuery AccessKeyMetadata where
toQuery AccessKeyMetadata{..} = mconcat
[ "AccessKeyId" =? _akmAccessKeyId
, "CreateDate" =? _akmCreateDate
, "Status" =? _akmStatus
, "UserName" =? _akmUserName
]