{-# 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.AccessContextManager.Types.Product where
import Network.Google.AccessContextManager.Types.Sum
import Network.Google.Prelude
data Status =
Status'
{ _sDetails :: !(Maybe [StatusDetailsItem])
, _sCode :: !(Maybe (Textual Int32))
, _sMessage :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
status
:: Status
status = Status' {_sDetails = Nothing, _sCode = Nothing, _sMessage = Nothing}
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
= lens _sDetails (\ s a -> s{_sDetails = a}) .
_Default
. _Coerce
sCode :: Lens' Status (Maybe Int32)
sCode
= lens _sCode (\ s a -> s{_sCode = a}) .
mapping _Coerce
sMessage :: Lens' Status (Maybe Text)
sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
instance FromJSON Status where
parseJSON
= withObject "Status"
(\ o ->
Status' <$>
(o .:? "details" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON Status where
toJSON Status'{..}
= object
(catMaybes
[("details" .=) <$> _sDetails,
("code" .=) <$> _sCode,
("message" .=) <$> _sMessage])
data BasicLevel =
BasicLevel'
{ _blConditions :: !(Maybe [Condition])
, _blCombiningFunction :: !(Maybe BasicLevelCombiningFunction)
}
deriving (Eq, Show, Data, Typeable, Generic)
basicLevel
:: BasicLevel
basicLevel =
BasicLevel' {_blConditions = Nothing, _blCombiningFunction = Nothing}
blConditions :: Lens' BasicLevel [Condition]
blConditions
= lens _blConditions (\ s a -> s{_blConditions = a})
. _Default
. _Coerce
blCombiningFunction :: Lens' BasicLevel (Maybe BasicLevelCombiningFunction)
blCombiningFunction
= lens _blCombiningFunction
(\ s a -> s{_blCombiningFunction = a})
instance FromJSON BasicLevel where
parseJSON
= withObject "BasicLevel"
(\ o ->
BasicLevel' <$>
(o .:? "conditions" .!= mempty) <*>
(o .:? "combiningFunction"))
instance ToJSON BasicLevel where
toJSON BasicLevel'{..}
= object
(catMaybes
[("conditions" .=) <$> _blConditions,
("combiningFunction" .=) <$> _blCombiningFunction])
data ListOperationsResponse =
ListOperationsResponse'
{ _lorNextPageToken :: !(Maybe Text)
, _lorOperations :: !(Maybe [Operation])
}
deriving (Eq, Show, Data, Typeable, Generic)
listOperationsResponse
:: ListOperationsResponse
listOperationsResponse =
ListOperationsResponse'
{_lorNextPageToken = Nothing, _lorOperations = Nothing}
lorNextPageToken :: Lens' ListOperationsResponse (Maybe Text)
lorNextPageToken
= lens _lorNextPageToken
(\ s a -> s{_lorNextPageToken = a})
lorOperations :: Lens' ListOperationsResponse [Operation]
lorOperations
= lens _lorOperations
(\ s a -> s{_lorOperations = a})
. _Default
. _Coerce
instance FromJSON ListOperationsResponse where
parseJSON
= withObject "ListOperationsResponse"
(\ o ->
ListOperationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "operations" .!= mempty))
instance ToJSON ListOperationsResponse where
toJSON ListOperationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lorNextPageToken,
("operations" .=) <$> _lorOperations])
data CancelOperationRequest =
CancelOperationRequest'
deriving (Eq, Show, Data, Typeable, Generic)
cancelOperationRequest
:: CancelOperationRequest
cancelOperationRequest = CancelOperationRequest'
instance FromJSON CancelOperationRequest where
parseJSON
= withObject "CancelOperationRequest"
(\ o -> pure CancelOperationRequest')
instance ToJSON CancelOperationRequest where
toJSON = const emptyObject
data AccessLevel =
AccessLevel'
{ _alBasic :: !(Maybe BasicLevel)
, _alUpdateTime :: !(Maybe DateTime')
, _alName :: !(Maybe Text)
, _alTitle :: !(Maybe Text)
, _alDescription :: !(Maybe Text)
, _alCreateTime :: !(Maybe DateTime')
}
deriving (Eq, Show, Data, Typeable, Generic)
accessLevel
:: AccessLevel
accessLevel =
AccessLevel'
{ _alBasic = Nothing
, _alUpdateTime = Nothing
, _alName = Nothing
, _alTitle = Nothing
, _alDescription = Nothing
, _alCreateTime = Nothing
}
alBasic :: Lens' AccessLevel (Maybe BasicLevel)
alBasic = lens _alBasic (\ s a -> s{_alBasic = a})
alUpdateTime :: Lens' AccessLevel (Maybe UTCTime)
alUpdateTime
= lens _alUpdateTime (\ s a -> s{_alUpdateTime = a})
. mapping _DateTime
alName :: Lens' AccessLevel (Maybe Text)
alName = lens _alName (\ s a -> s{_alName = a})
alTitle :: Lens' AccessLevel (Maybe Text)
alTitle = lens _alTitle (\ s a -> s{_alTitle = a})
alDescription :: Lens' AccessLevel (Maybe Text)
alDescription
= lens _alDescription
(\ s a -> s{_alDescription = a})
alCreateTime :: Lens' AccessLevel (Maybe UTCTime)
alCreateTime
= lens _alCreateTime (\ s a -> s{_alCreateTime = a})
. mapping _DateTime
instance FromJSON AccessLevel where
parseJSON
= withObject "AccessLevel"
(\ o ->
AccessLevel' <$>
(o .:? "basic") <*> (o .:? "updateTime") <*>
(o .:? "name")
<*> (o .:? "title")
<*> (o .:? "description")
<*> (o .:? "createTime"))
instance ToJSON AccessLevel where
toJSON AccessLevel'{..}
= object
(catMaybes
[("basic" .=) <$> _alBasic,
("updateTime" .=) <$> _alUpdateTime,
("name" .=) <$> _alName, ("title" .=) <$> _alTitle,
("description" .=) <$> _alDescription,
("createTime" .=) <$> _alCreateTime])
data ServicePerimeterConfig =
ServicePerimeterConfig'
{ _spcResources :: !(Maybe [Text])
, _spcRestrictedServices :: !(Maybe [Text])
, _spcAccessLevels :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
servicePerimeterConfig
:: ServicePerimeterConfig
servicePerimeterConfig =
ServicePerimeterConfig'
{ _spcResources = Nothing
, _spcRestrictedServices = Nothing
, _spcAccessLevels = Nothing
}
spcResources :: Lens' ServicePerimeterConfig [Text]
spcResources
= lens _spcResources (\ s a -> s{_spcResources = a})
. _Default
. _Coerce
spcRestrictedServices :: Lens' ServicePerimeterConfig [Text]
spcRestrictedServices
= lens _spcRestrictedServices
(\ s a -> s{_spcRestrictedServices = a})
. _Default
. _Coerce
spcAccessLevels :: Lens' ServicePerimeterConfig [Text]
spcAccessLevels
= lens _spcAccessLevels
(\ s a -> s{_spcAccessLevels = a})
. _Default
. _Coerce
instance FromJSON ServicePerimeterConfig where
parseJSON
= withObject "ServicePerimeterConfig"
(\ o ->
ServicePerimeterConfig' <$>
(o .:? "resources" .!= mempty) <*>
(o .:? "restrictedServices" .!= mempty)
<*> (o .:? "accessLevels" .!= mempty))
instance ToJSON ServicePerimeterConfig where
toJSON ServicePerimeterConfig'{..}
= object
(catMaybes
[("resources" .=) <$> _spcResources,
("restrictedServices" .=) <$> _spcRestrictedServices,
("accessLevels" .=) <$> _spcAccessLevels])
data Operation =
Operation'
{ _oDone :: !(Maybe Bool)
, _oError :: !(Maybe Status)
, _oResponse :: !(Maybe OperationResponse)
, _oName :: !(Maybe Text)
, _oMetadata :: !(Maybe OperationMetadata)
}
deriving (Eq, Show, Data, Typeable, Generic)
operation
:: Operation
operation =
Operation'
{ _oDone = Nothing
, _oError = Nothing
, _oResponse = Nothing
, _oName = Nothing
, _oMetadata = Nothing
}
oDone :: Lens' Operation (Maybe Bool)
oDone = lens _oDone (\ s a -> s{_oDone = a})
oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a})
oResponse :: Lens' Operation (Maybe OperationResponse)
oResponse
= lens _oResponse (\ s a -> s{_oResponse = a})
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
oMetadata :: Lens' Operation (Maybe OperationMetadata)
oMetadata
= lens _oMetadata (\ s a -> s{_oMetadata = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "done") <*> (o .:? "error") <*>
(o .:? "response")
<*> (o .:? "name")
<*> (o .:? "metadata"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("done" .=) <$> _oDone, ("error" .=) <$> _oError,
("response" .=) <$> _oResponse,
("name" .=) <$> _oName,
("metadata" .=) <$> _oMetadata])
data 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
data ServicePerimeter =
ServicePerimeter'
{ _spStatus :: !(Maybe ServicePerimeterConfig)
, _spPerimeterType :: !(Maybe ServicePerimeterPerimeterType)
, _spUpdateTime :: !(Maybe DateTime')
, _spName :: !(Maybe Text)
, _spTitle :: !(Maybe Text)
, _spDescription :: !(Maybe Text)
, _spCreateTime :: !(Maybe DateTime')
}
deriving (Eq, Show, Data, Typeable, Generic)
servicePerimeter
:: ServicePerimeter
servicePerimeter =
ServicePerimeter'
{ _spStatus = Nothing
, _spPerimeterType = Nothing
, _spUpdateTime = Nothing
, _spName = Nothing
, _spTitle = Nothing
, _spDescription = Nothing
, _spCreateTime = Nothing
}
spStatus :: Lens' ServicePerimeter (Maybe ServicePerimeterConfig)
spStatus = lens _spStatus (\ s a -> s{_spStatus = a})
spPerimeterType :: Lens' ServicePerimeter (Maybe ServicePerimeterPerimeterType)
spPerimeterType
= lens _spPerimeterType
(\ s a -> s{_spPerimeterType = a})
spUpdateTime :: Lens' ServicePerimeter (Maybe UTCTime)
spUpdateTime
= lens _spUpdateTime (\ s a -> s{_spUpdateTime = a})
. mapping _DateTime
spName :: Lens' ServicePerimeter (Maybe Text)
spName = lens _spName (\ s a -> s{_spName = a})
spTitle :: Lens' ServicePerimeter (Maybe Text)
spTitle = lens _spTitle (\ s a -> s{_spTitle = a})
spDescription :: Lens' ServicePerimeter (Maybe Text)
spDescription
= lens _spDescription
(\ s a -> s{_spDescription = a})
spCreateTime :: Lens' ServicePerimeter (Maybe UTCTime)
spCreateTime
= lens _spCreateTime (\ s a -> s{_spCreateTime = a})
. mapping _DateTime
instance FromJSON ServicePerimeter where
parseJSON
= withObject "ServicePerimeter"
(\ o ->
ServicePerimeter' <$>
(o .:? "status") <*> (o .:? "perimeterType") <*>
(o .:? "updateTime")
<*> (o .:? "name")
<*> (o .:? "title")
<*> (o .:? "description")
<*> (o .:? "createTime"))
instance ToJSON ServicePerimeter where
toJSON ServicePerimeter'{..}
= object
(catMaybes
[("status" .=) <$> _spStatus,
("perimeterType" .=) <$> _spPerimeterType,
("updateTime" .=) <$> _spUpdateTime,
("name" .=) <$> _spName, ("title" .=) <$> _spTitle,
("description" .=) <$> _spDescription,
("createTime" .=) <$> _spCreateTime])
data ListAccessPoliciesResponse =
ListAccessPoliciesResponse'
{ _laprNextPageToken :: !(Maybe Text)
, _laprAccessPolicies :: !(Maybe [AccessPolicy])
}
deriving (Eq, Show, Data, Typeable, Generic)
listAccessPoliciesResponse
:: ListAccessPoliciesResponse
listAccessPoliciesResponse =
ListAccessPoliciesResponse'
{_laprNextPageToken = Nothing, _laprAccessPolicies = Nothing}
laprNextPageToken :: Lens' ListAccessPoliciesResponse (Maybe Text)
laprNextPageToken
= lens _laprNextPageToken
(\ s a -> s{_laprNextPageToken = a})
laprAccessPolicies :: Lens' ListAccessPoliciesResponse [AccessPolicy]
laprAccessPolicies
= lens _laprAccessPolicies
(\ s a -> s{_laprAccessPolicies = a})
. _Default
. _Coerce
instance FromJSON ListAccessPoliciesResponse where
parseJSON
= withObject "ListAccessPoliciesResponse"
(\ o ->
ListAccessPoliciesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "accessPolicies" .!= mempty))
instance ToJSON ListAccessPoliciesResponse where
toJSON ListAccessPoliciesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _laprNextPageToken,
("accessPolicies" .=) <$> _laprAccessPolicies])
newtype StatusDetailsItem =
StatusDetailsItem'
{ _sdiAddtional :: HashMap Text JSONValue
}
deriving (Eq, Show, Data, Typeable, Generic)
statusDetailsItem
:: HashMap Text JSONValue
-> StatusDetailsItem
statusDetailsItem pSdiAddtional_ =
StatusDetailsItem' {_sdiAddtional = _Coerce # pSdiAddtional_}
sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
sdiAddtional
= lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
. _Coerce
instance FromJSON StatusDetailsItem where
parseJSON
= withObject "StatusDetailsItem"
(\ o -> StatusDetailsItem' <$> (parseJSONObject o))
instance ToJSON StatusDetailsItem where
toJSON = toJSON . _sdiAddtional
data OSConstraint =
OSConstraint'
{ _ocOSType :: !(Maybe OSConstraintOSType)
, _ocMinimumVersion :: !(Maybe Text)
, _ocRequireVerifiedChromeOS :: !(Maybe Bool)
}
deriving (Eq, Show, Data, Typeable, Generic)
osConstraint
:: OSConstraint
osConstraint =
OSConstraint'
{ _ocOSType = Nothing
, _ocMinimumVersion = Nothing
, _ocRequireVerifiedChromeOS = Nothing
}
ocOSType :: Lens' OSConstraint (Maybe OSConstraintOSType)
ocOSType = lens _ocOSType (\ s a -> s{_ocOSType = a})
ocMinimumVersion :: Lens' OSConstraint (Maybe Text)
ocMinimumVersion
= lens _ocMinimumVersion
(\ s a -> s{_ocMinimumVersion = a})
ocRequireVerifiedChromeOS :: Lens' OSConstraint (Maybe Bool)
ocRequireVerifiedChromeOS
= lens _ocRequireVerifiedChromeOS
(\ s a -> s{_ocRequireVerifiedChromeOS = a})
instance FromJSON OSConstraint where
parseJSON
= withObject "OSConstraint"
(\ o ->
OSConstraint' <$>
(o .:? "osType") <*> (o .:? "minimumVersion") <*>
(o .:? "requireVerifiedChromeOs"))
instance ToJSON OSConstraint where
toJSON OSConstraint'{..}
= object
(catMaybes
[("osType" .=) <$> _ocOSType,
("minimumVersion" .=) <$> _ocMinimumVersion,
("requireVerifiedChromeOs" .=) <$>
_ocRequireVerifiedChromeOS])
data AccessPolicy =
AccessPolicy'
{ _apParent :: !(Maybe Text)
, _apUpdateTime :: !(Maybe DateTime')
, _apName :: !(Maybe Text)
, _apTitle :: !(Maybe Text)
, _apCreateTime :: !(Maybe DateTime')
}
deriving (Eq, Show, Data, Typeable, Generic)
accessPolicy
:: AccessPolicy
accessPolicy =
AccessPolicy'
{ _apParent = Nothing
, _apUpdateTime = Nothing
, _apName = Nothing
, _apTitle = Nothing
, _apCreateTime = Nothing
}
apParent :: Lens' AccessPolicy (Maybe Text)
apParent = lens _apParent (\ s a -> s{_apParent = a})
apUpdateTime :: Lens' AccessPolicy (Maybe UTCTime)
apUpdateTime
= lens _apUpdateTime (\ s a -> s{_apUpdateTime = a})
. mapping _DateTime
apName :: Lens' AccessPolicy (Maybe Text)
apName = lens _apName (\ s a -> s{_apName = a})
apTitle :: Lens' AccessPolicy (Maybe Text)
apTitle = lens _apTitle (\ s a -> s{_apTitle = a})
apCreateTime :: Lens' AccessPolicy (Maybe UTCTime)
apCreateTime
= lens _apCreateTime (\ s a -> s{_apCreateTime = a})
. mapping _DateTime
instance FromJSON AccessPolicy where
parseJSON
= withObject "AccessPolicy"
(\ o ->
AccessPolicy' <$>
(o .:? "parent") <*> (o .:? "updateTime") <*>
(o .:? "name")
<*> (o .:? "title")
<*> (o .:? "createTime"))
instance ToJSON AccessPolicy where
toJSON AccessPolicy'{..}
= object
(catMaybes
[("parent" .=) <$> _apParent,
("updateTime" .=) <$> _apUpdateTime,
("name" .=) <$> _apName, ("title" .=) <$> _apTitle,
("createTime" .=) <$> _apCreateTime])
data ListServicePerimetersResponse =
ListServicePerimetersResponse'
{ _lsprNextPageToken :: !(Maybe Text)
, _lsprServicePerimeters :: !(Maybe [ServicePerimeter])
}
deriving (Eq, Show, Data, Typeable, Generic)
listServicePerimetersResponse
:: ListServicePerimetersResponse
listServicePerimetersResponse =
ListServicePerimetersResponse'
{_lsprNextPageToken = Nothing, _lsprServicePerimeters = Nothing}
lsprNextPageToken :: Lens' ListServicePerimetersResponse (Maybe Text)
lsprNextPageToken
= lens _lsprNextPageToken
(\ s a -> s{_lsprNextPageToken = a})
lsprServicePerimeters :: Lens' ListServicePerimetersResponse [ServicePerimeter]
lsprServicePerimeters
= lens _lsprServicePerimeters
(\ s a -> s{_lsprServicePerimeters = a})
. _Default
. _Coerce
instance FromJSON ListServicePerimetersResponse where
parseJSON
= withObject "ListServicePerimetersResponse"
(\ o ->
ListServicePerimetersResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "servicePerimeters" .!= mempty))
instance ToJSON ListServicePerimetersResponse where
toJSON ListServicePerimetersResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsprNextPageToken,
("servicePerimeters" .=) <$> _lsprServicePerimeters])
data ListAccessLevelsResponse =
ListAccessLevelsResponse'
{ _lalrNextPageToken :: !(Maybe Text)
, _lalrAccessLevels :: !(Maybe [AccessLevel])
}
deriving (Eq, Show, Data, Typeable, Generic)
listAccessLevelsResponse
:: ListAccessLevelsResponse
listAccessLevelsResponse =
ListAccessLevelsResponse'
{_lalrNextPageToken = Nothing, _lalrAccessLevels = Nothing}
lalrNextPageToken :: Lens' ListAccessLevelsResponse (Maybe Text)
lalrNextPageToken
= lens _lalrNextPageToken
(\ s a -> s{_lalrNextPageToken = a})
lalrAccessLevels :: Lens' ListAccessLevelsResponse [AccessLevel]
lalrAccessLevels
= lens _lalrAccessLevels
(\ s a -> s{_lalrAccessLevels = a})
. _Default
. _Coerce
instance FromJSON ListAccessLevelsResponse where
parseJSON
= withObject "ListAccessLevelsResponse"
(\ o ->
ListAccessLevelsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "accessLevels" .!= mempty))
instance ToJSON ListAccessLevelsResponse where
toJSON ListAccessLevelsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lalrNextPageToken,
("accessLevels" .=) <$> _lalrAccessLevels])
newtype OperationMetadata =
OperationMetadata'
{ _omAddtional :: HashMap Text JSONValue
}
deriving (Eq, Show, Data, Typeable, Generic)
operationMetadata
:: HashMap Text JSONValue
-> OperationMetadata
operationMetadata pOmAddtional_ =
OperationMetadata' {_omAddtional = _Coerce # pOmAddtional_}
omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
omAddtional
= lens _omAddtional (\ s a -> s{_omAddtional = a}) .
_Coerce
instance FromJSON OperationMetadata where
parseJSON
= withObject "OperationMetadata"
(\ o -> OperationMetadata' <$> (parseJSONObject o))
instance ToJSON OperationMetadata where
toJSON = toJSON . _omAddtional
data DevicePolicy =
DevicePolicy'
{ _dpOSConstraints :: !(Maybe [OSConstraint])
, _dpRequireAdminApproval :: !(Maybe Bool)
, _dpRequireCorpOwned :: !(Maybe Bool)
, _dpRequireScreenlock :: !(Maybe Bool)
, _dpAllowedEncryptionStatuses :: !(Maybe [Text])
, _dpAllowedDeviceManagementLevels :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
devicePolicy
:: DevicePolicy
devicePolicy =
DevicePolicy'
{ _dpOSConstraints = Nothing
, _dpRequireAdminApproval = Nothing
, _dpRequireCorpOwned = Nothing
, _dpRequireScreenlock = Nothing
, _dpAllowedEncryptionStatuses = Nothing
, _dpAllowedDeviceManagementLevels = Nothing
}
dpOSConstraints :: Lens' DevicePolicy [OSConstraint]
dpOSConstraints
= lens _dpOSConstraints
(\ s a -> s{_dpOSConstraints = a})
. _Default
. _Coerce
dpRequireAdminApproval :: Lens' DevicePolicy (Maybe Bool)
dpRequireAdminApproval
= lens _dpRequireAdminApproval
(\ s a -> s{_dpRequireAdminApproval = a})
dpRequireCorpOwned :: Lens' DevicePolicy (Maybe Bool)
dpRequireCorpOwned
= lens _dpRequireCorpOwned
(\ s a -> s{_dpRequireCorpOwned = a})
dpRequireScreenlock :: Lens' DevicePolicy (Maybe Bool)
dpRequireScreenlock
= lens _dpRequireScreenlock
(\ s a -> s{_dpRequireScreenlock = a})
dpAllowedEncryptionStatuses :: Lens' DevicePolicy [Text]
dpAllowedEncryptionStatuses
= lens _dpAllowedEncryptionStatuses
(\ s a -> s{_dpAllowedEncryptionStatuses = a})
. _Default
. _Coerce
dpAllowedDeviceManagementLevels :: Lens' DevicePolicy [Text]
dpAllowedDeviceManagementLevels
= lens _dpAllowedDeviceManagementLevels
(\ s a -> s{_dpAllowedDeviceManagementLevels = a})
. _Default
. _Coerce
instance FromJSON DevicePolicy where
parseJSON
= withObject "DevicePolicy"
(\ o ->
DevicePolicy' <$>
(o .:? "osConstraints" .!= mempty) <*>
(o .:? "requireAdminApproval")
<*> (o .:? "requireCorpOwned")
<*> (o .:? "requireScreenlock")
<*> (o .:? "allowedEncryptionStatuses" .!= mempty)
<*>
(o .:? "allowedDeviceManagementLevels" .!= mempty))
instance ToJSON DevicePolicy where
toJSON DevicePolicy'{..}
= object
(catMaybes
[("osConstraints" .=) <$> _dpOSConstraints,
("requireAdminApproval" .=) <$>
_dpRequireAdminApproval,
("requireCorpOwned" .=) <$> _dpRequireCorpOwned,
("requireScreenlock" .=) <$> _dpRequireScreenlock,
("allowedEncryptionStatuses" .=) <$>
_dpAllowedEncryptionStatuses,
("allowedDeviceManagementLevels" .=) <$>
_dpAllowedDeviceManagementLevels])
data Condition =
Condition'
{ _cMembers :: !(Maybe [Text])
, _cRegions :: !(Maybe [Text])
, _cNegate :: !(Maybe Bool)
, _cIPSubnetworks :: !(Maybe [Text])
, _cDevicePolicy :: !(Maybe DevicePolicy)
, _cRequiredAccessLevels :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
condition
:: Condition
condition =
Condition'
{ _cMembers = Nothing
, _cRegions = Nothing
, _cNegate = Nothing
, _cIPSubnetworks = Nothing
, _cDevicePolicy = Nothing
, _cRequiredAccessLevels = Nothing
}
cMembers :: Lens' Condition [Text]
cMembers
= lens _cMembers (\ s a -> s{_cMembers = a}) .
_Default
. _Coerce
cRegions :: Lens' Condition [Text]
cRegions
= lens _cRegions (\ s a -> s{_cRegions = a}) .
_Default
. _Coerce
cNegate :: Lens' Condition (Maybe Bool)
cNegate = lens _cNegate (\ s a -> s{_cNegate = a})
cIPSubnetworks :: Lens' Condition [Text]
cIPSubnetworks
= lens _cIPSubnetworks
(\ s a -> s{_cIPSubnetworks = a})
. _Default
. _Coerce
cDevicePolicy :: Lens' Condition (Maybe DevicePolicy)
cDevicePolicy
= lens _cDevicePolicy
(\ s a -> s{_cDevicePolicy = a})
cRequiredAccessLevels :: Lens' Condition [Text]
cRequiredAccessLevels
= lens _cRequiredAccessLevels
(\ s a -> s{_cRequiredAccessLevels = a})
. _Default
. _Coerce
instance FromJSON Condition where
parseJSON
= withObject "Condition"
(\ o ->
Condition' <$>
(o .:? "members" .!= mempty) <*>
(o .:? "regions" .!= mempty)
<*> (o .:? "negate")
<*> (o .:? "ipSubnetworks" .!= mempty)
<*> (o .:? "devicePolicy")
<*> (o .:? "requiredAccessLevels" .!= mempty))
instance ToJSON Condition where
toJSON Condition'{..}
= object
(catMaybes
[("members" .=) <$> _cMembers,
("regions" .=) <$> _cRegions,
("negate" .=) <$> _cNegate,
("ipSubnetworks" .=) <$> _cIPSubnetworks,
("devicePolicy" .=) <$> _cDevicePolicy,
("requiredAccessLevels" .=) <$>
_cRequiredAccessLevels])
newtype OperationResponse =
OperationResponse'
{ _orAddtional :: HashMap Text JSONValue
}
deriving (Eq, Show, Data, Typeable, Generic)
operationResponse
:: HashMap Text JSONValue
-> OperationResponse
operationResponse pOrAddtional_ =
OperationResponse' {_orAddtional = _Coerce # pOrAddtional_}
orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
orAddtional
= lens _orAddtional (\ s a -> s{_orAddtional = a}) .
_Coerce
instance FromJSON OperationResponse where
parseJSON
= withObject "OperationResponse"
(\ o -> OperationResponse' <$> (parseJSONObject o))
instance ToJSON OperationResponse where
toJSON = toJSON . _orAddtional