module Network.AWS.IAM.Types
(
IAM
, RESTError
, ns
, PolicyRole
, policyRole
, prRoleName
, AssignmentStatusType (..)
, PasswordPolicy
, passwordPolicy
, ppAllowUsersToChangePassword
, ppExpirePasswords
, ppHardExpiry
, ppMaxPasswordAge
, ppMinimumPasswordLength
, ppPasswordReusePrevention
, ppRequireLowercaseCharacters
, ppRequireNumbers
, ppRequireSymbols
, ppRequireUppercaseCharacters
, Group
, group
, gArn
, gCreateDate
, gGroupId
, gGroupName
, gPath
, AttachedPolicy
, attachedPolicy
, apPolicyArn
, apPolicyName
, MFADevice
, mfadevice
, mfadEnableDate
, mfadSerialNumber
, mfadUserName
, PolicyVersion
, policyVersion
, pvCreateDate
, pvDocument
, pvIsDefaultVersion
, pvVersionId
, InstanceProfile
, instanceProfile
, ipArn
, ipCreateDate
, ipInstanceProfileId
, ipInstanceProfileName
, ipPath
, ipRoles
, RoleDetail
, roleDetail
, rdArn
, rdAssumeRolePolicyDocument
, rdCreateDate
, rdInstanceProfileList
, rdPath
, rdRoleId
, rdRoleName
, rdRolePolicyList
, ReportFormatType (..)
, ServerCertificateMetadata
, serverCertificateMetadata
, scmArn
, scmExpiration
, scmPath
, scmServerCertificateId
, scmServerCertificateName
, scmUploadDate
, OpenIDConnectProviderListEntry
, openIDConnectProviderListEntry
, oidcpleArn
, LoginProfile
, loginProfile
, lpCreateDate
, lpPasswordResetRequired
, lpUserName
, EntityType (..)
, SummaryKeyType (..)
, GroupDetail
, groupDetail
, gdArn
, gdCreateDate
, gdGroupId
, gdGroupName
, gdGroupPolicyList
, gdPath
, ReportStateType (..)
, User
, user
, uArn
, uCreateDate
, uPasswordLastUsed
, uPath
, uUserId
, uUserName
, PolicyDetail
, policyDetail
, pdPolicyDocument
, pdPolicyName
, StatusType (..)
, SAMLProviderListEntry
, samlproviderListEntry
, samlpleArn
, samlpleCreateDate
, samlpleValidUntil
, Role
, role
, rArn
, rAssumeRolePolicyDocument
, rCreateDate
, rPath
, rRoleId
, rRoleName
, PolicyGroup
, policyGroup
, pgGroupName
, PolicyScopeType (..)
, UserDetail
, userDetail
, udArn
, udCreateDate
, udGroupList
, udPath
, udUserId
, udUserName
, udUserPolicyList
, Policy
, policy
, pArn
, pAttachmentCount
, pCreateDate
, pDefaultVersionId
, pDescription
, pIsAttachable
, pPath
, pPolicyId
, pPolicyName
, pUpdateDate
, 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
, PolicyUser
, policyUser
, puUserName
) where
import Network.AWS.Prelude
import Network.AWS.Signing
import qualified GHC.Exts
data IAM
instance AWSService IAM where
type Sg IAM = V4
type Er IAM = RESTError
service = service'
where
service' :: Service IAM
service' = Service
{ _svcAbbrev = "IAM"
, _svcPrefix = "iam"
, _svcVersion = "2010-05-08"
, _svcTargetPrefix = Nothing
, _svcJSONVersion = Nothing
, _svcHandle = handle
, _svcRetry = retry
}
handle :: Status
-> Maybe (LazyByteString -> ServiceError RESTError)
handle = restError statusSuccess service'
retry :: Retry IAM
retry = Exponential
{ _retryBase = 0.05
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check :: Status
-> RESTError
-> Bool
check (statusCode -> s) (awsErrorCode -> e)
| s == 400 && "Throttling" == e = True
| s == 500 = True
| s == 509 = True
| s == 503 = True
| otherwise = False
ns :: Text
ns = "https://iam.amazonaws.com/doc/2010-05-08/"
newtype PolicyRole = PolicyRole
{ _prRoleName :: Maybe Text
} deriving (Eq, Ord, Read, Show, Monoid)
policyRole :: PolicyRole
policyRole = PolicyRole
{ _prRoleName = Nothing
}
prRoleName :: Lens' PolicyRole (Maybe Text)
prRoleName = lens _prRoleName (\s a -> s { _prRoleName = a })
instance FromXML PolicyRole where
parseXML x = PolicyRole
<$> x .@? "RoleName"
instance ToQuery PolicyRole where
toQuery PolicyRole{..} = mconcat
[ "RoleName" =? _prRoleName
]
data AssignmentStatusType
= Any
| Assigned
| Unassigned
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable AssignmentStatusType
instance FromText AssignmentStatusType where
parser = takeLowerText >>= \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, Read, 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, Read, 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 AttachedPolicy = AttachedPolicy
{ _apPolicyArn :: Maybe Text
, _apPolicyName :: Maybe Text
} deriving (Eq, Ord, Read, Show)
attachedPolicy :: AttachedPolicy
attachedPolicy = AttachedPolicy
{ _apPolicyName = Nothing
, _apPolicyArn = Nothing
}
apPolicyArn :: Lens' AttachedPolicy (Maybe Text)
apPolicyArn = lens _apPolicyArn (\s a -> s { _apPolicyArn = a })
apPolicyName :: Lens' AttachedPolicy (Maybe Text)
apPolicyName = lens _apPolicyName (\s a -> s { _apPolicyName = a })
instance FromXML AttachedPolicy where
parseXML x = AttachedPolicy
<$> x .@? "PolicyArn"
<*> x .@? "PolicyName"
instance ToQuery AttachedPolicy where
toQuery AttachedPolicy{..} = mconcat
[ "PolicyArn" =? _apPolicyArn
, "PolicyName" =? _apPolicyName
]
data MFADevice = MFADevice
{ _mfadEnableDate :: ISO8601
, _mfadSerialNumber :: Text
, _mfadUserName :: Text
} deriving (Eq, Ord, Read, 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 PolicyVersion = PolicyVersion
{ _pvCreateDate :: Maybe ISO8601
, _pvDocument :: Maybe Text
, _pvIsDefaultVersion :: Maybe Bool
, _pvVersionId :: Maybe Text
} deriving (Eq, Ord, Read, Show)
policyVersion :: PolicyVersion
policyVersion = PolicyVersion
{ _pvDocument = Nothing
, _pvVersionId = Nothing
, _pvIsDefaultVersion = Nothing
, _pvCreateDate = Nothing
}
pvCreateDate :: Lens' PolicyVersion (Maybe UTCTime)
pvCreateDate = lens _pvCreateDate (\s a -> s { _pvCreateDate = a }) . mapping _Time
pvDocument :: Lens' PolicyVersion (Maybe Text)
pvDocument = lens _pvDocument (\s a -> s { _pvDocument = a })
pvIsDefaultVersion :: Lens' PolicyVersion (Maybe Bool)
pvIsDefaultVersion =
lens _pvIsDefaultVersion (\s a -> s { _pvIsDefaultVersion = a })
pvVersionId :: Lens' PolicyVersion (Maybe Text)
pvVersionId = lens _pvVersionId (\s a -> s { _pvVersionId = a })
instance FromXML PolicyVersion where
parseXML x = PolicyVersion
<$> x .@? "CreateDate"
<*> x .@? "Document"
<*> x .@? "IsDefaultVersion"
<*> x .@? "VersionId"
instance ToQuery PolicyVersion where
toQuery PolicyVersion{..} = mconcat
[ "CreateDate" =? _pvCreateDate
, "Document" =? _pvDocument
, "IsDefaultVersion" =? _pvIsDefaultVersion
, "VersionId" =? _pvVersionId
]
data InstanceProfile = InstanceProfile
{ _ipArn :: Text
, _ipCreateDate :: ISO8601
, _ipInstanceProfileId :: Text
, _ipInstanceProfileName :: Text
, _ipPath :: Text
, _ipRoles :: List "member" Role
} deriving (Eq, Read, 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" .!@ mempty
instance ToQuery InstanceProfile where
toQuery InstanceProfile{..} = mconcat
[ "Arn" =? _ipArn
, "CreateDate" =? _ipCreateDate
, "InstanceProfileId" =? _ipInstanceProfileId
, "InstanceProfileName" =? _ipInstanceProfileName
, "Path" =? _ipPath
, "Roles" =? _ipRoles
]
data RoleDetail = RoleDetail
{ _rdArn :: Maybe Text
, _rdAssumeRolePolicyDocument :: Maybe Text
, _rdCreateDate :: Maybe ISO8601
, _rdInstanceProfileList :: List "member" InstanceProfile
, _rdPath :: Maybe Text
, _rdRoleId :: Maybe Text
, _rdRoleName :: Maybe Text
, _rdRolePolicyList :: List "member" PolicyDetail
} deriving (Eq, Read, Show)
roleDetail :: RoleDetail
roleDetail = RoleDetail
{ _rdPath = Nothing
, _rdRoleName = Nothing
, _rdRoleId = Nothing
, _rdArn = Nothing
, _rdCreateDate = Nothing
, _rdAssumeRolePolicyDocument = Nothing
, _rdInstanceProfileList = mempty
, _rdRolePolicyList = mempty
}
rdArn :: Lens' RoleDetail (Maybe Text)
rdArn = lens _rdArn (\s a -> s { _rdArn = a })
rdAssumeRolePolicyDocument :: Lens' RoleDetail (Maybe Text)
rdAssumeRolePolicyDocument =
lens _rdAssumeRolePolicyDocument
(\s a -> s { _rdAssumeRolePolicyDocument = a })
rdCreateDate :: Lens' RoleDetail (Maybe UTCTime)
rdCreateDate = lens _rdCreateDate (\s a -> s { _rdCreateDate = a }) . mapping _Time
rdInstanceProfileList :: Lens' RoleDetail [InstanceProfile]
rdInstanceProfileList =
lens _rdInstanceProfileList (\s a -> s { _rdInstanceProfileList = a })
. _List
rdPath :: Lens' RoleDetail (Maybe Text)
rdPath = lens _rdPath (\s a -> s { _rdPath = a })
rdRoleId :: Lens' RoleDetail (Maybe Text)
rdRoleId = lens _rdRoleId (\s a -> s { _rdRoleId = a })
rdRoleName :: Lens' RoleDetail (Maybe Text)
rdRoleName = lens _rdRoleName (\s a -> s { _rdRoleName = a })
rdRolePolicyList :: Lens' RoleDetail [PolicyDetail]
rdRolePolicyList = lens _rdRolePolicyList (\s a -> s { _rdRolePolicyList = a }) . _List
instance FromXML RoleDetail where
parseXML x = RoleDetail
<$> x .@? "Arn"
<*> x .@? "AssumeRolePolicyDocument"
<*> x .@? "CreateDate"
<*> x .@? "InstanceProfileList" .!@ mempty
<*> x .@? "Path"
<*> x .@? "RoleId"
<*> x .@? "RoleName"
<*> x .@? "RolePolicyList" .!@ mempty
instance ToQuery RoleDetail where
toQuery RoleDetail{..} = mconcat
[ "Arn" =? _rdArn
, "AssumeRolePolicyDocument" =? _rdAssumeRolePolicyDocument
, "CreateDate" =? _rdCreateDate
, "InstanceProfileList" =? _rdInstanceProfileList
, "Path" =? _rdPath
, "RoleId" =? _rdRoleId
, "RoleName" =? _rdRoleName
, "RolePolicyList" =? _rdRolePolicyList
]
data ReportFormatType
= TextCsv
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable ReportFormatType
instance FromText ReportFormatType where
parser = takeLowerText >>= \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, Read, 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, Read, 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, Read, 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 EntityType
= ETGroup
| ETRole
| ETUser
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable EntityType
instance FromText EntityType where
parser = takeLowerText >>= \case
"group" -> pure ETGroup
"role" -> pure ETRole
"user" -> pure ETUser
e -> fail $
"Failure parsing EntityType from " ++ show e
instance ToText EntityType where
toText = \case
ETGroup -> "Group"
ETRole -> "Role"
ETUser -> "User"
instance ToByteString EntityType
instance ToHeader EntityType
instance ToQuery EntityType
instance FromXML EntityType where
parseXML = parseXMLText "EntityType"
data SummaryKeyType
= AccessKeysPerUserQuota
| AccountAccessKeysPresent
| AccountMFAEnabled
| AccountSigningCertificatesPresent
| AttachedPoliciesPerGroupQuota
| AttachedPoliciesPerRoleQuota
| AttachedPoliciesPerUserQuota
| GroupPolicySizeQuota
| Groups
| GroupsPerUserQuota
| GroupsQuota
| MFADevices
| MFADevicesInUse
| Policies
| PoliciesQuota
| PolicySizeQuota
| PolicyVersionsInUse
| PolicyVersionsInUseQuota
| ServerCertificates
| ServerCertificatesQuota
| SigningCertificatesPerUserQuota
| UserPolicySizeQuota
| Users
| UsersQuota
| VersionsPerPolicyQuota
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable SummaryKeyType
instance FromText SummaryKeyType where
parser = takeLowerText >>= \case
"accesskeysperuserquota" -> pure AccessKeysPerUserQuota
"accountaccesskeyspresent" -> pure AccountAccessKeysPresent
"accountmfaenabled" -> pure AccountMFAEnabled
"accountsigningcertificatespresent" -> pure AccountSigningCertificatesPresent
"attachedpoliciespergroupquota" -> pure AttachedPoliciesPerGroupQuota
"attachedpoliciesperrolequota" -> pure AttachedPoliciesPerRoleQuota
"attachedpoliciesperuserquota" -> pure AttachedPoliciesPerUserQuota
"grouppolicysizequota" -> pure GroupPolicySizeQuota
"groups" -> pure Groups
"groupsperuserquota" -> pure GroupsPerUserQuota
"groupsquota" -> pure GroupsQuota
"mfadevices" -> pure MFADevices
"mfadevicesinuse" -> pure MFADevicesInUse
"policies" -> pure Policies
"policiesquota" -> pure PoliciesQuota
"policysizequota" -> pure PolicySizeQuota
"policyversionsinuse" -> pure PolicyVersionsInUse
"policyversionsinusequota" -> pure PolicyVersionsInUseQuota
"servercertificates" -> pure ServerCertificates
"servercertificatesquota" -> pure ServerCertificatesQuota
"signingcertificatesperuserquota" -> pure SigningCertificatesPerUserQuota
"userpolicysizequota" -> pure UserPolicySizeQuota
"users" -> pure Users
"usersquota" -> pure UsersQuota
"versionsperpolicyquota" -> pure VersionsPerPolicyQuota
e -> fail $
"Failure parsing SummaryKeyType from " ++ show e
instance ToText SummaryKeyType where
toText = \case
AccessKeysPerUserQuota -> "AccessKeysPerUserQuota"
AccountAccessKeysPresent -> "AccountAccessKeysPresent"
AccountMFAEnabled -> "AccountMFAEnabled"
AccountSigningCertificatesPresent -> "AccountSigningCertificatesPresent"
AttachedPoliciesPerGroupQuota -> "AttachedPoliciesPerGroupQuota"
AttachedPoliciesPerRoleQuota -> "AttachedPoliciesPerRoleQuota"
AttachedPoliciesPerUserQuota -> "AttachedPoliciesPerUserQuota"
GroupPolicySizeQuota -> "GroupPolicySizeQuota"
Groups -> "Groups"
GroupsPerUserQuota -> "GroupsPerUserQuota"
GroupsQuota -> "GroupsQuota"
MFADevices -> "MFADevices"
MFADevicesInUse -> "MFADevicesInUse"
Policies -> "Policies"
PoliciesQuota -> "PoliciesQuota"
PolicySizeQuota -> "PolicySizeQuota"
PolicyVersionsInUse -> "PolicyVersionsInUse"
PolicyVersionsInUseQuota -> "PolicyVersionsInUseQuota"
ServerCertificates -> "ServerCertificates"
ServerCertificatesQuota -> "ServerCertificatesQuota"
SigningCertificatesPerUserQuota -> "SigningCertificatesPerUserQuota"
UserPolicySizeQuota -> "UserPolicySizeQuota"
Users -> "Users"
UsersQuota -> "UsersQuota"
VersionsPerPolicyQuota -> "VersionsPerPolicyQuota"
instance ToByteString SummaryKeyType
instance ToHeader SummaryKeyType
instance ToQuery SummaryKeyType
instance FromXML SummaryKeyType where
parseXML = parseXMLText "SummaryKeyType"
data GroupDetail = GroupDetail
{ _gdArn :: Maybe Text
, _gdCreateDate :: Maybe ISO8601
, _gdGroupId :: Maybe Text
, _gdGroupName :: Maybe Text
, _gdGroupPolicyList :: List "member" PolicyDetail
, _gdPath :: Maybe Text
} deriving (Eq, Read, Show)
groupDetail :: GroupDetail
groupDetail = GroupDetail
{ _gdPath = Nothing
, _gdGroupName = Nothing
, _gdGroupId = Nothing
, _gdArn = Nothing
, _gdCreateDate = Nothing
, _gdGroupPolicyList = mempty
}
gdArn :: Lens' GroupDetail (Maybe Text)
gdArn = lens _gdArn (\s a -> s { _gdArn = a })
gdCreateDate :: Lens' GroupDetail (Maybe UTCTime)
gdCreateDate = lens _gdCreateDate (\s a -> s { _gdCreateDate = a }) . mapping _Time
gdGroupId :: Lens' GroupDetail (Maybe Text)
gdGroupId = lens _gdGroupId (\s a -> s { _gdGroupId = a })
gdGroupName :: Lens' GroupDetail (Maybe Text)
gdGroupName = lens _gdGroupName (\s a -> s { _gdGroupName = a })
gdGroupPolicyList :: Lens' GroupDetail [PolicyDetail]
gdGroupPolicyList =
lens _gdGroupPolicyList (\s a -> s { _gdGroupPolicyList = a })
. _List
gdPath :: Lens' GroupDetail (Maybe Text)
gdPath = lens _gdPath (\s a -> s { _gdPath = a })
instance FromXML GroupDetail where
parseXML x = GroupDetail
<$> x .@? "Arn"
<*> x .@? "CreateDate"
<*> x .@? "GroupId"
<*> x .@? "GroupName"
<*> x .@? "GroupPolicyList" .!@ mempty
<*> x .@? "Path"
instance ToQuery GroupDetail where
toQuery GroupDetail{..} = mconcat
[ "Arn" =? _gdArn
, "CreateDate" =? _gdCreateDate
, "GroupId" =? _gdGroupId
, "GroupName" =? _gdGroupName
, "GroupPolicyList" =? _gdGroupPolicyList
, "Path" =? _gdPath
]
data ReportStateType
= Complete
| Inprogress
| Started
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable ReportStateType
instance FromText ReportStateType where
parser = takeLowerText >>= \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, Read, 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 PolicyDetail = PolicyDetail
{ _pdPolicyDocument :: Maybe Text
, _pdPolicyName :: Maybe Text
} deriving (Eq, Ord, Read, Show)
policyDetail :: PolicyDetail
policyDetail = PolicyDetail
{ _pdPolicyName = Nothing
, _pdPolicyDocument = Nothing
}
pdPolicyDocument :: Lens' PolicyDetail (Maybe Text)
pdPolicyDocument = lens _pdPolicyDocument (\s a -> s { _pdPolicyDocument = a })
pdPolicyName :: Lens' PolicyDetail (Maybe Text)
pdPolicyName = lens _pdPolicyName (\s a -> s { _pdPolicyName = a })
instance FromXML PolicyDetail where
parseXML x = PolicyDetail
<$> x .@? "PolicyDocument"
<*> x .@? "PolicyName"
instance ToQuery PolicyDetail where
toQuery PolicyDetail{..} = mconcat
[ "PolicyDocument" =? _pdPolicyDocument
, "PolicyName" =? _pdPolicyName
]
data StatusType
= Active
| Inactive
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable StatusType
instance FromText StatusType where
parser = takeLowerText >>= \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, Read, 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, Read, 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
]
newtype PolicyGroup = PolicyGroup
{ _pgGroupName :: Maybe Text
} deriving (Eq, Ord, Read, Show, Monoid)
policyGroup :: PolicyGroup
policyGroup = PolicyGroup
{ _pgGroupName = Nothing
}
pgGroupName :: Lens' PolicyGroup (Maybe Text)
pgGroupName = lens _pgGroupName (\s a -> s { _pgGroupName = a })
instance FromXML PolicyGroup where
parseXML x = PolicyGroup
<$> x .@? "GroupName"
instance ToQuery PolicyGroup where
toQuery PolicyGroup{..} = mconcat
[ "GroupName" =? _pgGroupName
]
data PolicyScopeType
= All
| Aws
| Local
deriving (Eq, Ord, Read, Show, Generic, Enum)
instance Hashable PolicyScopeType
instance FromText PolicyScopeType where
parser = takeLowerText >>= \case
"all" -> pure All
"aws" -> pure Aws
"local" -> pure Local
e -> fail $
"Failure parsing PolicyScopeType from " ++ show e
instance ToText PolicyScopeType where
toText = \case
All -> "All"
Aws -> "AWS"
Local -> "Local"
instance ToByteString PolicyScopeType
instance ToHeader PolicyScopeType
instance ToQuery PolicyScopeType
instance FromXML PolicyScopeType where
parseXML = parseXMLText "PolicyScopeType"
data UserDetail = UserDetail
{ _udArn :: Maybe Text
, _udCreateDate :: Maybe ISO8601
, _udGroupList :: List "member" Text
, _udPath :: Maybe Text
, _udUserId :: Maybe Text
, _udUserName :: Maybe Text
, _udUserPolicyList :: List "member" PolicyDetail
} deriving (Eq, Read, Show)
userDetail :: UserDetail
userDetail = UserDetail
{ _udPath = Nothing
, _udUserName = Nothing
, _udUserId = Nothing
, _udArn = Nothing
, _udCreateDate = Nothing
, _udUserPolicyList = mempty
, _udGroupList = mempty
}
udArn :: Lens' UserDetail (Maybe Text)
udArn = lens _udArn (\s a -> s { _udArn = a })
udCreateDate :: Lens' UserDetail (Maybe UTCTime)
udCreateDate = lens _udCreateDate (\s a -> s { _udCreateDate = a }) . mapping _Time
udGroupList :: Lens' UserDetail [Text]
udGroupList = lens _udGroupList (\s a -> s { _udGroupList = a }) . _List
udPath :: Lens' UserDetail (Maybe Text)
udPath = lens _udPath (\s a -> s { _udPath = a })
udUserId :: Lens' UserDetail (Maybe Text)
udUserId = lens _udUserId (\s a -> s { _udUserId = a })
udUserName :: Lens' UserDetail (Maybe Text)
udUserName = lens _udUserName (\s a -> s { _udUserName = a })
udUserPolicyList :: Lens' UserDetail [PolicyDetail]
udUserPolicyList = lens _udUserPolicyList (\s a -> s { _udUserPolicyList = a }) . _List
instance FromXML UserDetail where
parseXML x = UserDetail
<$> x .@? "Arn"
<*> x .@? "CreateDate"
<*> x .@? "GroupList" .!@ mempty
<*> x .@? "Path"
<*> x .@? "UserId"
<*> x .@? "UserName"
<*> x .@? "UserPolicyList" .!@ mempty
instance ToQuery UserDetail where
toQuery UserDetail{..} = mconcat
[ "Arn" =? _udArn
, "CreateDate" =? _udCreateDate
, "GroupList" =? _udGroupList
, "Path" =? _udPath
, "UserId" =? _udUserId
, "UserName" =? _udUserName
, "UserPolicyList" =? _udUserPolicyList
]
data Policy = Policy
{ _pArn :: Maybe Text
, _pAttachmentCount :: Maybe Int
, _pCreateDate :: Maybe ISO8601
, _pDefaultVersionId :: Maybe Text
, _pDescription :: Maybe Text
, _pIsAttachable :: Maybe Bool
, _pPath :: Maybe Text
, _pPolicyId :: Maybe Text
, _pPolicyName :: Maybe Text
, _pUpdateDate :: Maybe ISO8601
} deriving (Eq, Ord, Read, Show)
policy :: Policy
policy = Policy
{ _pPolicyName = Nothing
, _pPolicyId = Nothing
, _pArn = Nothing
, _pPath = Nothing
, _pDefaultVersionId = Nothing
, _pAttachmentCount = Nothing
, _pIsAttachable = Nothing
, _pDescription = Nothing
, _pCreateDate = Nothing
, _pUpdateDate = Nothing
}
pArn :: Lens' Policy (Maybe Text)
pArn = lens _pArn (\s a -> s { _pArn = a })
pAttachmentCount :: Lens' Policy (Maybe Int)
pAttachmentCount = lens _pAttachmentCount (\s a -> s { _pAttachmentCount = a })
pCreateDate :: Lens' Policy (Maybe UTCTime)
pCreateDate = lens _pCreateDate (\s a -> s { _pCreateDate = a }) . mapping _Time
pDefaultVersionId :: Lens' Policy (Maybe Text)
pDefaultVersionId =
lens _pDefaultVersionId (\s a -> s { _pDefaultVersionId = a })
pDescription :: Lens' Policy (Maybe Text)
pDescription = lens _pDescription (\s a -> s { _pDescription = a })
pIsAttachable :: Lens' Policy (Maybe Bool)
pIsAttachable = lens _pIsAttachable (\s a -> s { _pIsAttachable = a })
pPath :: Lens' Policy (Maybe Text)
pPath = lens _pPath (\s a -> s { _pPath = a })
pPolicyId :: Lens' Policy (Maybe Text)
pPolicyId = lens _pPolicyId (\s a -> s { _pPolicyId = a })
pPolicyName :: Lens' Policy (Maybe Text)
pPolicyName = lens _pPolicyName (\s a -> s { _pPolicyName = a })
pUpdateDate :: Lens' Policy (Maybe UTCTime)
pUpdateDate = lens _pUpdateDate (\s a -> s { _pUpdateDate = a }) . mapping _Time
instance FromXML Policy where
parseXML x = Policy
<$> x .@? "Arn"
<*> x .@? "AttachmentCount"
<*> x .@? "CreateDate"
<*> x .@? "DefaultVersionId"
<*> x .@? "Description"
<*> x .@? "IsAttachable"
<*> x .@? "Path"
<*> x .@? "PolicyId"
<*> x .@? "PolicyName"
<*> x .@? "UpdateDate"
instance ToQuery Policy where
toQuery Policy{..} = mconcat
[ "Arn" =? _pArn
, "AttachmentCount" =? _pAttachmentCount
, "CreateDate" =? _pCreateDate
, "DefaultVersionId" =? _pDefaultVersionId
, "Description" =? _pDescription
, "IsAttachable" =? _pIsAttachable
, "Path" =? _pPath
, "PolicyId" =? _pPolicyId
, "PolicyName" =? _pPolicyName
, "UpdateDate" =? _pUpdateDate
]
data ServerCertificate = ServerCertificate
{ _scCertificateBody :: Text
, _scCertificateChain :: Maybe Text
, _scServerCertificateMetadata :: ServerCertificateMetadata
} deriving (Eq, Read, 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, Read, 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, Read, 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, Read, 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, Read, 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
]
newtype PolicyUser = PolicyUser
{ _puUserName :: Maybe Text
} deriving (Eq, Ord, Read, Show, Monoid)
policyUser :: PolicyUser
policyUser = PolicyUser
{ _puUserName = Nothing
}
puUserName :: Lens' PolicyUser (Maybe Text)
puUserName = lens _puUserName (\s a -> s { _puUserName = a })
instance FromXML PolicyUser where
parseXML x = PolicyUser
<$> x .@? "UserName"
instance ToQuery PolicyUser where
toQuery PolicyUser{..} = mconcat
[ "UserName" =? _puUserName
]