{-# 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.Container.Types.Product where
import Network.Google.Container.Types.Sum
import Network.Google.Prelude
newtype HorizontalPodAutoscaling = HorizontalPodAutoscaling'
{ _hpaDisabled :: Maybe Bool
} deriving (Eq,Show,Data,Typeable,Generic)
horizontalPodAutoscaling
:: HorizontalPodAutoscaling
horizontalPodAutoscaling =
HorizontalPodAutoscaling'
{ _hpaDisabled = Nothing
}
hpaDisabled :: Lens' HorizontalPodAutoscaling (Maybe Bool)
hpaDisabled
= lens _hpaDisabled (\ s a -> s{_hpaDisabled = a})
instance FromJSON HorizontalPodAutoscaling where
parseJSON
= withObject "HorizontalPodAutoscaling"
(\ o ->
HorizontalPodAutoscaling' <$> (o .:? "disabled"))
instance ToJSON HorizontalPodAutoscaling where
toJSON HorizontalPodAutoscaling'{..}
= object
(catMaybes [("disabled" .=) <$> _hpaDisabled])
data ListOperationsResponse = ListOperationsResponse'
{ _lorOperations :: !(Maybe [Operation])
, _lorMissingZones :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
listOperationsResponse
:: ListOperationsResponse
listOperationsResponse =
ListOperationsResponse'
{ _lorOperations = Nothing
, _lorMissingZones = Nothing
}
lorOperations :: Lens' ListOperationsResponse [Operation]
lorOperations
= lens _lorOperations
(\ s a -> s{_lorOperations = a})
. _Default
. _Coerce
lorMissingZones :: Lens' ListOperationsResponse [Text]
lorMissingZones
= lens _lorMissingZones
(\ s a -> s{_lorMissingZones = a})
. _Default
. _Coerce
instance FromJSON ListOperationsResponse where
parseJSON
= withObject "ListOperationsResponse"
(\ o ->
ListOperationsResponse' <$>
(o .:? "operations" .!= mempty) <*>
(o .:? "missingZones" .!= mempty))
instance ToJSON ListOperationsResponse where
toJSON ListOperationsResponse'{..}
= object
(catMaybes
[("operations" .=) <$> _lorOperations,
("missingZones" .=) <$> _lorMissingZones])
newtype CreateClusterRequest = CreateClusterRequest'
{ _ccrCluster :: Maybe Cluster
} deriving (Eq,Show,Data,Typeable,Generic)
createClusterRequest
:: CreateClusterRequest
createClusterRequest =
CreateClusterRequest'
{ _ccrCluster = Nothing
}
ccrCluster :: Lens' CreateClusterRequest (Maybe Cluster)
ccrCluster
= lens _ccrCluster (\ s a -> s{_ccrCluster = a})
instance FromJSON CreateClusterRequest where
parseJSON
= withObject "CreateClusterRequest"
(\ o -> CreateClusterRequest' <$> (o .:? "cluster"))
instance ToJSON CreateClusterRequest where
toJSON CreateClusterRequest'{..}
= object (catMaybes [("cluster" .=) <$> _ccrCluster])
data Cluster = Cluster'
{ _cStatus :: !(Maybe Text)
, _cNodePools :: !(Maybe [NodePool])
, _cNodeConfig :: !(Maybe NodeConfig)
, _cNodeIPv4CIdRSize :: !(Maybe (Textual Int32))
, _cClusterIPv4CIdR :: !(Maybe Text)
, _cInitialNodeCount :: !(Maybe (Textual Int32))
, _cCurrentNodeVersion :: !(Maybe Text)
, _cNetwork :: !(Maybe Text)
, _cInitialClusterVersion :: !(Maybe Text)
, _cZone :: !(Maybe Text)
, _cAddonsConfig :: !(Maybe AddonsConfig)
, _cServicesIPv4CIdR :: !(Maybe Text)
, _cMasterAuth :: !(Maybe MasterAuth)
, _cSelfLink :: !(Maybe Text)
, _cName :: !(Maybe Text)
, _cCurrentMasterVersion :: !(Maybe Text)
, _cStatusMessage :: !(Maybe Text)
, _cSubnetwork :: !(Maybe Text)
, _cCurrentNodeCount :: !(Maybe (Textual Int32))
, _cEndpoint :: !(Maybe Text)
, _cLocations :: !(Maybe [Text])
, _cLoggingService :: !(Maybe Text)
, _cDescription :: !(Maybe Text)
, _cInstanceGroupURLs :: !(Maybe [Text])
, _cMonitoringService :: !(Maybe Text)
, _cCreateTime :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
cluster
:: Cluster
cluster =
Cluster'
{ _cStatus = Nothing
, _cNodePools = Nothing
, _cNodeConfig = Nothing
, _cNodeIPv4CIdRSize = Nothing
, _cClusterIPv4CIdR = Nothing
, _cInitialNodeCount = Nothing
, _cCurrentNodeVersion = Nothing
, _cNetwork = Nothing
, _cInitialClusterVersion = Nothing
, _cZone = Nothing
, _cAddonsConfig = Nothing
, _cServicesIPv4CIdR = Nothing
, _cMasterAuth = Nothing
, _cSelfLink = Nothing
, _cName = Nothing
, _cCurrentMasterVersion = Nothing
, _cStatusMessage = Nothing
, _cSubnetwork = Nothing
, _cCurrentNodeCount = Nothing
, _cEndpoint = Nothing
, _cLocations = Nothing
, _cLoggingService = Nothing
, _cDescription = Nothing
, _cInstanceGroupURLs = Nothing
, _cMonitoringService = Nothing
, _cCreateTime = Nothing
}
cStatus :: Lens' Cluster (Maybe Text)
cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
cNodePools :: Lens' Cluster [NodePool]
cNodePools
= lens _cNodePools (\ s a -> s{_cNodePools = a}) .
_Default
. _Coerce
cNodeConfig :: Lens' Cluster (Maybe NodeConfig)
cNodeConfig
= lens _cNodeConfig (\ s a -> s{_cNodeConfig = a})
cNodeIPv4CIdRSize :: Lens' Cluster (Maybe Int32)
cNodeIPv4CIdRSize
= lens _cNodeIPv4CIdRSize
(\ s a -> s{_cNodeIPv4CIdRSize = a})
. mapping _Coerce
cClusterIPv4CIdR :: Lens' Cluster (Maybe Text)
cClusterIPv4CIdR
= lens _cClusterIPv4CIdR
(\ s a -> s{_cClusterIPv4CIdR = a})
cInitialNodeCount :: Lens' Cluster (Maybe Int32)
cInitialNodeCount
= lens _cInitialNodeCount
(\ s a -> s{_cInitialNodeCount = a})
. mapping _Coerce
cCurrentNodeVersion :: Lens' Cluster (Maybe Text)
cCurrentNodeVersion
= lens _cCurrentNodeVersion
(\ s a -> s{_cCurrentNodeVersion = a})
cNetwork :: Lens' Cluster (Maybe Text)
cNetwork = lens _cNetwork (\ s a -> s{_cNetwork = a})
cInitialClusterVersion :: Lens' Cluster (Maybe Text)
cInitialClusterVersion
= lens _cInitialClusterVersion
(\ s a -> s{_cInitialClusterVersion = a})
cZone :: Lens' Cluster (Maybe Text)
cZone = lens _cZone (\ s a -> s{_cZone = a})
cAddonsConfig :: Lens' Cluster (Maybe AddonsConfig)
cAddonsConfig
= lens _cAddonsConfig
(\ s a -> s{_cAddonsConfig = a})
cServicesIPv4CIdR :: Lens' Cluster (Maybe Text)
cServicesIPv4CIdR
= lens _cServicesIPv4CIdR
(\ s a -> s{_cServicesIPv4CIdR = a})
cMasterAuth :: Lens' Cluster (Maybe MasterAuth)
cMasterAuth
= lens _cMasterAuth (\ s a -> s{_cMasterAuth = a})
cSelfLink :: Lens' Cluster (Maybe Text)
cSelfLink
= lens _cSelfLink (\ s a -> s{_cSelfLink = a})
cName :: Lens' Cluster (Maybe Text)
cName = lens _cName (\ s a -> s{_cName = a})
cCurrentMasterVersion :: Lens' Cluster (Maybe Text)
cCurrentMasterVersion
= lens _cCurrentMasterVersion
(\ s a -> s{_cCurrentMasterVersion = a})
cStatusMessage :: Lens' Cluster (Maybe Text)
cStatusMessage
= lens _cStatusMessage
(\ s a -> s{_cStatusMessage = a})
cSubnetwork :: Lens' Cluster (Maybe Text)
cSubnetwork
= lens _cSubnetwork (\ s a -> s{_cSubnetwork = a})
cCurrentNodeCount :: Lens' Cluster (Maybe Int32)
cCurrentNodeCount
= lens _cCurrentNodeCount
(\ s a -> s{_cCurrentNodeCount = a})
. mapping _Coerce
cEndpoint :: Lens' Cluster (Maybe Text)
cEndpoint
= lens _cEndpoint (\ s a -> s{_cEndpoint = a})
cLocations :: Lens' Cluster [Text]
cLocations
= lens _cLocations (\ s a -> s{_cLocations = a}) .
_Default
. _Coerce
cLoggingService :: Lens' Cluster (Maybe Text)
cLoggingService
= lens _cLoggingService
(\ s a -> s{_cLoggingService = a})
cDescription :: Lens' Cluster (Maybe Text)
cDescription
= lens _cDescription (\ s a -> s{_cDescription = a})
cInstanceGroupURLs :: Lens' Cluster [Text]
cInstanceGroupURLs
= lens _cInstanceGroupURLs
(\ s a -> s{_cInstanceGroupURLs = a})
. _Default
. _Coerce
cMonitoringService :: Lens' Cluster (Maybe Text)
cMonitoringService
= lens _cMonitoringService
(\ s a -> s{_cMonitoringService = a})
cCreateTime :: Lens' Cluster (Maybe Text)
cCreateTime
= lens _cCreateTime (\ s a -> s{_cCreateTime = a})
instance FromJSON Cluster where
parseJSON
= withObject "Cluster"
(\ o ->
Cluster' <$>
(o .:? "status") <*> (o .:? "nodePools" .!= mempty)
<*> (o .:? "nodeConfig")
<*> (o .:? "nodeIpv4CidrSize")
<*> (o .:? "clusterIpv4Cidr")
<*> (o .:? "initialNodeCount")
<*> (o .:? "currentNodeVersion")
<*> (o .:? "network")
<*> (o .:? "initialClusterVersion")
<*> (o .:? "zone")
<*> (o .:? "addonsConfig")
<*> (o .:? "servicesIpv4Cidr")
<*> (o .:? "masterAuth")
<*> (o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "currentMasterVersion")
<*> (o .:? "statusMessage")
<*> (o .:? "subnetwork")
<*> (o .:? "currentNodeCount")
<*> (o .:? "endpoint")
<*> (o .:? "locations" .!= mempty)
<*> (o .:? "loggingService")
<*> (o .:? "description")
<*> (o .:? "instanceGroupUrls" .!= mempty)
<*> (o .:? "monitoringService")
<*> (o .:? "createTime"))
instance ToJSON Cluster where
toJSON Cluster'{..}
= object
(catMaybes
[("status" .=) <$> _cStatus,
("nodePools" .=) <$> _cNodePools,
("nodeConfig" .=) <$> _cNodeConfig,
("nodeIpv4CidrSize" .=) <$> _cNodeIPv4CIdRSize,
("clusterIpv4Cidr" .=) <$> _cClusterIPv4CIdR,
("initialNodeCount" .=) <$> _cInitialNodeCount,
("currentNodeVersion" .=) <$> _cCurrentNodeVersion,
("network" .=) <$> _cNetwork,
("initialClusterVersion" .=) <$>
_cInitialClusterVersion,
("zone" .=) <$> _cZone,
("addonsConfig" .=) <$> _cAddonsConfig,
("servicesIpv4Cidr" .=) <$> _cServicesIPv4CIdR,
("masterAuth" .=) <$> _cMasterAuth,
("selfLink" .=) <$> _cSelfLink,
("name" .=) <$> _cName,
("currentMasterVersion" .=) <$>
_cCurrentMasterVersion,
("statusMessage" .=) <$> _cStatusMessage,
("subnetwork" .=) <$> _cSubnetwork,
("currentNodeCount" .=) <$> _cCurrentNodeCount,
("endpoint" .=) <$> _cEndpoint,
("locations" .=) <$> _cLocations,
("loggingService" .=) <$> _cLoggingService,
("description" .=) <$> _cDescription,
("instanceGroupUrls" .=) <$> _cInstanceGroupURLs,
("monitoringService" .=) <$> _cMonitoringService,
("createTime" .=) <$> _cCreateTime])
newtype UpdateClusterRequest = UpdateClusterRequest'
{ _ucrUpdate :: Maybe ClusterUpdate
} deriving (Eq,Show,Data,Typeable,Generic)
updateClusterRequest
:: UpdateClusterRequest
updateClusterRequest =
UpdateClusterRequest'
{ _ucrUpdate = Nothing
}
ucrUpdate :: Lens' UpdateClusterRequest (Maybe ClusterUpdate)
ucrUpdate
= lens _ucrUpdate (\ s a -> s{_ucrUpdate = a})
instance FromJSON UpdateClusterRequest where
parseJSON
= withObject "UpdateClusterRequest"
(\ o -> UpdateClusterRequest' <$> (o .:? "update"))
instance ToJSON UpdateClusterRequest where
toJSON UpdateClusterRequest'{..}
= object (catMaybes [("update" .=) <$> _ucrUpdate])
data NodeConfig = NodeConfig'
{ _ncDiskSizeGb :: !(Maybe (Textual Int32))
, _ncOAuthScopes :: !(Maybe [Text])
, _ncMachineType :: !(Maybe Text)
, _ncMetadata :: !(Maybe NodeConfigMetadata)
} deriving (Eq,Show,Data,Typeable,Generic)
nodeConfig
:: NodeConfig
nodeConfig =
NodeConfig'
{ _ncDiskSizeGb = Nothing
, _ncOAuthScopes = Nothing
, _ncMachineType = Nothing
, _ncMetadata = Nothing
}
ncDiskSizeGb :: Lens' NodeConfig (Maybe Int32)
ncDiskSizeGb
= lens _ncDiskSizeGb (\ s a -> s{_ncDiskSizeGb = a})
. mapping _Coerce
ncOAuthScopes :: Lens' NodeConfig [Text]
ncOAuthScopes
= lens _ncOAuthScopes
(\ s a -> s{_ncOAuthScopes = a})
. _Default
. _Coerce
ncMachineType :: Lens' NodeConfig (Maybe Text)
ncMachineType
= lens _ncMachineType
(\ s a -> s{_ncMachineType = a})
ncMetadata :: Lens' NodeConfig (Maybe NodeConfigMetadata)
ncMetadata
= lens _ncMetadata (\ s a -> s{_ncMetadata = a})
instance FromJSON NodeConfig where
parseJSON
= withObject "NodeConfig"
(\ o ->
NodeConfig' <$>
(o .:? "diskSizeGb") <*>
(o .:? "oauthScopes" .!= mempty)
<*> (o .:? "machineType")
<*> (o .:? "metadata"))
instance ToJSON NodeConfig where
toJSON NodeConfig'{..}
= object
(catMaybes
[("diskSizeGb" .=) <$> _ncDiskSizeGb,
("oauthScopes" .=) <$> _ncOAuthScopes,
("machineType" .=) <$> _ncMachineType,
("metadata" .=) <$> _ncMetadata])
newtype HTTPLoadBalancing = HTTPLoadBalancing'
{ _httplbDisabled :: Maybe Bool
} deriving (Eq,Show,Data,Typeable,Generic)
hTTPLoadBalancing
:: HTTPLoadBalancing
hTTPLoadBalancing =
HTTPLoadBalancing'
{ _httplbDisabled = Nothing
}
httplbDisabled :: Lens' HTTPLoadBalancing (Maybe Bool)
httplbDisabled
= lens _httplbDisabled
(\ s a -> s{_httplbDisabled = a})
instance FromJSON HTTPLoadBalancing where
parseJSON
= withObject "HTTPLoadBalancing"
(\ o -> HTTPLoadBalancing' <$> (o .:? "disabled"))
instance ToJSON HTTPLoadBalancing where
toJSON HTTPLoadBalancing'{..}
= object
(catMaybes [("disabled" .=) <$> _httplbDisabled])
data Operation = Operation'
{ _oStatus :: !(Maybe Text)
, _oZone :: !(Maybe Text)
, _oSelfLink :: !(Maybe Text)
, _oName :: !(Maybe Text)
, _oStatusMessage :: !(Maybe Text)
, _oOperationType :: !(Maybe Text)
, _oTargetLink :: !(Maybe Text)
, _oDetail :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
operation
:: Operation
operation =
Operation'
{ _oStatus = Nothing
, _oZone = Nothing
, _oSelfLink = Nothing
, _oName = Nothing
, _oStatusMessage = Nothing
, _oOperationType = Nothing
, _oTargetLink = Nothing
, _oDetail = Nothing
}
oStatus :: Lens' Operation (Maybe Text)
oStatus = lens _oStatus (\ s a -> s{_oStatus = a})
oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a})
oSelfLink :: Lens' Operation (Maybe Text)
oSelfLink
= lens _oSelfLink (\ s a -> s{_oSelfLink = a})
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
oStatusMessage :: Lens' Operation (Maybe Text)
oStatusMessage
= lens _oStatusMessage
(\ s a -> s{_oStatusMessage = a})
oOperationType :: Lens' Operation (Maybe Text)
oOperationType
= lens _oOperationType
(\ s a -> s{_oOperationType = a})
oTargetLink :: Lens' Operation (Maybe Text)
oTargetLink
= lens _oTargetLink (\ s a -> s{_oTargetLink = a})
oDetail :: Lens' Operation (Maybe Text)
oDetail = lens _oDetail (\ s a -> s{_oDetail = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "status") <*> (o .:? "zone") <*>
(o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "statusMessage")
<*> (o .:? "operationType")
<*> (o .:? "targetLink")
<*> (o .:? "detail"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("status" .=) <$> _oStatus, ("zone" .=) <$> _oZone,
("selfLink" .=) <$> _oSelfLink,
("name" .=) <$> _oName,
("statusMessage" .=) <$> _oStatusMessage,
("operationType" .=) <$> _oOperationType,
("targetLink" .=) <$> _oTargetLink,
("detail" .=) <$> _oDetail])
data AddonsConfig = AddonsConfig'
{ _acHorizontalPodAutoscaling :: !(Maybe HorizontalPodAutoscaling)
, _acHTTPLoadBalancing :: !(Maybe HTTPLoadBalancing)
} deriving (Eq,Show,Data,Typeable,Generic)
addonsConfig
:: AddonsConfig
addonsConfig =
AddonsConfig'
{ _acHorizontalPodAutoscaling = Nothing
, _acHTTPLoadBalancing = Nothing
}
acHorizontalPodAutoscaling :: Lens' AddonsConfig (Maybe HorizontalPodAutoscaling)
acHorizontalPodAutoscaling
= lens _acHorizontalPodAutoscaling
(\ s a -> s{_acHorizontalPodAutoscaling = a})
acHTTPLoadBalancing :: Lens' AddonsConfig (Maybe HTTPLoadBalancing)
acHTTPLoadBalancing
= lens _acHTTPLoadBalancing
(\ s a -> s{_acHTTPLoadBalancing = a})
instance FromJSON AddonsConfig where
parseJSON
= withObject "AddonsConfig"
(\ o ->
AddonsConfig' <$>
(o .:? "horizontalPodAutoscaling") <*>
(o .:? "httpLoadBalancing"))
instance ToJSON AddonsConfig where
toJSON AddonsConfig'{..}
= object
(catMaybes
[("horizontalPodAutoscaling" .=) <$>
_acHorizontalPodAutoscaling,
("httpLoadBalancing" .=) <$> _acHTTPLoadBalancing])
data NodePool = NodePool'
{ _npStatus :: !(Maybe Text)
, _npConfig :: !(Maybe NodeConfig)
, _npInitialNodeCount :: !(Maybe (Textual Int32))
, _npSelfLink :: !(Maybe Text)
, _npName :: !(Maybe Text)
, _npStatusMessage :: !(Maybe Text)
, _npVersion :: !(Maybe Text)
, _npInstanceGroupURLs :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
nodePool
:: NodePool
nodePool =
NodePool'
{ _npStatus = Nothing
, _npConfig = Nothing
, _npInitialNodeCount = Nothing
, _npSelfLink = Nothing
, _npName = Nothing
, _npStatusMessage = Nothing
, _npVersion = Nothing
, _npInstanceGroupURLs = Nothing
}
npStatus :: Lens' NodePool (Maybe Text)
npStatus = lens _npStatus (\ s a -> s{_npStatus = a})
npConfig :: Lens' NodePool (Maybe NodeConfig)
npConfig = lens _npConfig (\ s a -> s{_npConfig = a})
npInitialNodeCount :: Lens' NodePool (Maybe Int32)
npInitialNodeCount
= lens _npInitialNodeCount
(\ s a -> s{_npInitialNodeCount = a})
. mapping _Coerce
npSelfLink :: Lens' NodePool (Maybe Text)
npSelfLink
= lens _npSelfLink (\ s a -> s{_npSelfLink = a})
npName :: Lens' NodePool (Maybe Text)
npName = lens _npName (\ s a -> s{_npName = a})
npStatusMessage :: Lens' NodePool (Maybe Text)
npStatusMessage
= lens _npStatusMessage
(\ s a -> s{_npStatusMessage = a})
npVersion :: Lens' NodePool (Maybe Text)
npVersion
= lens _npVersion (\ s a -> s{_npVersion = a})
npInstanceGroupURLs :: Lens' NodePool [Text]
npInstanceGroupURLs
= lens _npInstanceGroupURLs
(\ s a -> s{_npInstanceGroupURLs = a})
. _Default
. _Coerce
instance FromJSON NodePool where
parseJSON
= withObject "NodePool"
(\ o ->
NodePool' <$>
(o .:? "status") <*> (o .:? "config") <*>
(o .:? "initialNodeCount")
<*> (o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "statusMessage")
<*> (o .:? "version")
<*> (o .:? "instanceGroupUrls" .!= mempty))
instance ToJSON NodePool where
toJSON NodePool'{..}
= object
(catMaybes
[("status" .=) <$> _npStatus,
("config" .=) <$> _npConfig,
("initialNodeCount" .=) <$> _npInitialNodeCount,
("selfLink" .=) <$> _npSelfLink,
("name" .=) <$> _npName,
("statusMessage" .=) <$> _npStatusMessage,
("version" .=) <$> _npVersion,
("instanceGroupUrls" .=) <$> _npInstanceGroupURLs])
data MasterAuth = MasterAuth'
{ _maClientKey :: !(Maybe Text)
, _maUsername :: !(Maybe Text)
, _maClientCertificate :: !(Maybe Text)
, _maPassword :: !(Maybe Text)
, _maClusterCaCertificate :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
masterAuth
:: MasterAuth
masterAuth =
MasterAuth'
{ _maClientKey = Nothing
, _maUsername = Nothing
, _maClientCertificate = Nothing
, _maPassword = Nothing
, _maClusterCaCertificate = Nothing
}
maClientKey :: Lens' MasterAuth (Maybe Text)
maClientKey
= lens _maClientKey (\ s a -> s{_maClientKey = a})
maUsername :: Lens' MasterAuth (Maybe Text)
maUsername
= lens _maUsername (\ s a -> s{_maUsername = a})
maClientCertificate :: Lens' MasterAuth (Maybe Text)
maClientCertificate
= lens _maClientCertificate
(\ s a -> s{_maClientCertificate = a})
maPassword :: Lens' MasterAuth (Maybe Text)
maPassword
= lens _maPassword (\ s a -> s{_maPassword = a})
maClusterCaCertificate :: Lens' MasterAuth (Maybe Text)
maClusterCaCertificate
= lens _maClusterCaCertificate
(\ s a -> s{_maClusterCaCertificate = a})
instance FromJSON MasterAuth where
parseJSON
= withObject "MasterAuth"
(\ o ->
MasterAuth' <$>
(o .:? "clientKey") <*> (o .:? "username") <*>
(o .:? "clientCertificate")
<*> (o .:? "password")
<*> (o .:? "clusterCaCertificate"))
instance ToJSON MasterAuth where
toJSON MasterAuth'{..}
= object
(catMaybes
[("clientKey" .=) <$> _maClientKey,
("username" .=) <$> _maUsername,
("clientCertificate" .=) <$> _maClientCertificate,
("password" .=) <$> _maPassword,
("clusterCaCertificate" .=) <$>
_maClusterCaCertificate])
newtype NodeConfigMetadata = NodeConfigMetadata'
{ _ncmAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
nodeConfigMetadata
:: HashMap Text Text
-> NodeConfigMetadata
nodeConfigMetadata pNcmAddtional_ =
NodeConfigMetadata'
{ _ncmAddtional = _Coerce # pNcmAddtional_
}
ncmAddtional :: Lens' NodeConfigMetadata (HashMap Text Text)
ncmAddtional
= lens _ncmAddtional (\ s a -> s{_ncmAddtional = a})
. _Coerce
instance FromJSON NodeConfigMetadata where
parseJSON
= withObject "NodeConfigMetadata"
(\ o -> NodeConfigMetadata' <$> (parseJSONObject o))
instance ToJSON NodeConfigMetadata where
toJSON = toJSON . _ncmAddtional
data ServerConfig = ServerConfig'
{ _scValidNodeVersions :: !(Maybe [Text])
, _scDefaultImageFamily :: !(Maybe Text)
, _scValidImageFamilies :: !(Maybe [Text])
, _scDefaultClusterVersion :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
serverConfig
:: ServerConfig
serverConfig =
ServerConfig'
{ _scValidNodeVersions = Nothing
, _scDefaultImageFamily = Nothing
, _scValidImageFamilies = Nothing
, _scDefaultClusterVersion = Nothing
}
scValidNodeVersions :: Lens' ServerConfig [Text]
scValidNodeVersions
= lens _scValidNodeVersions
(\ s a -> s{_scValidNodeVersions = a})
. _Default
. _Coerce
scDefaultImageFamily :: Lens' ServerConfig (Maybe Text)
scDefaultImageFamily
= lens _scDefaultImageFamily
(\ s a -> s{_scDefaultImageFamily = a})
scValidImageFamilies :: Lens' ServerConfig [Text]
scValidImageFamilies
= lens _scValidImageFamilies
(\ s a -> s{_scValidImageFamilies = a})
. _Default
. _Coerce
scDefaultClusterVersion :: Lens' ServerConfig (Maybe Text)
scDefaultClusterVersion
= lens _scDefaultClusterVersion
(\ s a -> s{_scDefaultClusterVersion = a})
instance FromJSON ServerConfig where
parseJSON
= withObject "ServerConfig"
(\ o ->
ServerConfig' <$>
(o .:? "validNodeVersions" .!= mempty) <*>
(o .:? "defaultImageFamily")
<*> (o .:? "validImageFamilies" .!= mempty)
<*> (o .:? "defaultClusterVersion"))
instance ToJSON ServerConfig where
toJSON ServerConfig'{..}
= object
(catMaybes
[("validNodeVersions" .=) <$> _scValidNodeVersions,
("defaultImageFamily" .=) <$> _scDefaultImageFamily,
("validImageFamilies" .=) <$> _scValidImageFamilies,
("defaultClusterVersion" .=) <$>
_scDefaultClusterVersion])
data ListClustersResponse = ListClustersResponse'
{ _lcrClusters :: !(Maybe [Cluster])
, _lcrMissingZones :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
listClustersResponse
:: ListClustersResponse
listClustersResponse =
ListClustersResponse'
{ _lcrClusters = Nothing
, _lcrMissingZones = Nothing
}
lcrClusters :: Lens' ListClustersResponse [Cluster]
lcrClusters
= lens _lcrClusters (\ s a -> s{_lcrClusters = a}) .
_Default
. _Coerce
lcrMissingZones :: Lens' ListClustersResponse [Text]
lcrMissingZones
= lens _lcrMissingZones
(\ s a -> s{_lcrMissingZones = a})
. _Default
. _Coerce
instance FromJSON ListClustersResponse where
parseJSON
= withObject "ListClustersResponse"
(\ o ->
ListClustersResponse' <$>
(o .:? "clusters" .!= mempty) <*>
(o .:? "missingZones" .!= mempty))
instance ToJSON ListClustersResponse where
toJSON ListClustersResponse'{..}
= object
(catMaybes
[("clusters" .=) <$> _lcrClusters,
("missingZones" .=) <$> _lcrMissingZones])
data ClusterUpdate = ClusterUpdate'
{ _cuDesiredAddonsConfig :: !(Maybe AddonsConfig)
, _cuDesiredNodePoolId :: !(Maybe Text)
, _cuDesiredNodeVersion :: !(Maybe Text)
, _cuDesiredMasterVersion :: !(Maybe Text)
, _cuDesiredMonitoringService :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
clusterUpdate
:: ClusterUpdate
clusterUpdate =
ClusterUpdate'
{ _cuDesiredAddonsConfig = Nothing
, _cuDesiredNodePoolId = Nothing
, _cuDesiredNodeVersion = Nothing
, _cuDesiredMasterVersion = Nothing
, _cuDesiredMonitoringService = Nothing
}
cuDesiredAddonsConfig :: Lens' ClusterUpdate (Maybe AddonsConfig)
cuDesiredAddonsConfig
= lens _cuDesiredAddonsConfig
(\ s a -> s{_cuDesiredAddonsConfig = a})
cuDesiredNodePoolId :: Lens' ClusterUpdate (Maybe Text)
cuDesiredNodePoolId
= lens _cuDesiredNodePoolId
(\ s a -> s{_cuDesiredNodePoolId = a})
cuDesiredNodeVersion :: Lens' ClusterUpdate (Maybe Text)
cuDesiredNodeVersion
= lens _cuDesiredNodeVersion
(\ s a -> s{_cuDesiredNodeVersion = a})
cuDesiredMasterVersion :: Lens' ClusterUpdate (Maybe Text)
cuDesiredMasterVersion
= lens _cuDesiredMasterVersion
(\ s a -> s{_cuDesiredMasterVersion = a})
cuDesiredMonitoringService :: Lens' ClusterUpdate (Maybe Text)
cuDesiredMonitoringService
= lens _cuDesiredMonitoringService
(\ s a -> s{_cuDesiredMonitoringService = a})
instance FromJSON ClusterUpdate where
parseJSON
= withObject "ClusterUpdate"
(\ o ->
ClusterUpdate' <$>
(o .:? "desiredAddonsConfig") <*>
(o .:? "desiredNodePoolId")
<*> (o .:? "desiredNodeVersion")
<*> (o .:? "desiredMasterVersion")
<*> (o .:? "desiredMonitoringService"))
instance ToJSON ClusterUpdate where
toJSON ClusterUpdate'{..}
= object
(catMaybes
[("desiredAddonsConfig" .=) <$>
_cuDesiredAddonsConfig,
("desiredNodePoolId" .=) <$> _cuDesiredNodePoolId,
("desiredNodeVersion" .=) <$> _cuDesiredNodeVersion,
("desiredMasterVersion" .=) <$>
_cuDesiredMasterVersion,
("desiredMonitoringService" .=) <$>
_cuDesiredMonitoringService])
newtype ListNodePoolsResponse = ListNodePoolsResponse'
{ _lnprNodePools :: Maybe [NodePool]
} deriving (Eq,Show,Data,Typeable,Generic)
listNodePoolsResponse
:: ListNodePoolsResponse
listNodePoolsResponse =
ListNodePoolsResponse'
{ _lnprNodePools = Nothing
}
lnprNodePools :: Lens' ListNodePoolsResponse [NodePool]
lnprNodePools
= lens _lnprNodePools
(\ s a -> s{_lnprNodePools = a})
. _Default
. _Coerce
instance FromJSON ListNodePoolsResponse where
parseJSON
= withObject "ListNodePoolsResponse"
(\ o ->
ListNodePoolsResponse' <$>
(o .:? "nodePools" .!= mempty))
instance ToJSON ListNodePoolsResponse where
toJSON ListNodePoolsResponse'{..}
= object
(catMaybes [("nodePools" .=) <$> _lnprNodePools])
newtype CreateNodePoolRequest = CreateNodePoolRequest'
{ _cnprNodePool :: Maybe NodePool
} deriving (Eq,Show,Data,Typeable,Generic)
createNodePoolRequest
:: CreateNodePoolRequest
createNodePoolRequest =
CreateNodePoolRequest'
{ _cnprNodePool = Nothing
}
cnprNodePool :: Lens' CreateNodePoolRequest (Maybe NodePool)
cnprNodePool
= lens _cnprNodePool (\ s a -> s{_cnprNodePool = a})
instance FromJSON CreateNodePoolRequest where
parseJSON
= withObject "CreateNodePoolRequest"
(\ o ->
CreateNodePoolRequest' <$> (o .:? "nodePool"))
instance ToJSON CreateNodePoolRequest where
toJSON CreateNodePoolRequest'{..}
= object
(catMaybes [("nodePool" .=) <$> _cnprNodePool])