{-# 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.ReplicaPool.Types.Product where
import Network.Google.Prelude
import Network.Google.ReplicaPool.Types.Sum
data ReplicaStatus = ReplicaStatus'
{ _rsState :: !(Maybe Text)
, _rsTemplateVersion :: !(Maybe Text)
, _rsVMLink :: !(Maybe Text)
, _rsVMStartTime :: !(Maybe Text)
, _rsDetails :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
replicaStatus
:: ReplicaStatus
replicaStatus =
ReplicaStatus'
{ _rsState = Nothing
, _rsTemplateVersion = Nothing
, _rsVMLink = Nothing
, _rsVMStartTime = Nothing
, _rsDetails = Nothing
}
rsState :: Lens' ReplicaStatus (Maybe Text)
rsState = lens _rsState (\ s a -> s{_rsState = a})
rsTemplateVersion :: Lens' ReplicaStatus (Maybe Text)
rsTemplateVersion
= lens _rsTemplateVersion
(\ s a -> s{_rsTemplateVersion = a})
rsVMLink :: Lens' ReplicaStatus (Maybe Text)
rsVMLink = lens _rsVMLink (\ s a -> s{_rsVMLink = a})
rsVMStartTime :: Lens' ReplicaStatus (Maybe Text)
rsVMStartTime
= lens _rsVMStartTime
(\ s a -> s{_rsVMStartTime = a})
rsDetails :: Lens' ReplicaStatus (Maybe Text)
rsDetails
= lens _rsDetails (\ s a -> s{_rsDetails = a})
instance FromJSON ReplicaStatus where
parseJSON
= withObject "ReplicaStatus"
(\ o ->
ReplicaStatus' <$>
(o .:? "state") <*> (o .:? "templateVersion") <*>
(o .:? "vmLink")
<*> (o .:? "vmStartTime")
<*> (o .:? "details"))
instance ToJSON ReplicaStatus where
toJSON ReplicaStatus'{..}
= object
(catMaybes
[("state" .=) <$> _rsState,
("templateVersion" .=) <$> _rsTemplateVersion,
("vmLink" .=) <$> _rsVMLink,
("vmStartTime" .=) <$> _rsVMStartTime,
("details" .=) <$> _rsDetails])
data DiskAttachment = DiskAttachment'
{ _daDeviceName :: !(Maybe Text)
, _daIndex :: !(Maybe (Textual Word32))
} deriving (Eq,Show,Data,Typeable,Generic)
diskAttachment
:: DiskAttachment
diskAttachment =
DiskAttachment'
{ _daDeviceName = Nothing
, _daIndex = Nothing
}
daDeviceName :: Lens' DiskAttachment (Maybe Text)
daDeviceName
= lens _daDeviceName (\ s a -> s{_daDeviceName = a})
daIndex :: Lens' DiskAttachment (Maybe Word32)
daIndex
= lens _daIndex (\ s a -> s{_daIndex = a}) .
mapping _Coerce
instance FromJSON DiskAttachment where
parseJSON
= withObject "DiskAttachment"
(\ o ->
DiskAttachment' <$>
(o .:? "deviceName") <*> (o .:? "index"))
instance ToJSON DiskAttachment where
toJSON DiskAttachment'{..}
= object
(catMaybes
[("deviceName" .=) <$> _daDeviceName,
("index" .=) <$> _daIndex])
newtype PoolsDeleteRequest = PoolsDeleteRequest'
{ _pdrAbandonInstances :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
poolsDeleteRequest
:: PoolsDeleteRequest
poolsDeleteRequest =
PoolsDeleteRequest'
{ _pdrAbandonInstances = Nothing
}
pdrAbandonInstances :: Lens' PoolsDeleteRequest [Text]
pdrAbandonInstances
= lens _pdrAbandonInstances
(\ s a -> s{_pdrAbandonInstances = a})
. _Default
. _Coerce
instance FromJSON PoolsDeleteRequest where
parseJSON
= withObject "PoolsDeleteRequest"
(\ o ->
PoolsDeleteRequest' <$>
(o .:? "abandonInstances" .!= mempty))
instance ToJSON PoolsDeleteRequest where
toJSON PoolsDeleteRequest'{..}
= object
(catMaybes
[("abandonInstances" .=) <$> _pdrAbandonInstances])
data HealthCheck = HealthCheck'
{ _hcHealthyThreshold :: !(Maybe (Textual Int32))
, _hcPath :: !(Maybe Text)
, _hcCheckIntervalSec :: !(Maybe (Textual Int32))
, _hcName :: !(Maybe Text)
, _hcHost :: !(Maybe Text)
, _hcTimeoutSec :: !(Maybe (Textual Int32))
, _hcDescription :: !(Maybe Text)
, _hcUnhealthyThreshold :: !(Maybe (Textual Int32))
, _hcPort :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
healthCheck
:: HealthCheck
healthCheck =
HealthCheck'
{ _hcHealthyThreshold = Nothing
, _hcPath = Nothing
, _hcCheckIntervalSec = Nothing
, _hcName = Nothing
, _hcHost = Nothing
, _hcTimeoutSec = Nothing
, _hcDescription = Nothing
, _hcUnhealthyThreshold = Nothing
, _hcPort = Nothing
}
hcHealthyThreshold :: Lens' HealthCheck (Maybe Int32)
hcHealthyThreshold
= lens _hcHealthyThreshold
(\ s a -> s{_hcHealthyThreshold = a})
. mapping _Coerce
hcPath :: Lens' HealthCheck (Maybe Text)
hcPath = lens _hcPath (\ s a -> s{_hcPath = a})
hcCheckIntervalSec :: Lens' HealthCheck (Maybe Int32)
hcCheckIntervalSec
= lens _hcCheckIntervalSec
(\ s a -> s{_hcCheckIntervalSec = a})
. mapping _Coerce
hcName :: Lens' HealthCheck (Maybe Text)
hcName = lens _hcName (\ s a -> s{_hcName = a})
hcHost :: Lens' HealthCheck (Maybe Text)
hcHost = lens _hcHost (\ s a -> s{_hcHost = a})
hcTimeoutSec :: Lens' HealthCheck (Maybe Int32)
hcTimeoutSec
= lens _hcTimeoutSec (\ s a -> s{_hcTimeoutSec = a})
. mapping _Coerce
hcDescription :: Lens' HealthCheck (Maybe Text)
hcDescription
= lens _hcDescription
(\ s a -> s{_hcDescription = a})
hcUnhealthyThreshold :: Lens' HealthCheck (Maybe Int32)
hcUnhealthyThreshold
= lens _hcUnhealthyThreshold
(\ s a -> s{_hcUnhealthyThreshold = a})
. mapping _Coerce
hcPort :: Lens' HealthCheck (Maybe Int32)
hcPort
= lens _hcPort (\ s a -> s{_hcPort = a}) .
mapping _Coerce
instance FromJSON HealthCheck where
parseJSON
= withObject "HealthCheck"
(\ o ->
HealthCheck' <$>
(o .:? "healthyThreshold") <*> (o .:? "path") <*>
(o .:? "checkIntervalSec")
<*> (o .:? "name")
<*> (o .:? "host")
<*> (o .:? "timeoutSec")
<*> (o .:? "description")
<*> (o .:? "unhealthyThreshold")
<*> (o .:? "port"))
instance ToJSON HealthCheck where
toJSON HealthCheck'{..}
= object
(catMaybes
[("healthyThreshold" .=) <$> _hcHealthyThreshold,
("path" .=) <$> _hcPath,
("checkIntervalSec" .=) <$> _hcCheckIntervalSec,
("name" .=) <$> _hcName, ("host" .=) <$> _hcHost,
("timeoutSec" .=) <$> _hcTimeoutSec,
("description" .=) <$> _hcDescription,
("unhealthyThreshold" .=) <$> _hcUnhealthyThreshold,
("port" .=) <$> _hcPort])
data Tag = Tag'
{ _tFingerPrint :: !(Maybe Text)
, _tItems :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
tag
:: Tag
tag =
Tag'
{ _tFingerPrint = Nothing
, _tItems = Nothing
}
tFingerPrint :: Lens' Tag (Maybe Text)
tFingerPrint
= lens _tFingerPrint (\ s a -> s{_tFingerPrint = a})
tItems :: Lens' Tag [Text]
tItems
= lens _tItems (\ s a -> s{_tItems = a}) . _Default .
_Coerce
instance FromJSON Tag where
parseJSON
= withObject "Tag"
(\ o ->
Tag' <$>
(o .:? "fingerPrint") <*> (o .:? "items" .!= mempty))
instance ToJSON Tag where
toJSON Tag'{..}
= object
(catMaybes
[("fingerPrint" .=) <$> _tFingerPrint,
("items" .=) <$> _tItems])
data NewDiskInitializeParams = NewDiskInitializeParams'
{ _ndipSourceImage :: !(Maybe Text)
, _ndipDiskSizeGb :: !(Maybe (Textual Int64))
, _ndipDiskType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
newDiskInitializeParams
:: NewDiskInitializeParams
newDiskInitializeParams =
NewDiskInitializeParams'
{ _ndipSourceImage = Nothing
, _ndipDiskSizeGb = Nothing
, _ndipDiskType = Nothing
}
ndipSourceImage :: Lens' NewDiskInitializeParams (Maybe Text)
ndipSourceImage
= lens _ndipSourceImage
(\ s a -> s{_ndipSourceImage = a})
ndipDiskSizeGb :: Lens' NewDiskInitializeParams (Maybe Int64)
ndipDiskSizeGb
= lens _ndipDiskSizeGb
(\ s a -> s{_ndipDiskSizeGb = a})
. mapping _Coerce
ndipDiskType :: Lens' NewDiskInitializeParams (Maybe Text)
ndipDiskType
= lens _ndipDiskType (\ s a -> s{_ndipDiskType = a})
instance FromJSON NewDiskInitializeParams where
parseJSON
= withObject "NewDiskInitializeParams"
(\ o ->
NewDiskInitializeParams' <$>
(o .:? "sourceImage") <*> (o .:? "diskSizeGb") <*>
(o .:? "diskType"))
instance ToJSON NewDiskInitializeParams where
toJSON NewDiskInitializeParams'{..}
= object
(catMaybes
[("sourceImage" .=) <$> _ndipSourceImage,
("diskSizeGb" .=) <$> _ndipDiskSizeGb,
("diskType" .=) <$> _ndipDiskType])
data MetadataItem = MetadataItem'
{ _miValue :: !(Maybe Text)
, _miKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
metadataItem
:: MetadataItem
metadataItem =
MetadataItem'
{ _miValue = Nothing
, _miKey = Nothing
}
miValue :: Lens' MetadataItem (Maybe Text)
miValue = lens _miValue (\ s a -> s{_miValue = a})
miKey :: Lens' MetadataItem (Maybe Text)
miKey = lens _miKey (\ s a -> s{_miKey = a})
instance FromJSON MetadataItem where
parseJSON
= withObject "MetadataItem"
(\ o ->
MetadataItem' <$> (o .:? "value") <*> (o .:? "key"))
instance ToJSON MetadataItem where
toJSON MetadataItem'{..}
= object
(catMaybes
[("value" .=) <$> _miValue, ("key" .=) <$> _miKey])
data Replica = Replica'
{ _rStatus :: !(Maybe ReplicaStatus)
, _rSelfLink :: !(Maybe Text)
, _rName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
replica
:: Replica
replica =
Replica'
{ _rStatus = Nothing
, _rSelfLink = Nothing
, _rName = Nothing
}
rStatus :: Lens' Replica (Maybe ReplicaStatus)
rStatus = lens _rStatus (\ s a -> s{_rStatus = a})
rSelfLink :: Lens' Replica (Maybe Text)
rSelfLink
= lens _rSelfLink (\ s a -> s{_rSelfLink = a})
rName :: Lens' Replica (Maybe Text)
rName = lens _rName (\ s a -> s{_rName = a})
instance FromJSON Replica where
parseJSON
= withObject "Replica"
(\ o ->
Replica' <$>
(o .:? "status") <*> (o .:? "selfLink") <*>
(o .:? "name"))
instance ToJSON Replica where
toJSON Replica'{..}
= object
(catMaybes
[("status" .=) <$> _rStatus,
("selfLink" .=) <$> _rSelfLink,
("name" .=) <$> _rName])
data NetworkInterface = NetworkInterface'
{ _niNetwork :: !(Maybe Text)
, _niNetworkIP :: !(Maybe Text)
, _niAccessConfigs :: !(Maybe [AccessConfig])
} deriving (Eq,Show,Data,Typeable,Generic)
networkInterface
:: NetworkInterface
networkInterface =
NetworkInterface'
{ _niNetwork = Nothing
, _niNetworkIP = Nothing
, _niAccessConfigs = Nothing
}
niNetwork :: Lens' NetworkInterface (Maybe Text)
niNetwork
= lens _niNetwork (\ s a -> s{_niNetwork = a})
niNetworkIP :: Lens' NetworkInterface (Maybe Text)
niNetworkIP
= lens _niNetworkIP (\ s a -> s{_niNetworkIP = a})
niAccessConfigs :: Lens' NetworkInterface [AccessConfig]
niAccessConfigs
= lens _niAccessConfigs
(\ s a -> s{_niAccessConfigs = a})
. _Default
. _Coerce
instance FromJSON NetworkInterface where
parseJSON
= withObject "NetworkInterface"
(\ o ->
NetworkInterface' <$>
(o .:? "network") <*> (o .:? "networkIp") <*>
(o .:? "accessConfigs" .!= mempty))
instance ToJSON NetworkInterface where
toJSON NetworkInterface'{..}
= object
(catMaybes
[("network" .=) <$> _niNetwork,
("networkIp" .=) <$> _niNetworkIP,
("accessConfigs" .=) <$> _niAccessConfigs])
data ExistingDisk = ExistingDisk'
{ _edAttachment :: !(Maybe DiskAttachment)
, _edSource :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
existingDisk
:: ExistingDisk
existingDisk =
ExistingDisk'
{ _edAttachment = Nothing
, _edSource = Nothing
}
edAttachment :: Lens' ExistingDisk (Maybe DiskAttachment)
edAttachment
= lens _edAttachment (\ s a -> s{_edAttachment = a})
edSource :: Lens' ExistingDisk (Maybe Text)
edSource = lens _edSource (\ s a -> s{_edSource = a})
instance FromJSON ExistingDisk where
parseJSON
= withObject "ExistingDisk"
(\ o ->
ExistingDisk' <$>
(o .:? "attachment") <*> (o .:? "source"))
instance ToJSON ExistingDisk where
toJSON ExistingDisk'{..}
= object
(catMaybes
[("attachment" .=) <$> _edAttachment,
("source" .=) <$> _edSource])
data Action = Action'
{ _aCommands :: !(Maybe [Text])
, _aTimeoutMilliSeconds :: !(Maybe (Textual Int32))
, _aEnvVariables :: !(Maybe [EnvVariable])
} deriving (Eq,Show,Data,Typeable,Generic)
action
:: Action
action =
Action'
{ _aCommands = Nothing
, _aTimeoutMilliSeconds = Nothing
, _aEnvVariables = Nothing
}
aCommands :: Lens' Action [Text]
aCommands
= lens _aCommands (\ s a -> s{_aCommands = a}) .
_Default
. _Coerce
aTimeoutMilliSeconds :: Lens' Action (Maybe Int32)
aTimeoutMilliSeconds
= lens _aTimeoutMilliSeconds
(\ s a -> s{_aTimeoutMilliSeconds = a})
. mapping _Coerce
aEnvVariables :: Lens' Action [EnvVariable]
aEnvVariables
= lens _aEnvVariables
(\ s a -> s{_aEnvVariables = a})
. _Default
. _Coerce
instance FromJSON Action where
parseJSON
= withObject "Action"
(\ o ->
Action' <$>
(o .:? "commands" .!= mempty) <*>
(o .:? "timeoutMilliSeconds")
<*> (o .:? "envVariables" .!= mempty))
instance ToJSON Action where
toJSON Action'{..}
= object
(catMaybes
[("commands" .=) <$> _aCommands,
("timeoutMilliSeconds" .=) <$> _aTimeoutMilliSeconds,
("envVariables" .=) <$> _aEnvVariables])
data Pool = Pool'
{ _pResourceViews :: !(Maybe [Text])
, _pNumReplicas :: !(Maybe (Textual Int32))
, _pTargetPool :: !(Maybe Text)
, _pAutoRestart :: !(Maybe Bool)
, _pBaseInstanceName :: !(Maybe Text)
, _pInitialNumReplicas :: !(Maybe (Textual Int32))
, _pCurrentNumReplicas :: !(Maybe (Textual Int32))
, _pSelfLink :: !(Maybe Text)
, _pName :: !(Maybe Text)
, _pLabels :: !(Maybe [Label])
, _pType :: !(Maybe Text)
, _pTemplate :: !(Maybe Template)
, _pTargetPools :: !(Maybe [Text])
, _pDescription :: !(Maybe Text)
, _pHealthChecks :: !(Maybe [HealthCheck])
} deriving (Eq,Show,Data,Typeable,Generic)
pool
:: Pool
pool =
Pool'
{ _pResourceViews = Nothing
, _pNumReplicas = Nothing
, _pTargetPool = Nothing
, _pAutoRestart = Nothing
, _pBaseInstanceName = Nothing
, _pInitialNumReplicas = Nothing
, _pCurrentNumReplicas = Nothing
, _pSelfLink = Nothing
, _pName = Nothing
, _pLabels = Nothing
, _pType = Nothing
, _pTemplate = Nothing
, _pTargetPools = Nothing
, _pDescription = Nothing
, _pHealthChecks = Nothing
}
pResourceViews :: Lens' Pool [Text]
pResourceViews
= lens _pResourceViews
(\ s a -> s{_pResourceViews = a})
. _Default
. _Coerce
pNumReplicas :: Lens' Pool (Maybe Int32)
pNumReplicas
= lens _pNumReplicas (\ s a -> s{_pNumReplicas = a})
. mapping _Coerce
pTargetPool :: Lens' Pool (Maybe Text)
pTargetPool
= lens _pTargetPool (\ s a -> s{_pTargetPool = a})
pAutoRestart :: Lens' Pool (Maybe Bool)
pAutoRestart
= lens _pAutoRestart (\ s a -> s{_pAutoRestart = a})
pBaseInstanceName :: Lens' Pool (Maybe Text)
pBaseInstanceName
= lens _pBaseInstanceName
(\ s a -> s{_pBaseInstanceName = a})
pInitialNumReplicas :: Lens' Pool (Maybe Int32)
pInitialNumReplicas
= lens _pInitialNumReplicas
(\ s a -> s{_pInitialNumReplicas = a})
. mapping _Coerce
pCurrentNumReplicas :: Lens' Pool (Maybe Int32)
pCurrentNumReplicas
= lens _pCurrentNumReplicas
(\ s a -> s{_pCurrentNumReplicas = a})
. mapping _Coerce
pSelfLink :: Lens' Pool (Maybe Text)
pSelfLink
= lens _pSelfLink (\ s a -> s{_pSelfLink = a})
pName :: Lens' Pool (Maybe Text)
pName = lens _pName (\ s a -> s{_pName = a})
pLabels :: Lens' Pool [Label]
pLabels
= lens _pLabels (\ s a -> s{_pLabels = a}) . _Default
. _Coerce
pType :: Lens' Pool (Maybe Text)
pType = lens _pType (\ s a -> s{_pType = a})
pTemplate :: Lens' Pool (Maybe Template)
pTemplate
= lens _pTemplate (\ s a -> s{_pTemplate = a})
pTargetPools :: Lens' Pool [Text]
pTargetPools
= lens _pTargetPools (\ s a -> s{_pTargetPools = a})
. _Default
. _Coerce
pDescription :: Lens' Pool (Maybe Text)
pDescription
= lens _pDescription (\ s a -> s{_pDescription = a})
pHealthChecks :: Lens' Pool [HealthCheck]
pHealthChecks
= lens _pHealthChecks
(\ s a -> s{_pHealthChecks = a})
. _Default
. _Coerce
instance FromJSON Pool where
parseJSON
= withObject "Pool"
(\ o ->
Pool' <$>
(o .:? "resourceViews" .!= mempty) <*>
(o .:? "numReplicas")
<*> (o .:? "targetPool")
<*> (o .:? "autoRestart")
<*> (o .:? "baseInstanceName")
<*> (o .:? "initialNumReplicas")
<*> (o .:? "currentNumReplicas")
<*> (o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "labels" .!= mempty)
<*> (o .:? "type")
<*> (o .:? "template")
<*> (o .:? "targetPools" .!= mempty)
<*> (o .:? "description")
<*> (o .:? "healthChecks" .!= mempty))
instance ToJSON Pool where
toJSON Pool'{..}
= object
(catMaybes
[("resourceViews" .=) <$> _pResourceViews,
("numReplicas" .=) <$> _pNumReplicas,
("targetPool" .=) <$> _pTargetPool,
("autoRestart" .=) <$> _pAutoRestart,
("baseInstanceName" .=) <$> _pBaseInstanceName,
("initialNumReplicas" .=) <$> _pInitialNumReplicas,
("currentNumReplicas" .=) <$> _pCurrentNumReplicas,
("selfLink" .=) <$> _pSelfLink,
("name" .=) <$> _pName, ("labels" .=) <$> _pLabels,
("type" .=) <$> _pType,
("template" .=) <$> _pTemplate,
("targetPools" .=) <$> _pTargetPools,
("description" .=) <$> _pDescription,
("healthChecks" .=) <$> _pHealthChecks])
data ServiceAccount = ServiceAccount'
{ _saEmail :: !(Maybe Text)
, _saScopes :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
serviceAccount
:: ServiceAccount
serviceAccount =
ServiceAccount'
{ _saEmail = Nothing
, _saScopes = Nothing
}
saEmail :: Lens' ServiceAccount (Maybe Text)
saEmail = lens _saEmail (\ s a -> s{_saEmail = a})
saScopes :: Lens' ServiceAccount [Text]
saScopes
= lens _saScopes (\ s a -> s{_saScopes = a}) .
_Default
. _Coerce
instance FromJSON ServiceAccount where
parseJSON
= withObject "ServiceAccount"
(\ o ->
ServiceAccount' <$>
(o .:? "email") <*> (o .:? "scopes" .!= mempty))
instance ToJSON ServiceAccount where
toJSON ServiceAccount'{..}
= object
(catMaybes
[("email" .=) <$> _saEmail,
("scopes" .=) <$> _saScopes])
data VMParams = VMParams'
{ _vmpServiceAccounts :: !(Maybe [ServiceAccount])
, _vmpNetworkInterfaces :: !(Maybe [NetworkInterface])
, _vmpBaseInstanceName :: !(Maybe Text)
, _vmpOnHostMaintenance :: !(Maybe Text)
, _vmpMachineType :: !(Maybe Text)
, _vmpMetadata :: !(Maybe Metadata)
, _vmpDisksToAttach :: !(Maybe [ExistingDisk])
, _vmpCanIPForward :: !(Maybe Bool)
, _vmpDescription :: !(Maybe Text)
, _vmpDisksToCreate :: !(Maybe [NewDisk])
, _vmpTags :: !(Maybe Tag)
} deriving (Eq,Show,Data,Typeable,Generic)
vMParams
:: VMParams
vMParams =
VMParams'
{ _vmpServiceAccounts = Nothing
, _vmpNetworkInterfaces = Nothing
, _vmpBaseInstanceName = Nothing
, _vmpOnHostMaintenance = Nothing
, _vmpMachineType = Nothing
, _vmpMetadata = Nothing
, _vmpDisksToAttach = Nothing
, _vmpCanIPForward = Nothing
, _vmpDescription = Nothing
, _vmpDisksToCreate = Nothing
, _vmpTags = Nothing
}
vmpServiceAccounts :: Lens' VMParams [ServiceAccount]
vmpServiceAccounts
= lens _vmpServiceAccounts
(\ s a -> s{_vmpServiceAccounts = a})
. _Default
. _Coerce
vmpNetworkInterfaces :: Lens' VMParams [NetworkInterface]
vmpNetworkInterfaces
= lens _vmpNetworkInterfaces
(\ s a -> s{_vmpNetworkInterfaces = a})
. _Default
. _Coerce
vmpBaseInstanceName :: Lens' VMParams (Maybe Text)
vmpBaseInstanceName
= lens _vmpBaseInstanceName
(\ s a -> s{_vmpBaseInstanceName = a})
vmpOnHostMaintenance :: Lens' VMParams (Maybe Text)
vmpOnHostMaintenance
= lens _vmpOnHostMaintenance
(\ s a -> s{_vmpOnHostMaintenance = a})
vmpMachineType :: Lens' VMParams (Maybe Text)
vmpMachineType
= lens _vmpMachineType
(\ s a -> s{_vmpMachineType = a})
vmpMetadata :: Lens' VMParams (Maybe Metadata)
vmpMetadata
= lens _vmpMetadata (\ s a -> s{_vmpMetadata = a})
vmpDisksToAttach :: Lens' VMParams [ExistingDisk]
vmpDisksToAttach
= lens _vmpDisksToAttach
(\ s a -> s{_vmpDisksToAttach = a})
. _Default
. _Coerce
vmpCanIPForward :: Lens' VMParams (Maybe Bool)
vmpCanIPForward
= lens _vmpCanIPForward
(\ s a -> s{_vmpCanIPForward = a})
vmpDescription :: Lens' VMParams (Maybe Text)
vmpDescription
= lens _vmpDescription
(\ s a -> s{_vmpDescription = a})
vmpDisksToCreate :: Lens' VMParams [NewDisk]
vmpDisksToCreate
= lens _vmpDisksToCreate
(\ s a -> s{_vmpDisksToCreate = a})
. _Default
. _Coerce
vmpTags :: Lens' VMParams (Maybe Tag)
vmpTags = lens _vmpTags (\ s a -> s{_vmpTags = a})
instance FromJSON VMParams where
parseJSON
= withObject "VMParams"
(\ o ->
VMParams' <$>
(o .:? "serviceAccounts" .!= mempty) <*>
(o .:? "networkInterfaces" .!= mempty)
<*> (o .:? "baseInstanceName")
<*> (o .:? "onHostMaintenance")
<*> (o .:? "machineType")
<*> (o .:? "metadata")
<*> (o .:? "disksToAttach" .!= mempty)
<*> (o .:? "canIpForward")
<*> (o .:? "description")
<*> (o .:? "disksToCreate" .!= mempty)
<*> (o .:? "tags"))
instance ToJSON VMParams where
toJSON VMParams'{..}
= object
(catMaybes
[("serviceAccounts" .=) <$> _vmpServiceAccounts,
("networkInterfaces" .=) <$> _vmpNetworkInterfaces,
("baseInstanceName" .=) <$> _vmpBaseInstanceName,
("onHostMaintenance" .=) <$> _vmpOnHostMaintenance,
("machineType" .=) <$> _vmpMachineType,
("metadata" .=) <$> _vmpMetadata,
("disksToAttach" .=) <$> _vmpDisksToAttach,
("canIpForward" .=) <$> _vmpCanIPForward,
("description" .=) <$> _vmpDescription,
("disksToCreate" .=) <$> _vmpDisksToCreate,
("tags" .=) <$> _vmpTags])
data ReplicasListResponse = ReplicasListResponse'
{ _rlrNextPageToken :: !(Maybe Text)
, _rlrResources :: !(Maybe [Replica])
} deriving (Eq,Show,Data,Typeable,Generic)
replicasListResponse
:: ReplicasListResponse
replicasListResponse =
ReplicasListResponse'
{ _rlrNextPageToken = Nothing
, _rlrResources = Nothing
}
rlrNextPageToken :: Lens' ReplicasListResponse (Maybe Text)
rlrNextPageToken
= lens _rlrNextPageToken
(\ s a -> s{_rlrNextPageToken = a})
rlrResources :: Lens' ReplicasListResponse [Replica]
rlrResources
= lens _rlrResources (\ s a -> s{_rlrResources = a})
. _Default
. _Coerce
instance FromJSON ReplicasListResponse where
parseJSON
= withObject "ReplicasListResponse"
(\ o ->
ReplicasListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "resources" .!= mempty))
instance ToJSON ReplicasListResponse where
toJSON ReplicasListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _rlrNextPageToken,
("resources" .=) <$> _rlrResources])
data Metadata = Metadata'
{ _mFingerPrint :: !(Maybe Text)
, _mItems :: !(Maybe [MetadataItem])
} deriving (Eq,Show,Data,Typeable,Generic)
metadata
:: Metadata
metadata =
Metadata'
{ _mFingerPrint = Nothing
, _mItems = Nothing
}
mFingerPrint :: Lens' Metadata (Maybe Text)
mFingerPrint
= lens _mFingerPrint (\ s a -> s{_mFingerPrint = a})
mItems :: Lens' Metadata [MetadataItem]
mItems
= lens _mItems (\ s a -> s{_mItems = a}) . _Default .
_Coerce
instance FromJSON Metadata where
parseJSON
= withObject "Metadata"
(\ o ->
Metadata' <$>
(o .:? "fingerPrint") <*> (o .:? "items" .!= mempty))
instance ToJSON Metadata where
toJSON Metadata'{..}
= object
(catMaybes
[("fingerPrint" .=) <$> _mFingerPrint,
("items" .=) <$> _mItems])
data Template = Template'
{ _tAction :: !(Maybe Action)
, _tVMParams :: !(Maybe VMParams)
, _tVersion :: !(Maybe Text)
, _tHealthChecks :: !(Maybe [HealthCheck])
} deriving (Eq,Show,Data,Typeable,Generic)
template
:: Template
template =
Template'
{ _tAction = Nothing
, _tVMParams = Nothing
, _tVersion = Nothing
, _tHealthChecks = Nothing
}
tAction :: Lens' Template (Maybe Action)
tAction = lens _tAction (\ s a -> s{_tAction = a})
tVMParams :: Lens' Template (Maybe VMParams)
tVMParams
= lens _tVMParams (\ s a -> s{_tVMParams = a})
tVersion :: Lens' Template (Maybe Text)
tVersion = lens _tVersion (\ s a -> s{_tVersion = a})
tHealthChecks :: Lens' Template [HealthCheck]
tHealthChecks
= lens _tHealthChecks
(\ s a -> s{_tHealthChecks = a})
. _Default
. _Coerce
instance FromJSON Template where
parseJSON
= withObject "Template"
(\ o ->
Template' <$>
(o .:? "action") <*> (o .:? "vmParams") <*>
(o .:? "version")
<*> (o .:? "healthChecks" .!= mempty))
instance ToJSON Template where
toJSON Template'{..}
= object
(catMaybes
[("action" .=) <$> _tAction,
("vmParams" .=) <$> _tVMParams,
("version" .=) <$> _tVersion,
("healthChecks" .=) <$> _tHealthChecks])
data EnvVariable = EnvVariable'
{ _evValue :: !(Maybe Text)
, _evName :: !(Maybe Text)
, _evHidden :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
envVariable
:: EnvVariable
envVariable =
EnvVariable'
{ _evValue = Nothing
, _evName = Nothing
, _evHidden = Nothing
}
evValue :: Lens' EnvVariable (Maybe Text)
evValue = lens _evValue (\ s a -> s{_evValue = a})
evName :: Lens' EnvVariable (Maybe Text)
evName = lens _evName (\ s a -> s{_evName = a})
evHidden :: Lens' EnvVariable (Maybe Bool)
evHidden = lens _evHidden (\ s a -> s{_evHidden = a})
instance FromJSON EnvVariable where
parseJSON
= withObject "EnvVariable"
(\ o ->
EnvVariable' <$>
(o .:? "value") <*> (o .:? "name") <*>
(o .:? "hidden"))
instance ToJSON EnvVariable where
toJSON EnvVariable'{..}
= object
(catMaybes
[("value" .=) <$> _evValue, ("name" .=) <$> _evName,
("hidden" .=) <$> _evHidden])
newtype ReplicasDeleteRequest = ReplicasDeleteRequest'
{ _rdrAbandonInstance :: Maybe Bool
} deriving (Eq,Show,Data,Typeable,Generic)
replicasDeleteRequest
:: ReplicasDeleteRequest
replicasDeleteRequest =
ReplicasDeleteRequest'
{ _rdrAbandonInstance = Nothing
}
rdrAbandonInstance :: Lens' ReplicasDeleteRequest (Maybe Bool)
rdrAbandonInstance
= lens _rdrAbandonInstance
(\ s a -> s{_rdrAbandonInstance = a})
instance FromJSON ReplicasDeleteRequest where
parseJSON
= withObject "ReplicasDeleteRequest"
(\ o ->
ReplicasDeleteRequest' <$> (o .:? "abandonInstance"))
instance ToJSON ReplicasDeleteRequest where
toJSON ReplicasDeleteRequest'{..}
= object
(catMaybes
[("abandonInstance" .=) <$> _rdrAbandonInstance])
data AccessConfig = AccessConfig'
{ _acName :: !(Maybe Text)
, _acNATIP :: !(Maybe Text)
, _acType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
accessConfig
:: AccessConfig
accessConfig =
AccessConfig'
{ _acName = Nothing
, _acNATIP = Nothing
, _acType = Nothing
}
acName :: Lens' AccessConfig (Maybe Text)
acName = lens _acName (\ s a -> s{_acName = a})
acNATIP :: Lens' AccessConfig (Maybe Text)
acNATIP = lens _acNATIP (\ s a -> s{_acNATIP = a})
acType :: Lens' AccessConfig (Maybe Text)
acType = lens _acType (\ s a -> s{_acType = a})
instance FromJSON AccessConfig where
parseJSON
= withObject "AccessConfig"
(\ o ->
AccessConfig' <$>
(o .:? "name") <*> (o .:? "natIp") <*>
(o .:? "type"))
instance ToJSON AccessConfig where
toJSON AccessConfig'{..}
= object
(catMaybes
[("name" .=) <$> _acName, ("natIp" .=) <$> _acNATIP,
("type" .=) <$> _acType])
data Label = Label'
{ _lValue :: !(Maybe Text)
, _lKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
label
:: Label
label =
Label'
{ _lValue = Nothing
, _lKey = Nothing
}
lValue :: Lens' Label (Maybe Text)
lValue = lens _lValue (\ s a -> s{_lValue = a})
lKey :: Lens' Label (Maybe Text)
lKey = lens _lKey (\ s a -> s{_lKey = a})
instance FromJSON Label where
parseJSON
= withObject "Label"
(\ o -> Label' <$> (o .:? "value") <*> (o .:? "key"))
instance ToJSON Label where
toJSON Label'{..}
= object
(catMaybes
[("value" .=) <$> _lValue, ("key" .=) <$> _lKey])
data PoolsListResponse = PoolsListResponse'
{ _plrNextPageToken :: !(Maybe Text)
, _plrResources :: !(Maybe [Pool])
} deriving (Eq,Show,Data,Typeable,Generic)
poolsListResponse
:: PoolsListResponse
poolsListResponse =
PoolsListResponse'
{ _plrNextPageToken = Nothing
, _plrResources = Nothing
}
plrNextPageToken :: Lens' PoolsListResponse (Maybe Text)
plrNextPageToken
= lens _plrNextPageToken
(\ s a -> s{_plrNextPageToken = a})
plrResources :: Lens' PoolsListResponse [Pool]
plrResources
= lens _plrResources (\ s a -> s{_plrResources = a})
. _Default
. _Coerce
instance FromJSON PoolsListResponse where
parseJSON
= withObject "PoolsListResponse"
(\ o ->
PoolsListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "resources" .!= mempty))
instance ToJSON PoolsListResponse where
toJSON PoolsListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _plrNextPageToken,
("resources" .=) <$> _plrResources])
data NewDisk = NewDisk'
{ _ndBoot :: !(Maybe Bool)
, _ndAutoDelete :: !(Maybe Bool)
, _ndAttachment :: !(Maybe DiskAttachment)
, _ndInitializeParams :: !(Maybe NewDiskInitializeParams)
} deriving (Eq,Show,Data,Typeable,Generic)
newDisk
:: NewDisk
newDisk =
NewDisk'
{ _ndBoot = Nothing
, _ndAutoDelete = Nothing
, _ndAttachment = Nothing
, _ndInitializeParams = Nothing
}
ndBoot :: Lens' NewDisk (Maybe Bool)
ndBoot = lens _ndBoot (\ s a -> s{_ndBoot = a})
ndAutoDelete :: Lens' NewDisk (Maybe Bool)
ndAutoDelete
= lens _ndAutoDelete (\ s a -> s{_ndAutoDelete = a})
ndAttachment :: Lens' NewDisk (Maybe DiskAttachment)
ndAttachment
= lens _ndAttachment (\ s a -> s{_ndAttachment = a})
ndInitializeParams :: Lens' NewDisk (Maybe NewDiskInitializeParams)
ndInitializeParams
= lens _ndInitializeParams
(\ s a -> s{_ndInitializeParams = a})
instance FromJSON NewDisk where
parseJSON
= withObject "NewDisk"
(\ o ->
NewDisk' <$>
(o .:? "boot") <*> (o .:? "autoDelete") <*>
(o .:? "attachment")
<*> (o .:? "initializeParams"))
instance ToJSON NewDisk where
toJSON NewDisk'{..}
= object
(catMaybes
[("boot" .=) <$> _ndBoot,
("autoDelete" .=) <$> _ndAutoDelete,
("attachment" .=) <$> _ndAttachment,
("initializeParams" .=) <$> _ndInitializeParams])