{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.BinaryAuthorization.Types.Product where
import Network.Google.BinaryAuthorization.Types.Sum
import Network.Google.Prelude
data Expr = Expr'
{ _eLocation :: !(Maybe Text)
, _eExpression :: !(Maybe Text)
, _eTitle :: !(Maybe Text)
, _eDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
expr
:: Expr
expr =
Expr'
{ _eLocation = Nothing
, _eExpression = Nothing
, _eTitle = Nothing
, _eDescription = Nothing
}
eLocation :: Lens' Expr (Maybe Text)
eLocation
= lens _eLocation (\ s a -> s{_eLocation = a})
eExpression :: Lens' Expr (Maybe Text)
eExpression
= lens _eExpression (\ s a -> s{_eExpression = a})
eTitle :: Lens' Expr (Maybe Text)
eTitle = lens _eTitle (\ s a -> s{_eTitle = a})
eDescription :: Lens' Expr (Maybe Text)
eDescription
= lens _eDescription (\ s a -> s{_eDescription = a})
instance FromJSON Expr where
parseJSON
= withObject "Expr"
(\ o ->
Expr' <$>
(o .:? "location") <*> (o .:? "expression") <*>
(o .:? "title")
<*> (o .:? "description"))
instance ToJSON Expr where
toJSON Expr'{..}
= object
(catMaybes
[("location" .=) <$> _eLocation,
("expression" .=) <$> _eExpression,
("title" .=) <$> _eTitle,
("description" .=) <$> _eDescription])
data UserOwnedDrydockNote = UserOwnedDrydockNote'
{ _uodnDelegationServiceAccountEmail :: !(Maybe Text)
, _uodnPublicKeys :: !(Maybe [AttestorPublicKey])
, _uodnNoteReference :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
userOwnedDrydockNote
:: UserOwnedDrydockNote
userOwnedDrydockNote =
UserOwnedDrydockNote'
{ _uodnDelegationServiceAccountEmail = Nothing
, _uodnPublicKeys = Nothing
, _uodnNoteReference = Nothing
}
uodnDelegationServiceAccountEmail :: Lens' UserOwnedDrydockNote (Maybe Text)
uodnDelegationServiceAccountEmail
= lens _uodnDelegationServiceAccountEmail
(\ s a -> s{_uodnDelegationServiceAccountEmail = a})
uodnPublicKeys :: Lens' UserOwnedDrydockNote [AttestorPublicKey]
uodnPublicKeys
= lens _uodnPublicKeys
(\ s a -> s{_uodnPublicKeys = a})
. _Default
. _Coerce
uodnNoteReference :: Lens' UserOwnedDrydockNote (Maybe Text)
uodnNoteReference
= lens _uodnNoteReference
(\ s a -> s{_uodnNoteReference = a})
instance FromJSON UserOwnedDrydockNote where
parseJSON
= withObject "UserOwnedDrydockNote"
(\ o ->
UserOwnedDrydockNote' <$>
(o .:? "delegationServiceAccountEmail") <*>
(o .:? "publicKeys" .!= mempty)
<*> (o .:? "noteReference"))
instance ToJSON UserOwnedDrydockNote where
toJSON UserOwnedDrydockNote'{..}
= object
(catMaybes
[("delegationServiceAccountEmail" .=) <$>
_uodnDelegationServiceAccountEmail,
("publicKeys" .=) <$> _uodnPublicKeys,
("noteReference" .=) <$> _uodnNoteReference])
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
newtype SetIAMPolicyRequest = SetIAMPolicyRequest'
{ _siprPolicy :: Maybe IAMPolicy
} deriving (Eq,Show,Data,Typeable,Generic)
setIAMPolicyRequest
:: SetIAMPolicyRequest
setIAMPolicyRequest =
SetIAMPolicyRequest'
{ _siprPolicy = Nothing
}
siprPolicy :: Lens' SetIAMPolicyRequest (Maybe IAMPolicy)
siprPolicy
= lens _siprPolicy (\ s a -> s{_siprPolicy = a})
instance FromJSON SetIAMPolicyRequest where
parseJSON
= withObject "SetIAMPolicyRequest"
(\ o -> SetIAMPolicyRequest' <$> (o .:? "policy"))
instance ToJSON SetIAMPolicyRequest where
toJSON SetIAMPolicyRequest'{..}
= object (catMaybes [("policy" .=) <$> _siprPolicy])
data ListAttestorsResponse = ListAttestorsResponse'
{ _larNextPageToken :: !(Maybe Text)
, _larAttestors :: !(Maybe [Attestor])
} deriving (Eq,Show,Data,Typeable,Generic)
listAttestorsResponse
:: ListAttestorsResponse
listAttestorsResponse =
ListAttestorsResponse'
{ _larNextPageToken = Nothing
, _larAttestors = Nothing
}
larNextPageToken :: Lens' ListAttestorsResponse (Maybe Text)
larNextPageToken
= lens _larNextPageToken
(\ s a -> s{_larNextPageToken = a})
larAttestors :: Lens' ListAttestorsResponse [Attestor]
larAttestors
= lens _larAttestors (\ s a -> s{_larAttestors = a})
. _Default
. _Coerce
instance FromJSON ListAttestorsResponse where
parseJSON
= withObject "ListAttestorsResponse"
(\ o ->
ListAttestorsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "attestors" .!= mempty))
instance ToJSON ListAttestorsResponse where
toJSON ListAttestorsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _larNextPageToken,
("attestors" .=) <$> _larAttestors])
newtype AdmissionWhiteListPattern = AdmissionWhiteListPattern'
{ _awlpNamePattern :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
admissionWhiteListPattern
:: AdmissionWhiteListPattern
admissionWhiteListPattern =
AdmissionWhiteListPattern'
{ _awlpNamePattern = Nothing
}
awlpNamePattern :: Lens' AdmissionWhiteListPattern (Maybe Text)
awlpNamePattern
= lens _awlpNamePattern
(\ s a -> s{_awlpNamePattern = a})
instance FromJSON AdmissionWhiteListPattern where
parseJSON
= withObject "AdmissionWhiteListPattern"
(\ o ->
AdmissionWhiteListPattern' <$> (o .:? "namePattern"))
instance ToJSON AdmissionWhiteListPattern where
toJSON AdmissionWhiteListPattern'{..}
= object
(catMaybes [("namePattern" .=) <$> _awlpNamePattern])
data AdmissionRule = AdmissionRule'
{ _arEnforcementMode :: !(Maybe AdmissionRuleEnforcementMode)
, _arEvaluationMode :: !(Maybe AdmissionRuleEvaluationMode)
, _arRequireAttestationsBy :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
admissionRule
:: AdmissionRule
admissionRule =
AdmissionRule'
{ _arEnforcementMode = Nothing
, _arEvaluationMode = Nothing
, _arRequireAttestationsBy = Nothing
}
arEnforcementMode :: Lens' AdmissionRule (Maybe AdmissionRuleEnforcementMode)
arEnforcementMode
= lens _arEnforcementMode
(\ s a -> s{_arEnforcementMode = a})
arEvaluationMode :: Lens' AdmissionRule (Maybe AdmissionRuleEvaluationMode)
arEvaluationMode
= lens _arEvaluationMode
(\ s a -> s{_arEvaluationMode = a})
arRequireAttestationsBy :: Lens' AdmissionRule [Text]
arRequireAttestationsBy
= lens _arRequireAttestationsBy
(\ s a -> s{_arRequireAttestationsBy = a})
. _Default
. _Coerce
instance FromJSON AdmissionRule where
parseJSON
= withObject "AdmissionRule"
(\ o ->
AdmissionRule' <$>
(o .:? "enforcementMode") <*>
(o .:? "evaluationMode")
<*> (o .:? "requireAttestationsBy" .!= mempty))
instance ToJSON AdmissionRule where
toJSON AdmissionRule'{..}
= object
(catMaybes
[("enforcementMode" .=) <$> _arEnforcementMode,
("evaluationMode" .=) <$> _arEvaluationMode,
("requireAttestationsBy" .=) <$>
_arRequireAttestationsBy])
newtype TestIAMPermissionsRequest = TestIAMPermissionsRequest'
{ _tiprPermissions :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
testIAMPermissionsRequest
:: TestIAMPermissionsRequest
testIAMPermissionsRequest =
TestIAMPermissionsRequest'
{ _tiprPermissions = Nothing
}
tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
tiprPermissions
= lens _tiprPermissions
(\ s a -> s{_tiprPermissions = a})
. _Default
. _Coerce
instance FromJSON TestIAMPermissionsRequest where
parseJSON
= withObject "TestIAMPermissionsRequest"
(\ o ->
TestIAMPermissionsRequest' <$>
(o .:? "permissions" .!= mempty))
instance ToJSON TestIAMPermissionsRequest where
toJSON TestIAMPermissionsRequest'{..}
= object
(catMaybes [("permissions" .=) <$> _tiprPermissions])
data IAMPolicy = IAMPolicy'
{ _ipEtag :: !(Maybe Bytes)
, _ipVersion :: !(Maybe (Textual Int32))
, _ipBindings :: !(Maybe [Binding])
} deriving (Eq,Show,Data,Typeable,Generic)
iamPolicy
:: IAMPolicy
iamPolicy =
IAMPolicy'
{ _ipEtag = Nothing
, _ipVersion = Nothing
, _ipBindings = Nothing
}
ipEtag :: Lens' IAMPolicy (Maybe ByteString)
ipEtag
= lens _ipEtag (\ s a -> s{_ipEtag = a}) .
mapping _Bytes
ipVersion :: Lens' IAMPolicy (Maybe Int32)
ipVersion
= lens _ipVersion (\ s a -> s{_ipVersion = a}) .
mapping _Coerce
ipBindings :: Lens' IAMPolicy [Binding]
ipBindings
= lens _ipBindings (\ s a -> s{_ipBindings = a}) .
_Default
. _Coerce
instance FromJSON IAMPolicy where
parseJSON
= withObject "IAMPolicy"
(\ o ->
IAMPolicy' <$>
(o .:? "etag") <*> (o .:? "version") <*>
(o .:? "bindings" .!= mempty))
instance ToJSON IAMPolicy where
toJSON IAMPolicy'{..}
= object
(catMaybes
[("etag" .=) <$> _ipEtag,
("version" .=) <$> _ipVersion,
("bindings" .=) <$> _ipBindings])
data AttestorPublicKey = AttestorPublicKey'
{ _apkAsciiArmoredPgpPublicKey :: !(Maybe Text)
, _apkId :: !(Maybe Text)
, _apkComment :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
attestorPublicKey
:: AttestorPublicKey
attestorPublicKey =
AttestorPublicKey'
{ _apkAsciiArmoredPgpPublicKey = Nothing
, _apkId = Nothing
, _apkComment = Nothing
}
apkAsciiArmoredPgpPublicKey :: Lens' AttestorPublicKey (Maybe Text)
apkAsciiArmoredPgpPublicKey
= lens _apkAsciiArmoredPgpPublicKey
(\ s a -> s{_apkAsciiArmoredPgpPublicKey = a})
apkId :: Lens' AttestorPublicKey (Maybe Text)
apkId = lens _apkId (\ s a -> s{_apkId = a})
apkComment :: Lens' AttestorPublicKey (Maybe Text)
apkComment
= lens _apkComment (\ s a -> s{_apkComment = a})
instance FromJSON AttestorPublicKey where
parseJSON
= withObject "AttestorPublicKey"
(\ o ->
AttestorPublicKey' <$>
(o .:? "asciiArmoredPgpPublicKey") <*> (o .:? "id")
<*> (o .:? "comment"))
instance ToJSON AttestorPublicKey where
toJSON AttestorPublicKey'{..}
= object
(catMaybes
[("asciiArmoredPgpPublicKey" .=) <$>
_apkAsciiArmoredPgpPublicKey,
("id" .=) <$> _apkId,
("comment" .=) <$> _apkComment])
newtype TestIAMPermissionsResponse = TestIAMPermissionsResponse'
{ _tiamprPermissions :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
testIAMPermissionsResponse
:: TestIAMPermissionsResponse
testIAMPermissionsResponse =
TestIAMPermissionsResponse'
{ _tiamprPermissions = Nothing
}
tiamprPermissions :: Lens' TestIAMPermissionsResponse [Text]
tiamprPermissions
= lens _tiamprPermissions
(\ s a -> s{_tiamprPermissions = a})
. _Default
. _Coerce
instance FromJSON TestIAMPermissionsResponse where
parseJSON
= withObject "TestIAMPermissionsResponse"
(\ o ->
TestIAMPermissionsResponse' <$>
(o .:? "permissions" .!= mempty))
instance ToJSON TestIAMPermissionsResponse where
toJSON TestIAMPermissionsResponse'{..}
= object
(catMaybes
[("permissions" .=) <$> _tiamprPermissions])
data Policy = Policy'
{ _pDefaultAdmissionRule :: !(Maybe AdmissionRule)
, _pAdmissionWhiteListPatterns :: !(Maybe [AdmissionWhiteListPattern])
, _pClusterAdmissionRules :: !(Maybe PolicyClusterAdmissionRules)
, _pUpdateTime :: !(Maybe DateTime')
, _pName :: !(Maybe Text)
, _pDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
policy
:: Policy
policy =
Policy'
{ _pDefaultAdmissionRule = Nothing
, _pAdmissionWhiteListPatterns = Nothing
, _pClusterAdmissionRules = Nothing
, _pUpdateTime = Nothing
, _pName = Nothing
, _pDescription = Nothing
}
pDefaultAdmissionRule :: Lens' Policy (Maybe AdmissionRule)
pDefaultAdmissionRule
= lens _pDefaultAdmissionRule
(\ s a -> s{_pDefaultAdmissionRule = a})
pAdmissionWhiteListPatterns :: Lens' Policy [AdmissionWhiteListPattern]
pAdmissionWhiteListPatterns
= lens _pAdmissionWhiteListPatterns
(\ s a -> s{_pAdmissionWhiteListPatterns = a})
. _Default
. _Coerce
pClusterAdmissionRules :: Lens' Policy (Maybe PolicyClusterAdmissionRules)
pClusterAdmissionRules
= lens _pClusterAdmissionRules
(\ s a -> s{_pClusterAdmissionRules = a})
pUpdateTime :: Lens' Policy (Maybe UTCTime)
pUpdateTime
= lens _pUpdateTime (\ s a -> s{_pUpdateTime = a}) .
mapping _DateTime
pName :: Lens' Policy (Maybe Text)
pName = lens _pName (\ s a -> s{_pName = a})
pDescription :: Lens' Policy (Maybe Text)
pDescription
= lens _pDescription (\ s a -> s{_pDescription = a})
instance FromJSON Policy where
parseJSON
= withObject "Policy"
(\ o ->
Policy' <$>
(o .:? "defaultAdmissionRule") <*>
(o .:? "admissionWhitelistPatterns" .!= mempty)
<*> (o .:? "clusterAdmissionRules")
<*> (o .:? "updateTime")
<*> (o .:? "name")
<*> (o .:? "description"))
instance ToJSON Policy where
toJSON Policy'{..}
= object
(catMaybes
[("defaultAdmissionRule" .=) <$>
_pDefaultAdmissionRule,
("admissionWhitelistPatterns" .=) <$>
_pAdmissionWhiteListPatterns,
("clusterAdmissionRules" .=) <$>
_pClusterAdmissionRules,
("updateTime" .=) <$> _pUpdateTime,
("name" .=) <$> _pName,
("description" .=) <$> _pDescription])
newtype PolicyClusterAdmissionRules = PolicyClusterAdmissionRules'
{ _pcarAddtional :: HashMap Text AdmissionRule
} deriving (Eq,Show,Data,Typeable,Generic)
policyClusterAdmissionRules
:: HashMap Text AdmissionRule
-> PolicyClusterAdmissionRules
policyClusterAdmissionRules pPcarAddtional_ =
PolicyClusterAdmissionRules'
{ _pcarAddtional = _Coerce # pPcarAddtional_
}
pcarAddtional :: Lens' PolicyClusterAdmissionRules (HashMap Text AdmissionRule)
pcarAddtional
= lens _pcarAddtional
(\ s a -> s{_pcarAddtional = a})
. _Coerce
instance FromJSON PolicyClusterAdmissionRules where
parseJSON
= withObject "PolicyClusterAdmissionRules"
(\ o ->
PolicyClusterAdmissionRules' <$> (parseJSONObject o))
instance ToJSON PolicyClusterAdmissionRules where
toJSON = toJSON . _pcarAddtional
data Attestor = Attestor'
{ _aUserOwnedDrydockNote :: !(Maybe UserOwnedDrydockNote)
, _aUpdateTime :: !(Maybe DateTime')
, _aName :: !(Maybe Text)
, _aDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
attestor
:: Attestor
attestor =
Attestor'
{ _aUserOwnedDrydockNote = Nothing
, _aUpdateTime = Nothing
, _aName = Nothing
, _aDescription = Nothing
}
aUserOwnedDrydockNote :: Lens' Attestor (Maybe UserOwnedDrydockNote)
aUserOwnedDrydockNote
= lens _aUserOwnedDrydockNote
(\ s a -> s{_aUserOwnedDrydockNote = a})
aUpdateTime :: Lens' Attestor (Maybe UTCTime)
aUpdateTime
= lens _aUpdateTime (\ s a -> s{_aUpdateTime = a}) .
mapping _DateTime
aName :: Lens' Attestor (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a})
aDescription :: Lens' Attestor (Maybe Text)
aDescription
= lens _aDescription (\ s a -> s{_aDescription = a})
instance FromJSON Attestor where
parseJSON
= withObject "Attestor"
(\ o ->
Attestor' <$>
(o .:? "userOwnedDrydockNote") <*>
(o .:? "updateTime")
<*> (o .:? "name")
<*> (o .:? "description"))
instance ToJSON Attestor where
toJSON Attestor'{..}
= object
(catMaybes
[("userOwnedDrydockNote" .=) <$>
_aUserOwnedDrydockNote,
("updateTime" .=) <$> _aUpdateTime,
("name" .=) <$> _aName,
("description" .=) <$> _aDescription])
data Binding = Binding'
{ _bMembers :: !(Maybe [Text])
, _bRole :: !(Maybe Text)
, _bCondition :: !(Maybe Expr)
} deriving (Eq,Show,Data,Typeable,Generic)
binding
:: Binding
binding =
Binding'
{ _bMembers = Nothing
, _bRole = Nothing
, _bCondition = Nothing
}
bMembers :: Lens' Binding [Text]
bMembers
= lens _bMembers (\ s a -> s{_bMembers = a}) .
_Default
. _Coerce
bRole :: Lens' Binding (Maybe Text)
bRole = lens _bRole (\ s a -> s{_bRole = a})
bCondition :: Lens' Binding (Maybe Expr)
bCondition
= lens _bCondition (\ s a -> s{_bCondition = a})
instance FromJSON Binding where
parseJSON
= withObject "Binding"
(\ o ->
Binding' <$>
(o .:? "members" .!= mempty) <*> (o .:? "role") <*>
(o .:? "condition"))
instance ToJSON Binding where
toJSON Binding'{..}
= object
(catMaybes
[("members" .=) <$> _bMembers,
("role" .=) <$> _bRole,
("condition" .=) <$> _bCondition])