{-# 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
-- Copyright   : (c) 2015-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
module Network.Google.Container.Types.Product where

import           Network.Google.Container.Types.Sum
import           Network.Google.Prelude

-- | Configuration for NetworkPolicy. This only tracks whether the addon is
-- enabled or not on the Master, it does not track whether network policy
-- is enabled for the nodes.
--
-- /See:/ 'networkPolicyConfig' smart constructor.
newtype NetworkPolicyConfig =
  NetworkPolicyConfig'
    { _npcDisabled :: Maybe Bool
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NetworkPolicyConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'npcDisabled'
networkPolicyConfig
    :: NetworkPolicyConfig
networkPolicyConfig = NetworkPolicyConfig' {_npcDisabled = Nothing}


-- | Whether NetworkPolicy is enabled for this cluster.
npcDisabled :: Lens' NetworkPolicyConfig (Maybe Bool)
npcDisabled
  = lens _npcDisabled (\ s a -> s{_npcDisabled = a})

instance FromJSON NetworkPolicyConfig where
        parseJSON
          = withObject "NetworkPolicyConfig"
              (\ o -> NetworkPolicyConfig' <$> (o .:? "disabled"))

instance ToJSON NetworkPolicyConfig where
        toJSON NetworkPolicyConfig'{..}
          = object
              (catMaybes [("disabled" .=) <$> _npcDisabled])

-- | ListUsableSubnetworksResponse is the response of
-- ListUsableSubnetworksRequest.
--
-- /See:/ 'listUsableSubnetworksResponse' smart constructor.
data ListUsableSubnetworksResponse =
  ListUsableSubnetworksResponse'
    { _lusrNextPageToken :: !(Maybe Text)
    , _lusrSubnetworks   :: !(Maybe [UsableSubnetwork])
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'ListUsableSubnetworksResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lusrNextPageToken'
--
-- * 'lusrSubnetworks'
listUsableSubnetworksResponse
    :: ListUsableSubnetworksResponse
listUsableSubnetworksResponse =
  ListUsableSubnetworksResponse'
    {_lusrNextPageToken = Nothing, _lusrSubnetworks = Nothing}


-- | This token allows you to get the next page of results for list requests.
-- If the number of results is larger than \`page_size\`, use the
-- \`next_page_token\` as a value for the query parameter \`page_token\` in
-- the next request. The value will become empty when there are no more
-- pages.
lusrNextPageToken :: Lens' ListUsableSubnetworksResponse (Maybe Text)
lusrNextPageToken
  = lens _lusrNextPageToken
      (\ s a -> s{_lusrNextPageToken = a})

-- | A list of usable subnetworks in the specified network project.
lusrSubnetworks :: Lens' ListUsableSubnetworksResponse [UsableSubnetwork]
lusrSubnetworks
  = lens _lusrSubnetworks
      (\ s a -> s{_lusrSubnetworks = a})
      . _Default
      . _Coerce

instance FromJSON ListUsableSubnetworksResponse where
        parseJSON
          = withObject "ListUsableSubnetworksResponse"
              (\ o ->
                 ListUsableSubnetworksResponse' <$>
                   (o .:? "nextPageToken") <*>
                     (o .:? "subnetworks" .!= mempty))

instance ToJSON ListUsableSubnetworksResponse where
        toJSON ListUsableSubnetworksResponse'{..}
          = object
              (catMaybes
                 [("nextPageToken" .=) <$> _lusrNextPageToken,
                  ("subnetworks" .=) <$> _lusrSubnetworks])

-- | UpdateNodePoolRequests update a node pool\'s image and\/or version.
--
-- /See:/ 'updateNodePoolRequest' smart constructor.
data UpdateNodePoolRequest =
  UpdateNodePoolRequest'
    { _unprZone        :: !(Maybe Text)
    , _unprNodePoolId  :: !(Maybe Text)
    , _unprImageType   :: !(Maybe Text)
    , _unprName        :: !(Maybe Text)
    , _unprClusterId   :: !(Maybe Text)
    , _unprNodeVersion :: !(Maybe Text)
    , _unprProjectId   :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'UpdateNodePoolRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'unprZone'
--
-- * 'unprNodePoolId'
--
-- * 'unprImageType'
--
-- * 'unprName'
--
-- * 'unprClusterId'
--
-- * 'unprNodeVersion'
--
-- * 'unprProjectId'
updateNodePoolRequest
    :: UpdateNodePoolRequest
updateNodePoolRequest =
  UpdateNodePoolRequest'
    { _unprZone = Nothing
    , _unprNodePoolId = Nothing
    , _unprImageType = Nothing
    , _unprName = Nothing
    , _unprClusterId = Nothing
    , _unprNodeVersion = Nothing
    , _unprProjectId = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
unprZone :: Lens' UpdateNodePoolRequest (Maybe Text)
unprZone = lens _unprZone (\ s a -> s{_unprZone = a})

-- | Deprecated. The name of the node pool to upgrade. This field has been
-- deprecated and replaced by the name field.
unprNodePoolId :: Lens' UpdateNodePoolRequest (Maybe Text)
unprNodePoolId
  = lens _unprNodePoolId
      (\ s a -> s{_unprNodePoolId = a})

-- | The desired image type for the node pool.
unprImageType :: Lens' UpdateNodePoolRequest (Maybe Text)
unprImageType
  = lens _unprImageType
      (\ s a -> s{_unprImageType = a})

-- | The name (project, location, cluster, node pool) of the node pool to
-- update. Specified in the format
-- \'projects\/*\/locations\/*\/clusters\/*\/nodePools\/*\'.
unprName :: Lens' UpdateNodePoolRequest (Maybe Text)
unprName = lens _unprName (\ s a -> s{_unprName = a})

-- | Deprecated. The name of the cluster to upgrade. This field has been
-- deprecated and replaced by the name field.
unprClusterId :: Lens' UpdateNodePoolRequest (Maybe Text)
unprClusterId
  = lens _unprClusterId
      (\ s a -> s{_unprClusterId = a})

-- | The Kubernetes version to change the nodes to (typically an upgrade).
-- Users may specify either explicit versions offered by Kubernetes Engine
-- or version aliases, which have the following behavior: - \"latest\":
-- picks the highest valid Kubernetes version - \"1.X\": picks the highest
-- valid patch+gke.N patch in the 1.X version - \"1.X.Y\": picks the
-- highest valid gke.N patch in the 1.X.Y version - \"1.X.Y-gke.N\": picks
-- an explicit Kubernetes version - \"-\": picks the Kubernetes master
-- version
unprNodeVersion :: Lens' UpdateNodePoolRequest (Maybe Text)
unprNodeVersion
  = lens _unprNodeVersion
      (\ s a -> s{_unprNodeVersion = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
unprProjectId :: Lens' UpdateNodePoolRequest (Maybe Text)
unprProjectId
  = lens _unprProjectId
      (\ s a -> s{_unprProjectId = a})

instance FromJSON UpdateNodePoolRequest where
        parseJSON
          = withObject "UpdateNodePoolRequest"
              (\ o ->
                 UpdateNodePoolRequest' <$>
                   (o .:? "zone") <*> (o .:? "nodePoolId") <*>
                     (o .:? "imageType")
                     <*> (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "nodeVersion")
                     <*> (o .:? "projectId"))

instance ToJSON UpdateNodePoolRequest where
        toJSON UpdateNodePoolRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _unprZone,
                  ("nodePoolId" .=) <$> _unprNodePoolId,
                  ("imageType" .=) <$> _unprImageType,
                  ("name" .=) <$> _unprName,
                  ("clusterId" .=) <$> _unprClusterId,
                  ("nodeVersion" .=) <$> _unprNodeVersion,
                  ("projectId" .=) <$> _unprProjectId])

-- | UpdateMasterRequest updates the master of the cluster.
--
-- /See:/ 'updateMasterRequest' smart constructor.
data UpdateMasterRequest =
  UpdateMasterRequest'
    { _umrZone          :: !(Maybe Text)
    , _umrName          :: !(Maybe Text)
    , _umrClusterId     :: !(Maybe Text)
    , _umrProjectId     :: !(Maybe Text)
    , _umrMasterVersion :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'UpdateMasterRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'umrZone'
--
-- * 'umrName'
--
-- * 'umrClusterId'
--
-- * 'umrProjectId'
--
-- * 'umrMasterVersion'
updateMasterRequest
    :: UpdateMasterRequest
updateMasterRequest =
  UpdateMasterRequest'
    { _umrZone = Nothing
    , _umrName = Nothing
    , _umrClusterId = Nothing
    , _umrProjectId = Nothing
    , _umrMasterVersion = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
umrZone :: Lens' UpdateMasterRequest (Maybe Text)
umrZone = lens _umrZone (\ s a -> s{_umrZone = a})

-- | The name (project, location, cluster) of the cluster to update.
-- Specified in the format \'projects\/*\/locations\/*\/clusters\/*\'.
umrName :: Lens' UpdateMasterRequest (Maybe Text)
umrName = lens _umrName (\ s a -> s{_umrName = a})

-- | Deprecated. The name of the cluster to upgrade. This field has been
-- deprecated and replaced by the name field.
umrClusterId :: Lens' UpdateMasterRequest (Maybe Text)
umrClusterId
  = lens _umrClusterId (\ s a -> s{_umrClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
umrProjectId :: Lens' UpdateMasterRequest (Maybe Text)
umrProjectId
  = lens _umrProjectId (\ s a -> s{_umrProjectId = a})

-- | The Kubernetes version to change the master to. Users may specify either
-- explicit versions offered by Kubernetes Engine or version aliases, which
-- have the following behavior: - \"latest\": picks the highest valid
-- Kubernetes version - \"1.X\": picks the highest valid patch+gke.N patch
-- in the 1.X version - \"1.X.Y\": picks the highest valid gke.N patch in
-- the 1.X.Y version - \"1.X.Y-gke.N\": picks an explicit Kubernetes
-- version - \"-\": picks the default Kubernetes version
umrMasterVersion :: Lens' UpdateMasterRequest (Maybe Text)
umrMasterVersion
  = lens _umrMasterVersion
      (\ s a -> s{_umrMasterVersion = a})

instance FromJSON UpdateMasterRequest where
        parseJSON
          = withObject "UpdateMasterRequest"
              (\ o ->
                 UpdateMasterRequest' <$>
                   (o .:? "zone") <*> (o .:? "name") <*>
                     (o .:? "clusterId")
                     <*> (o .:? "projectId")
                     <*> (o .:? "masterVersion"))

instance ToJSON UpdateMasterRequest where
        toJSON UpdateMasterRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _umrZone, ("name" .=) <$> _umrName,
                  ("clusterId" .=) <$> _umrClusterId,
                  ("projectId" .=) <$> _umrProjectId,
                  ("masterVersion" .=) <$> _umrMasterVersion])

-- | StartIPRotationRequest creates a new IP for the cluster and then
-- performs a node upgrade on each node pool to point to the new IP.
--
-- /See:/ 'startIPRotationRequest' smart constructor.
data StartIPRotationRequest =
  StartIPRotationRequest'
    { _sirrZone              :: !(Maybe Text)
    , _sirrRotateCredentials :: !(Maybe Bool)
    , _sirrName              :: !(Maybe Text)
    , _sirrClusterId         :: !(Maybe Text)
    , _sirrProjectId         :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'StartIPRotationRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sirrZone'
--
-- * 'sirrRotateCredentials'
--
-- * 'sirrName'
--
-- * 'sirrClusterId'
--
-- * 'sirrProjectId'
startIPRotationRequest
    :: StartIPRotationRequest
startIPRotationRequest =
  StartIPRotationRequest'
    { _sirrZone = Nothing
    , _sirrRotateCredentials = Nothing
    , _sirrName = Nothing
    , _sirrClusterId = Nothing
    , _sirrProjectId = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
sirrZone :: Lens' StartIPRotationRequest (Maybe Text)
sirrZone = lens _sirrZone (\ s a -> s{_sirrZone = a})

-- | Whether to rotate credentials during IP rotation.
sirrRotateCredentials :: Lens' StartIPRotationRequest (Maybe Bool)
sirrRotateCredentials
  = lens _sirrRotateCredentials
      (\ s a -> s{_sirrRotateCredentials = a})

-- | The name (project, location, cluster id) of the cluster to start IP
-- rotation. Specified in the format
-- \'projects\/*\/locations\/*\/clusters\/*\'.
sirrName :: Lens' StartIPRotationRequest (Maybe Text)
sirrName = lens _sirrName (\ s a -> s{_sirrName = a})

-- | Deprecated. The name of the cluster. This field has been deprecated and
-- replaced by the name field.
sirrClusterId :: Lens' StartIPRotationRequest (Maybe Text)
sirrClusterId
  = lens _sirrClusterId
      (\ s a -> s{_sirrClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/developers.google.com\/console\/help\/new\/#projectnumber).
-- This field has been deprecated and replaced by the name field.
sirrProjectId :: Lens' StartIPRotationRequest (Maybe Text)
sirrProjectId
  = lens _sirrProjectId
      (\ s a -> s{_sirrProjectId = a})

instance FromJSON StartIPRotationRequest where
        parseJSON
          = withObject "StartIPRotationRequest"
              (\ o ->
                 StartIPRotationRequest' <$>
                   (o .:? "zone") <*> (o .:? "rotateCredentials") <*>
                     (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "projectId"))

instance ToJSON StartIPRotationRequest where
        toJSON StartIPRotationRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _sirrZone,
                  ("rotateCredentials" .=) <$> _sirrRotateCredentials,
                  ("name" .=) <$> _sirrName,
                  ("clusterId" .=) <$> _sirrClusterId,
                  ("projectId" .=) <$> _sirrProjectId])

-- | SetLegacyAbacRequest enables or disables the ABAC authorization
-- mechanism for a cluster.
--
-- /See:/ 'setLegacyAbacRequest' smart constructor.
data SetLegacyAbacRequest =
  SetLegacyAbacRequest'
    { _slarEnabled   :: !(Maybe Bool)
    , _slarZone      :: !(Maybe Text)
    , _slarName      :: !(Maybe Text)
    , _slarClusterId :: !(Maybe Text)
    , _slarProjectId :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'SetLegacyAbacRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'slarEnabled'
--
-- * 'slarZone'
--
-- * 'slarName'
--
-- * 'slarClusterId'
--
-- * 'slarProjectId'
setLegacyAbacRequest
    :: SetLegacyAbacRequest
setLegacyAbacRequest =
  SetLegacyAbacRequest'
    { _slarEnabled = Nothing
    , _slarZone = Nothing
    , _slarName = Nothing
    , _slarClusterId = Nothing
    , _slarProjectId = Nothing
    }


-- | Whether ABAC authorization will be enabled in the cluster.
slarEnabled :: Lens' SetLegacyAbacRequest (Maybe Bool)
slarEnabled
  = lens _slarEnabled (\ s a -> s{_slarEnabled = a})

-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
slarZone :: Lens' SetLegacyAbacRequest (Maybe Text)
slarZone = lens _slarZone (\ s a -> s{_slarZone = a})

-- | The name (project, location, cluster id) of the cluster to set legacy
-- abac. Specified in the format
-- \'projects\/*\/locations\/*\/clusters\/*\'.
slarName :: Lens' SetLegacyAbacRequest (Maybe Text)
slarName = lens _slarName (\ s a -> s{_slarName = a})

-- | Deprecated. The name of the cluster to update. This field has been
-- deprecated and replaced by the name field.
slarClusterId :: Lens' SetLegacyAbacRequest (Maybe Text)
slarClusterId
  = lens _slarClusterId
      (\ s a -> s{_slarClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
slarProjectId :: Lens' SetLegacyAbacRequest (Maybe Text)
slarProjectId
  = lens _slarProjectId
      (\ s a -> s{_slarProjectId = a})

instance FromJSON SetLegacyAbacRequest where
        parseJSON
          = withObject "SetLegacyAbacRequest"
              (\ o ->
                 SetLegacyAbacRequest' <$>
                   (o .:? "enabled") <*> (o .:? "zone") <*>
                     (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "projectId"))

instance ToJSON SetLegacyAbacRequest where
        toJSON SetLegacyAbacRequest'{..}
          = object
              (catMaybes
                 [("enabled" .=) <$> _slarEnabled,
                  ("zone" .=) <$> _slarZone, ("name" .=) <$> _slarName,
                  ("clusterId" .=) <$> _slarClusterId,
                  ("projectId" .=) <$> _slarProjectId])

-- | Configuration options for the horizontal pod autoscaling feature, which
-- increases or decreases the number of replica pods a replication
-- controller has based on the resource usage of the existing pods.
--
-- /See:/ 'horizontalPodAutoscaling' smart constructor.
newtype HorizontalPodAutoscaling =
  HorizontalPodAutoscaling'
    { _hpaDisabled :: Maybe Bool
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'HorizontalPodAutoscaling' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'hpaDisabled'
horizontalPodAutoscaling
    :: HorizontalPodAutoscaling
horizontalPodAutoscaling = HorizontalPodAutoscaling' {_hpaDisabled = Nothing}


-- | Whether the Horizontal Pod Autoscaling feature is enabled in the
-- cluster. When enabled, it ensures that a Heapster pod is running in the
-- cluster, which is also used by the Cloud Monitoring service.
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])

-- | SetMasterAuthRequest updates the admin password of a cluster.
--
-- /See:/ 'setMasterAuthRequest' smart constructor.
data SetMasterAuthRequest =
  SetMasterAuthRequest'
    { _smarAction    :: !(Maybe SetMasterAuthRequestAction)
    , _smarZone      :: !(Maybe Text)
    , _smarName      :: !(Maybe Text)
    , _smarClusterId :: !(Maybe Text)
    , _smarProjectId :: !(Maybe Text)
    , _smarUpdate    :: !(Maybe MasterAuth)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'SetMasterAuthRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'smarAction'
--
-- * 'smarZone'
--
-- * 'smarName'
--
-- * 'smarClusterId'
--
-- * 'smarProjectId'
--
-- * 'smarUpdate'
setMasterAuthRequest
    :: SetMasterAuthRequest
setMasterAuthRequest =
  SetMasterAuthRequest'
    { _smarAction = Nothing
    , _smarZone = Nothing
    , _smarName = Nothing
    , _smarClusterId = Nothing
    , _smarProjectId = Nothing
    , _smarUpdate = Nothing
    }


-- | The exact form of action to be taken on the master auth.
smarAction :: Lens' SetMasterAuthRequest (Maybe SetMasterAuthRequestAction)
smarAction
  = lens _smarAction (\ s a -> s{_smarAction = a})

-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
smarZone :: Lens' SetMasterAuthRequest (Maybe Text)
smarZone = lens _smarZone (\ s a -> s{_smarZone = a})

-- | The name (project, location, cluster) of the cluster to set auth.
-- Specified in the format \'projects\/*\/locations\/*\/clusters\/*\'.
smarName :: Lens' SetMasterAuthRequest (Maybe Text)
smarName = lens _smarName (\ s a -> s{_smarName = a})

-- | Deprecated. The name of the cluster to upgrade. This field has been
-- deprecated and replaced by the name field.
smarClusterId :: Lens' SetMasterAuthRequest (Maybe Text)
smarClusterId
  = lens _smarClusterId
      (\ s a -> s{_smarClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
smarProjectId :: Lens' SetMasterAuthRequest (Maybe Text)
smarProjectId
  = lens _smarProjectId
      (\ s a -> s{_smarProjectId = a})

-- | A description of the update.
smarUpdate :: Lens' SetMasterAuthRequest (Maybe MasterAuth)
smarUpdate
  = lens _smarUpdate (\ s a -> s{_smarUpdate = a})

instance FromJSON SetMasterAuthRequest where
        parseJSON
          = withObject "SetMasterAuthRequest"
              (\ o ->
                 SetMasterAuthRequest' <$>
                   (o .:? "action") <*> (o .:? "zone") <*>
                     (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "projectId")
                     <*> (o .:? "update"))

instance ToJSON SetMasterAuthRequest where
        toJSON SetMasterAuthRequest'{..}
          = object
              (catMaybes
                 [("action" .=) <$> _smarAction,
                  ("zone" .=) <$> _smarZone, ("name" .=) <$> _smarName,
                  ("clusterId" .=) <$> _smarClusterId,
                  ("projectId" .=) <$> _smarProjectId,
                  ("update" .=) <$> _smarUpdate])

-- | ListOperationsResponse is the result of ListOperationsRequest.
--
-- /See:/ 'listOperationsResponse' smart constructor.
data ListOperationsResponse =
  ListOperationsResponse'
    { _lorOperations   :: !(Maybe [Operation])
    , _lorMissingZones :: !(Maybe [Text])
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'ListOperationsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lorOperations'
--
-- * 'lorMissingZones'
listOperationsResponse
    :: ListOperationsResponse
listOperationsResponse =
  ListOperationsResponse' {_lorOperations = Nothing, _lorMissingZones = Nothing}


-- | A list of operations in the project in the specified zone.
lorOperations :: Lens' ListOperationsResponse [Operation]
lorOperations
  = lens _lorOperations
      (\ s a -> s{_lorOperations = a})
      . _Default
      . _Coerce

-- | If any zones are listed here, the list of operations returned may be
-- missing the operations from those zones.
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])

-- | CreateClusterRequest creates a cluster.
--
-- /See:/ 'createClusterRequest' smart constructor.
data CreateClusterRequest =
  CreateClusterRequest'
    { _ccrParent    :: !(Maybe Text)
    , _ccrCluster   :: !(Maybe Cluster)
    , _ccrZone      :: !(Maybe Text)
    , _ccrProjectId :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'CreateClusterRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ccrParent'
--
-- * 'ccrCluster'
--
-- * 'ccrZone'
--
-- * 'ccrProjectId'
createClusterRequest
    :: CreateClusterRequest
createClusterRequest =
  CreateClusterRequest'
    { _ccrParent = Nothing
    , _ccrCluster = Nothing
    , _ccrZone = Nothing
    , _ccrProjectId = Nothing
    }


-- | The parent (project and location) where the cluster will be created.
-- Specified in the format \'projects\/*\/locations\/*\'.
ccrParent :: Lens' CreateClusterRequest (Maybe Text)
ccrParent
  = lens _ccrParent (\ s a -> s{_ccrParent = a})

-- | A [cluster
-- resource](\/container-engine\/reference\/rest\/v1\/projects.zones.clusters)
ccrCluster :: Lens' CreateClusterRequest (Maybe Cluster)
ccrCluster
  = lens _ccrCluster (\ s a -> s{_ccrCluster = a})

-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the parent field.
ccrZone :: Lens' CreateClusterRequest (Maybe Text)
ccrZone = lens _ccrZone (\ s a -> s{_ccrZone = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the parent field.
ccrProjectId :: Lens' CreateClusterRequest (Maybe Text)
ccrProjectId
  = lens _ccrProjectId (\ s a -> s{_ccrProjectId = a})

instance FromJSON CreateClusterRequest where
        parseJSON
          = withObject "CreateClusterRequest"
              (\ o ->
                 CreateClusterRequest' <$>
                   (o .:? "parent") <*> (o .:? "cluster") <*>
                     (o .:? "zone")
                     <*> (o .:? "projectId"))

instance ToJSON CreateClusterRequest where
        toJSON CreateClusterRequest'{..}
          = object
              (catMaybes
                 [("parent" .=) <$> _ccrParent,
                  ("cluster" .=) <$> _ccrCluster,
                  ("zone" .=) <$> _ccrZone,
                  ("projectId" .=) <$> _ccrProjectId])

-- | A Google Kubernetes Engine cluster.
--
-- /See:/ 'cluster' smart constructor.
data Cluster =
  Cluster'
    { _cStatus                         :: !(Maybe ClusterStatus)
    , _cNodePools                      :: !(Maybe [NodePool])
    , _cEnableKubernetesAlpha          :: !(Maybe Bool)
    , _cResourceLabels                 :: !(Maybe ClusterResourceLabels)
    , _cTpuIPv4CIdRBlock               :: !(Maybe Text)
    , _cNodeConfig                     :: !(Maybe NodeConfig)
    , _cNodeIPv4CIdRSize               :: !(Maybe (Textual Int32))
    , _cClusterIPv4CIdR                :: !(Maybe Text)
    , _cLocation                       :: !(Maybe Text)
    , _cInitialNodeCount               :: !(Maybe (Textual Int32))
    , _cCurrentNodeVersion             :: !(Maybe Text)
    , _cNetwork                        :: !(Maybe Text)
    , _cInitialClusterVersion          :: !(Maybe Text)
    , _cZone                           :: !(Maybe Text)
    , _cAddonsConfig                   :: !(Maybe AddonsConfig)
    , _cServicesIPv4CIdR               :: !(Maybe Text)
    , _cIPAllocationPolicy             :: !(Maybe IPAllocationPolicy)
    , _cMasterAuthorizedNetworksConfig :: !(Maybe MasterAuthorizedNetworksConfig)
    , _cLegacyAbac                     :: !(Maybe LegacyAbac)
    , _cNetworkConfig                  :: !(Maybe NetworkConfig)
    , _cMasterAuth                     :: !(Maybe MasterAuth)
    , _cSelfLink                       :: !(Maybe Text)
    , _cName                           :: !(Maybe Text)
    , _cCurrentMasterVersion           :: !(Maybe Text)
    , _cStatusMessage                  :: !(Maybe Text)
    , _cDefaultMaxPodsConstraint       :: !(Maybe MaxPodsConstraint)
    , _cSubnetwork                     :: !(Maybe Text)
    , _cCurrentNodeCount               :: !(Maybe (Textual Int32))
    , _cPrivateClusterConfig           :: !(Maybe PrivateClusterConfig)
    , _cMaintenancePolicy              :: !(Maybe MaintenancePolicy)
    , _cConditions                     :: !(Maybe [StatusCondition])
    , _cEnableTpu                      :: !(Maybe Bool)
    , _cEndpoint                       :: !(Maybe Text)
    , _cExpireTime                     :: !(Maybe Text)
    , _cNetworkPolicy                  :: !(Maybe NetworkPolicy)
    , _cLocations                      :: !(Maybe [Text])
    , _cLoggingService                 :: !(Maybe Text)
    , _cLabelFingerprint               :: !(Maybe Text)
    , _cDescription                    :: !(Maybe Text)
    , _cInstanceGroupURLs              :: !(Maybe [Text])
    , _cMonitoringService              :: !(Maybe Text)
    , _cCreateTime                     :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'Cluster' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cStatus'
--
-- * 'cNodePools'
--
-- * 'cEnableKubernetesAlpha'
--
-- * 'cResourceLabels'
--
-- * 'cTpuIPv4CIdRBlock'
--
-- * 'cNodeConfig'
--
-- * 'cNodeIPv4CIdRSize'
--
-- * 'cClusterIPv4CIdR'
--
-- * 'cLocation'
--
-- * 'cInitialNodeCount'
--
-- * 'cCurrentNodeVersion'
--
-- * 'cNetwork'
--
-- * 'cInitialClusterVersion'
--
-- * 'cZone'
--
-- * 'cAddonsConfig'
--
-- * 'cServicesIPv4CIdR'
--
-- * 'cIPAllocationPolicy'
--
-- * 'cMasterAuthorizedNetworksConfig'
--
-- * 'cLegacyAbac'
--
-- * 'cNetworkConfig'
--
-- * 'cMasterAuth'
--
-- * 'cSelfLink'
--
-- * 'cName'
--
-- * 'cCurrentMasterVersion'
--
-- * 'cStatusMessage'
--
-- * 'cDefaultMaxPodsConstraint'
--
-- * 'cSubnetwork'
--
-- * 'cCurrentNodeCount'
--
-- * 'cPrivateClusterConfig'
--
-- * 'cMaintenancePolicy'
--
-- * 'cConditions'
--
-- * 'cEnableTpu'
--
-- * 'cEndpoint'
--
-- * 'cExpireTime'
--
-- * 'cNetworkPolicy'
--
-- * 'cLocations'
--
-- * 'cLoggingService'
--
-- * 'cLabelFingerprint'
--
-- * 'cDescription'
--
-- * 'cInstanceGroupURLs'
--
-- * 'cMonitoringService'
--
-- * 'cCreateTime'
cluster
    :: Cluster
cluster =
  Cluster'
    { _cStatus = Nothing
    , _cNodePools = Nothing
    , _cEnableKubernetesAlpha = Nothing
    , _cResourceLabels = Nothing
    , _cTpuIPv4CIdRBlock = Nothing
    , _cNodeConfig = Nothing
    , _cNodeIPv4CIdRSize = Nothing
    , _cClusterIPv4CIdR = Nothing
    , _cLocation = Nothing
    , _cInitialNodeCount = Nothing
    , _cCurrentNodeVersion = Nothing
    , _cNetwork = Nothing
    , _cInitialClusterVersion = Nothing
    , _cZone = Nothing
    , _cAddonsConfig = Nothing
    , _cServicesIPv4CIdR = Nothing
    , _cIPAllocationPolicy = Nothing
    , _cMasterAuthorizedNetworksConfig = Nothing
    , _cLegacyAbac = Nothing
    , _cNetworkConfig = Nothing
    , _cMasterAuth = Nothing
    , _cSelfLink = Nothing
    , _cName = Nothing
    , _cCurrentMasterVersion = Nothing
    , _cStatusMessage = Nothing
    , _cDefaultMaxPodsConstraint = Nothing
    , _cSubnetwork = Nothing
    , _cCurrentNodeCount = Nothing
    , _cPrivateClusterConfig = Nothing
    , _cMaintenancePolicy = Nothing
    , _cConditions = Nothing
    , _cEnableTpu = Nothing
    , _cEndpoint = Nothing
    , _cExpireTime = Nothing
    , _cNetworkPolicy = Nothing
    , _cLocations = Nothing
    , _cLoggingService = Nothing
    , _cLabelFingerprint = Nothing
    , _cDescription = Nothing
    , _cInstanceGroupURLs = Nothing
    , _cMonitoringService = Nothing
    , _cCreateTime = Nothing
    }


-- | [Output only] The current status of this cluster.
cStatus :: Lens' Cluster (Maybe ClusterStatus)
cStatus = lens _cStatus (\ s a -> s{_cStatus = a})

-- | The node pools associated with this cluster. This field should not be
-- set if \"node_config\" or \"initial_node_count\" are specified.
cNodePools :: Lens' Cluster [NodePool]
cNodePools
  = lens _cNodePools (\ s a -> s{_cNodePools = a}) .
      _Default
      . _Coerce

-- | Kubernetes alpha features are enabled on this cluster. This includes
-- alpha API groups (e.g. v1alpha1) and features that may not be production
-- ready in the kubernetes version of the master and nodes. The cluster has
-- no SLA for uptime and master\/node upgrades are disabled. Alpha enabled
-- clusters are automatically deleted thirty days after creation.
cEnableKubernetesAlpha :: Lens' Cluster (Maybe Bool)
cEnableKubernetesAlpha
  = lens _cEnableKubernetesAlpha
      (\ s a -> s{_cEnableKubernetesAlpha = a})

-- | The resource labels for the cluster to use to annotate any related
-- Google Compute Engine resources.
cResourceLabels :: Lens' Cluster (Maybe ClusterResourceLabels)
cResourceLabels
  = lens _cResourceLabels
      (\ s a -> s{_cResourceLabels = a})

-- | [Output only] The IP address range of the Cloud TPUs in this cluster, in
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`1.2.3.4\/29\`).
cTpuIPv4CIdRBlock :: Lens' Cluster (Maybe Text)
cTpuIPv4CIdRBlock
  = lens _cTpuIPv4CIdRBlock
      (\ s a -> s{_cTpuIPv4CIdRBlock = a})

-- | Parameters used in creating the cluster\'s nodes. See \`nodeConfig\` for
-- the description of its properties. For requests, this field should only
-- be used in lieu of a \"node_pool\" object, since this configuration
-- (along with the \"initial_node_count\") will be used to create a
-- \"NodePool\" object with an auto-generated name. Do not use this and a
-- node_pool at the same time. For responses, this field will be populated
-- with the node configuration of the first node pool. If unspecified, the
-- defaults are used.
cNodeConfig :: Lens' Cluster (Maybe NodeConfig)
cNodeConfig
  = lens _cNodeConfig (\ s a -> s{_cNodeConfig = a})

-- | [Output only] The size of the address space on each node for hosting
-- containers. This is provisioned from within the \`container_ipv4_cidr\`
-- range.
cNodeIPv4CIdRSize :: Lens' Cluster (Maybe Int32)
cNodeIPv4CIdRSize
  = lens _cNodeIPv4CIdRSize
      (\ s a -> s{_cNodeIPv4CIdRSize = a})
      . mapping _Coerce

-- | The IP address range of the container pods in this cluster, in
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`10.96.0.0\/14\`). Leave blank to have one automatically
-- chosen or specify a \`\/14\` block in \`10.0.0.0\/8\`.
cClusterIPv4CIdR :: Lens' Cluster (Maybe Text)
cClusterIPv4CIdR
  = lens _cClusterIPv4CIdR
      (\ s a -> s{_cClusterIPv4CIdR = a})

-- | [Output only] The name of the Google Compute Engine
-- [zone](\/compute\/docs\/regions-zones\/regions-zones#available) or
-- [region](\/compute\/docs\/regions-zones\/regions-zones#available) in
-- which the cluster resides.
cLocation :: Lens' Cluster (Maybe Text)
cLocation
  = lens _cLocation (\ s a -> s{_cLocation = a})

-- | The number of nodes to create in this cluster. You must ensure that your
-- Compute Engine </compute/docs/resource-quotas resource quota> is
-- sufficient for this number of instances. You must also have available
-- firewall and routes quota. For requests, this field should only be used
-- in lieu of a \"node_pool\" object, since this configuration (along with
-- the \"node_config\") will be used to create a \"NodePool\" object with
-- an auto-generated name. Do not use this and a node_pool at the same
-- time.
cInitialNodeCount :: Lens' Cluster (Maybe Int32)
cInitialNodeCount
  = lens _cInitialNodeCount
      (\ s a -> s{_cInitialNodeCount = a})
      . mapping _Coerce

-- | [Output only] Deprecated, use
-- [NodePools.version](\/kubernetes-engine\/docs\/reference\/rest\/v1\/projects.zones.clusters.nodePools)
-- instead. The current version of the node software components. If they
-- are currently at multiple versions because they\'re in the process of
-- being upgraded, this reflects the minimum version of all nodes.
cCurrentNodeVersion :: Lens' Cluster (Maybe Text)
cCurrentNodeVersion
  = lens _cCurrentNodeVersion
      (\ s a -> s{_cCurrentNodeVersion = a})

-- | The name of the Google Compute Engine
-- [network](\/compute\/docs\/networks-and-firewalls#networks) to which the
-- cluster is connected. If left unspecified, the \`default\` network will
-- be used.
cNetwork :: Lens' Cluster (Maybe Text)
cNetwork = lens _cNetwork (\ s a -> s{_cNetwork = a})

-- | The initial Kubernetes version for this cluster. Valid versions are
-- those found in validMasterVersions returned by getServerConfig. The
-- version can be upgraded over time; such upgrades are reflected in
-- currentMasterVersion and currentNodeVersion. Users may specify either
-- explicit versions offered by Kubernetes Engine or version aliases, which
-- have the following behavior: - \"latest\": picks the highest valid
-- Kubernetes version - \"1.X\": picks the highest valid patch+gke.N patch
-- in the 1.X version - \"1.X.Y\": picks the highest valid gke.N patch in
-- the 1.X.Y version - \"1.X.Y-gke.N\": picks an explicit Kubernetes
-- version - \"\",\"-\": picks the default Kubernetes version
cInitialClusterVersion :: Lens' Cluster (Maybe Text)
cInitialClusterVersion
  = lens _cInitialClusterVersion
      (\ s a -> s{_cInitialClusterVersion = a})

-- | [Output only] The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field is deprecated, use location instead.
cZone :: Lens' Cluster (Maybe Text)
cZone = lens _cZone (\ s a -> s{_cZone = a})

-- | Configurations for the various addons available to run in the cluster.
cAddonsConfig :: Lens' Cluster (Maybe AddonsConfig)
cAddonsConfig
  = lens _cAddonsConfig
      (\ s a -> s{_cAddonsConfig = a})

-- | [Output only] The IP address range of the Kubernetes services in this
-- cluster, in
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`1.2.3.4\/29\`). Service addresses are typically put in
-- the last \`\/16\` from the container CIDR.
cServicesIPv4CIdR :: Lens' Cluster (Maybe Text)
cServicesIPv4CIdR
  = lens _cServicesIPv4CIdR
      (\ s a -> s{_cServicesIPv4CIdR = a})

-- | Configuration for cluster IP allocation.
cIPAllocationPolicy :: Lens' Cluster (Maybe IPAllocationPolicy)
cIPAllocationPolicy
  = lens _cIPAllocationPolicy
      (\ s a -> s{_cIPAllocationPolicy = a})

-- | The configuration options for master authorized networks feature.
cMasterAuthorizedNetworksConfig :: Lens' Cluster (Maybe MasterAuthorizedNetworksConfig)
cMasterAuthorizedNetworksConfig
  = lens _cMasterAuthorizedNetworksConfig
      (\ s a -> s{_cMasterAuthorizedNetworksConfig = a})

-- | Configuration for the legacy ABAC authorization mode.
cLegacyAbac :: Lens' Cluster (Maybe LegacyAbac)
cLegacyAbac
  = lens _cLegacyAbac (\ s a -> s{_cLegacyAbac = a})

-- | Configuration for cluster networking.
cNetworkConfig :: Lens' Cluster (Maybe NetworkConfig)
cNetworkConfig
  = lens _cNetworkConfig
      (\ s a -> s{_cNetworkConfig = a})

-- | The authentication information for accessing the master endpoint. If
-- unspecified, the defaults are used: For clusters before v1.12, if
-- master_auth is unspecified, \`username\` will be set to \"admin\", a
-- random password will be generated, and a client certificate will be
-- issued.
cMasterAuth :: Lens' Cluster (Maybe MasterAuth)
cMasterAuth
  = lens _cMasterAuth (\ s a -> s{_cMasterAuth = a})

-- | [Output only] Server-defined URL for the resource.
cSelfLink :: Lens' Cluster (Maybe Text)
cSelfLink
  = lens _cSelfLink (\ s a -> s{_cSelfLink = a})

-- | The name of this cluster. The name must be unique within this project
-- and zone, and can be up to 40 characters with the following
-- restrictions: * Lowercase letters, numbers, and hyphens only. * Must
-- start with a letter. * Must end with a number or a letter.
cName :: Lens' Cluster (Maybe Text)
cName = lens _cName (\ s a -> s{_cName = a})

-- | [Output only] The current software version of the master endpoint.
cCurrentMasterVersion :: Lens' Cluster (Maybe Text)
cCurrentMasterVersion
  = lens _cCurrentMasterVersion
      (\ s a -> s{_cCurrentMasterVersion = a})

-- | [Output only] Additional information about the current status of this
-- cluster, if available.
cStatusMessage :: Lens' Cluster (Maybe Text)
cStatusMessage
  = lens _cStatusMessage
      (\ s a -> s{_cStatusMessage = a})

-- | The default constraint on the maximum number of pods that can be run
-- simultaneously on a node in the node pool of this cluster. Only honored
-- if cluster created with IP Alias support.
cDefaultMaxPodsConstraint :: Lens' Cluster (Maybe MaxPodsConstraint)
cDefaultMaxPodsConstraint
  = lens _cDefaultMaxPodsConstraint
      (\ s a -> s{_cDefaultMaxPodsConstraint = a})

-- | The name of the Google Compute Engine
-- [subnetwork](\/compute\/docs\/subnetworks) to which the cluster is
-- connected.
cSubnetwork :: Lens' Cluster (Maybe Text)
cSubnetwork
  = lens _cSubnetwork (\ s a -> s{_cSubnetwork = a})

-- | [Output only] The number of nodes currently in the cluster. Deprecated.
-- Call Kubernetes API directly to retrieve node information.
cCurrentNodeCount :: Lens' Cluster (Maybe Int32)
cCurrentNodeCount
  = lens _cCurrentNodeCount
      (\ s a -> s{_cCurrentNodeCount = a})
      . mapping _Coerce

-- | Configuration for private cluster.
cPrivateClusterConfig :: Lens' Cluster (Maybe PrivateClusterConfig)
cPrivateClusterConfig
  = lens _cPrivateClusterConfig
      (\ s a -> s{_cPrivateClusterConfig = a})

-- | Configure the maintenance policy for this cluster.
cMaintenancePolicy :: Lens' Cluster (Maybe MaintenancePolicy)
cMaintenancePolicy
  = lens _cMaintenancePolicy
      (\ s a -> s{_cMaintenancePolicy = a})

-- | Which conditions caused the current cluster state.
cConditions :: Lens' Cluster [StatusCondition]
cConditions
  = lens _cConditions (\ s a -> s{_cConditions = a}) .
      _Default
      . _Coerce

-- | Enable the ability to use Cloud TPUs in this cluster.
cEnableTpu :: Lens' Cluster (Maybe Bool)
cEnableTpu
  = lens _cEnableTpu (\ s a -> s{_cEnableTpu = a})

-- | [Output only] The IP address of this cluster\'s master endpoint. The
-- endpoint can be accessed from the internet at
-- \`https:\/\/username:password\'endpoint\/\`. See the \`masterAuth\`
-- property of this resource for username and password information.
cEndpoint :: Lens' Cluster (Maybe Text)
cEndpoint
  = lens _cEndpoint (\ s a -> s{_cEndpoint = a})

-- | [Output only] The time the cluster will be automatically deleted in
-- [RFC3339](https:\/\/www.ietf.org\/rfc\/rfc3339.txt) text format.
cExpireTime :: Lens' Cluster (Maybe Text)
cExpireTime
  = lens _cExpireTime (\ s a -> s{_cExpireTime = a})

-- | Configuration options for the NetworkPolicy feature.
cNetworkPolicy :: Lens' Cluster (Maybe NetworkPolicy)
cNetworkPolicy
  = lens _cNetworkPolicy
      (\ s a -> s{_cNetworkPolicy = a})

-- | The list of Google Compute Engine
-- [zones](\/compute\/docs\/zones#available) in which the cluster\'s nodes
-- should be located.
cLocations :: Lens' Cluster [Text]
cLocations
  = lens _cLocations (\ s a -> s{_cLocations = a}) .
      _Default
      . _Coerce

-- | The logging service the cluster should use to write logs. Currently
-- available options: * \`logging.googleapis.com\` - the Google Cloud
-- Logging service. * \`none\` - no logs will be exported from the cluster.
-- * if left as an empty string,\`logging.googleapis.com\` will be used.
cLoggingService :: Lens' Cluster (Maybe Text)
cLoggingService
  = lens _cLoggingService
      (\ s a -> s{_cLoggingService = a})

-- | The fingerprint of the set of labels for this cluster.
cLabelFingerprint :: Lens' Cluster (Maybe Text)
cLabelFingerprint
  = lens _cLabelFingerprint
      (\ s a -> s{_cLabelFingerprint = a})

-- | An optional description of this cluster.
cDescription :: Lens' Cluster (Maybe Text)
cDescription
  = lens _cDescription (\ s a -> s{_cDescription = a})

-- | Deprecated. Use node_pools.instance_group_urls.
cInstanceGroupURLs :: Lens' Cluster [Text]
cInstanceGroupURLs
  = lens _cInstanceGroupURLs
      (\ s a -> s{_cInstanceGroupURLs = a})
      . _Default
      . _Coerce

-- | The monitoring service the cluster should use to write metrics.
-- Currently available options: * \`monitoring.googleapis.com\` - the
-- Google Cloud Monitoring service. * \`none\` - no metrics will be
-- exported from the cluster. * if left as an empty string,
-- \`monitoring.googleapis.com\` will be used.
cMonitoringService :: Lens' Cluster (Maybe Text)
cMonitoringService
  = lens _cMonitoringService
      (\ s a -> s{_cMonitoringService = a})

-- | [Output only] The time the cluster was created, in
-- [RFC3339](https:\/\/www.ietf.org\/rfc\/rfc3339.txt) text format.
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 .:? "enableKubernetesAlpha")
                     <*> (o .:? "resourceLabels")
                     <*> (o .:? "tpuIpv4CidrBlock")
                     <*> (o .:? "nodeConfig")
                     <*> (o .:? "nodeIpv4CidrSize")
                     <*> (o .:? "clusterIpv4Cidr")
                     <*> (o .:? "location")
                     <*> (o .:? "initialNodeCount")
                     <*> (o .:? "currentNodeVersion")
                     <*> (o .:? "network")
                     <*> (o .:? "initialClusterVersion")
                     <*> (o .:? "zone")
                     <*> (o .:? "addonsConfig")
                     <*> (o .:? "servicesIpv4Cidr")
                     <*> (o .:? "ipAllocationPolicy")
                     <*> (o .:? "masterAuthorizedNetworksConfig")
                     <*> (o .:? "legacyAbac")
                     <*> (o .:? "networkConfig")
                     <*> (o .:? "masterAuth")
                     <*> (o .:? "selfLink")
                     <*> (o .:? "name")
                     <*> (o .:? "currentMasterVersion")
                     <*> (o .:? "statusMessage")
                     <*> (o .:? "defaultMaxPodsConstraint")
                     <*> (o .:? "subnetwork")
                     <*> (o .:? "currentNodeCount")
                     <*> (o .:? "privateClusterConfig")
                     <*> (o .:? "maintenancePolicy")
                     <*> (o .:? "conditions" .!= mempty)
                     <*> (o .:? "enableTpu")
                     <*> (o .:? "endpoint")
                     <*> (o .:? "expireTime")
                     <*> (o .:? "networkPolicy")
                     <*> (o .:? "locations" .!= mempty)
                     <*> (o .:? "loggingService")
                     <*> (o .:? "labelFingerprint")
                     <*> (o .:? "description")
                     <*> (o .:? "instanceGroupUrls" .!= mempty)
                     <*> (o .:? "monitoringService")
                     <*> (o .:? "createTime"))

instance ToJSON Cluster where
        toJSON Cluster'{..}
          = object
              (catMaybes
                 [("status" .=) <$> _cStatus,
                  ("nodePools" .=) <$> _cNodePools,
                  ("enableKubernetesAlpha" .=) <$>
                    _cEnableKubernetesAlpha,
                  ("resourceLabels" .=) <$> _cResourceLabels,
                  ("tpuIpv4CidrBlock" .=) <$> _cTpuIPv4CIdRBlock,
                  ("nodeConfig" .=) <$> _cNodeConfig,
                  ("nodeIpv4CidrSize" .=) <$> _cNodeIPv4CIdRSize,
                  ("clusterIpv4Cidr" .=) <$> _cClusterIPv4CIdR,
                  ("location" .=) <$> _cLocation,
                  ("initialNodeCount" .=) <$> _cInitialNodeCount,
                  ("currentNodeVersion" .=) <$> _cCurrentNodeVersion,
                  ("network" .=) <$> _cNetwork,
                  ("initialClusterVersion" .=) <$>
                    _cInitialClusterVersion,
                  ("zone" .=) <$> _cZone,
                  ("addonsConfig" .=) <$> _cAddonsConfig,
                  ("servicesIpv4Cidr" .=) <$> _cServicesIPv4CIdR,
                  ("ipAllocationPolicy" .=) <$> _cIPAllocationPolicy,
                  ("masterAuthorizedNetworksConfig" .=) <$>
                    _cMasterAuthorizedNetworksConfig,
                  ("legacyAbac" .=) <$> _cLegacyAbac,
                  ("networkConfig" .=) <$> _cNetworkConfig,
                  ("masterAuth" .=) <$> _cMasterAuth,
                  ("selfLink" .=) <$> _cSelfLink,
                  ("name" .=) <$> _cName,
                  ("currentMasterVersion" .=) <$>
                    _cCurrentMasterVersion,
                  ("statusMessage" .=) <$> _cStatusMessage,
                  ("defaultMaxPodsConstraint" .=) <$>
                    _cDefaultMaxPodsConstraint,
                  ("subnetwork" .=) <$> _cSubnetwork,
                  ("currentNodeCount" .=) <$> _cCurrentNodeCount,
                  ("privateClusterConfig" .=) <$>
                    _cPrivateClusterConfig,
                  ("maintenancePolicy" .=) <$> _cMaintenancePolicy,
                  ("conditions" .=) <$> _cConditions,
                  ("enableTpu" .=) <$> _cEnableTpu,
                  ("endpoint" .=) <$> _cEndpoint,
                  ("expireTime" .=) <$> _cExpireTime,
                  ("networkPolicy" .=) <$> _cNetworkPolicy,
                  ("locations" .=) <$> _cLocations,
                  ("loggingService" .=) <$> _cLoggingService,
                  ("labelFingerprint" .=) <$> _cLabelFingerprint,
                  ("description" .=) <$> _cDescription,
                  ("instanceGroupUrls" .=) <$> _cInstanceGroupURLs,
                  ("monitoringService" .=) <$> _cMonitoringService,
                  ("createTime" .=) <$> _cCreateTime])

-- | CancelOperationRequest cancels a single operation.
--
-- /See:/ 'cancelOperationRequest' smart constructor.
data CancelOperationRequest =
  CancelOperationRequest'
    { _corZone        :: !(Maybe Text)
    , _corName        :: !(Maybe Text)
    , _corProjectId   :: !(Maybe Text)
    , _corOperationId :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'CancelOperationRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'corZone'
--
-- * 'corName'
--
-- * 'corProjectId'
--
-- * 'corOperationId'
cancelOperationRequest
    :: CancelOperationRequest
cancelOperationRequest =
  CancelOperationRequest'
    { _corZone = Nothing
    , _corName = Nothing
    , _corProjectId = Nothing
    , _corOperationId = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the operation resides.
-- This field has been deprecated and replaced by the name field.
corZone :: Lens' CancelOperationRequest (Maybe Text)
corZone = lens _corZone (\ s a -> s{_corZone = a})

-- | The name (project, location, operation id) of the operation to cancel.
-- Specified in the format \'projects\/*\/locations\/*\/operations\/*\'.
corName :: Lens' CancelOperationRequest (Maybe Text)
corName = lens _corName (\ s a -> s{_corName = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
corProjectId :: Lens' CancelOperationRequest (Maybe Text)
corProjectId
  = lens _corProjectId (\ s a -> s{_corProjectId = a})

-- | Deprecated. The server-assigned \`name\` of the operation. This field
-- has been deprecated and replaced by the name field.
corOperationId :: Lens' CancelOperationRequest (Maybe Text)
corOperationId
  = lens _corOperationId
      (\ s a -> s{_corOperationId = a})

instance FromJSON CancelOperationRequest where
        parseJSON
          = withObject "CancelOperationRequest"
              (\ o ->
                 CancelOperationRequest' <$>
                   (o .:? "zone") <*> (o .:? "name") <*>
                     (o .:? "projectId")
                     <*> (o .:? "operationId"))

instance ToJSON CancelOperationRequest where
        toJSON CancelOperationRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _corZone, ("name" .=) <$> _corName,
                  ("projectId" .=) <$> _corProjectId,
                  ("operationId" .=) <$> _corOperationId])

-- | UpdateClusterRequest updates the settings of a cluster.
--
-- /See:/ 'updateClusterRequest' smart constructor.
data UpdateClusterRequest =
  UpdateClusterRequest'
    { _ucrZone      :: !(Maybe Text)
    , _ucrName      :: !(Maybe Text)
    , _ucrClusterId :: !(Maybe Text)
    , _ucrProjectId :: !(Maybe Text)
    , _ucrUpdate    :: !(Maybe ClusterUpdate)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'UpdateClusterRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ucrZone'
--
-- * 'ucrName'
--
-- * 'ucrClusterId'
--
-- * 'ucrProjectId'
--
-- * 'ucrUpdate'
updateClusterRequest
    :: UpdateClusterRequest
updateClusterRequest =
  UpdateClusterRequest'
    { _ucrZone = Nothing
    , _ucrName = Nothing
    , _ucrClusterId = Nothing
    , _ucrProjectId = Nothing
    , _ucrUpdate = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
ucrZone :: Lens' UpdateClusterRequest (Maybe Text)
ucrZone = lens _ucrZone (\ s a -> s{_ucrZone = a})

-- | The name (project, location, cluster) of the cluster to update.
-- Specified in the format \'projects\/*\/locations\/*\/clusters\/*\'.
ucrName :: Lens' UpdateClusterRequest (Maybe Text)
ucrName = lens _ucrName (\ s a -> s{_ucrName = a})

-- | Deprecated. The name of the cluster to upgrade. This field has been
-- deprecated and replaced by the name field.
ucrClusterId :: Lens' UpdateClusterRequest (Maybe Text)
ucrClusterId
  = lens _ucrClusterId (\ s a -> s{_ucrClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
ucrProjectId :: Lens' UpdateClusterRequest (Maybe Text)
ucrProjectId
  = lens _ucrProjectId (\ s a -> s{_ucrProjectId = a})

-- | A description of the update.
ucrUpdate :: Lens' UpdateClusterRequest (Maybe ClusterUpdate)
ucrUpdate
  = lens _ucrUpdate (\ s a -> s{_ucrUpdate = a})

instance FromJSON UpdateClusterRequest where
        parseJSON
          = withObject "UpdateClusterRequest"
              (\ o ->
                 UpdateClusterRequest' <$>
                   (o .:? "zone") <*> (o .:? "name") <*>
                     (o .:? "clusterId")
                     <*> (o .:? "projectId")
                     <*> (o .:? "update"))

instance ToJSON UpdateClusterRequest where
        toJSON UpdateClusterRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _ucrZone, ("name" .=) <$> _ucrName,
                  ("clusterId" .=) <$> _ucrClusterId,
                  ("projectId" .=) <$> _ucrProjectId,
                  ("update" .=) <$> _ucrUpdate])

-- | SetAddonsConfigRequest sets the addons associated with the cluster.
--
-- /See:/ 'setAddonsConfigRequest' smart constructor.
data SetAddonsConfigRequest =
  SetAddonsConfigRequest'
    { _sacrZone         :: !(Maybe Text)
    , _sacrAddonsConfig :: !(Maybe AddonsConfig)
    , _sacrName         :: !(Maybe Text)
    , _sacrClusterId    :: !(Maybe Text)
    , _sacrProjectId    :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'SetAddonsConfigRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sacrZone'
--
-- * 'sacrAddonsConfig'
--
-- * 'sacrName'
--
-- * 'sacrClusterId'
--
-- * 'sacrProjectId'
setAddonsConfigRequest
    :: SetAddonsConfigRequest
setAddonsConfigRequest =
  SetAddonsConfigRequest'
    { _sacrZone = Nothing
    , _sacrAddonsConfig = Nothing
    , _sacrName = Nothing
    , _sacrClusterId = Nothing
    , _sacrProjectId = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
sacrZone :: Lens' SetAddonsConfigRequest (Maybe Text)
sacrZone = lens _sacrZone (\ s a -> s{_sacrZone = a})

-- | The desired configurations for the various addons available to run in
-- the cluster.
sacrAddonsConfig :: Lens' SetAddonsConfigRequest (Maybe AddonsConfig)
sacrAddonsConfig
  = lens _sacrAddonsConfig
      (\ s a -> s{_sacrAddonsConfig = a})

-- | The name (project, location, cluster) of the cluster to set addons.
-- Specified in the format \'projects\/*\/locations\/*\/clusters\/*\'.
sacrName :: Lens' SetAddonsConfigRequest (Maybe Text)
sacrName = lens _sacrName (\ s a -> s{_sacrName = a})

-- | Deprecated. The name of the cluster to upgrade. This field has been
-- deprecated and replaced by the name field.
sacrClusterId :: Lens' SetAddonsConfigRequest (Maybe Text)
sacrClusterId
  = lens _sacrClusterId
      (\ s a -> s{_sacrClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
sacrProjectId :: Lens' SetAddonsConfigRequest (Maybe Text)
sacrProjectId
  = lens _sacrProjectId
      (\ s a -> s{_sacrProjectId = a})

instance FromJSON SetAddonsConfigRequest where
        parseJSON
          = withObject "SetAddonsConfigRequest"
              (\ o ->
                 SetAddonsConfigRequest' <$>
                   (o .:? "zone") <*> (o .:? "addonsConfig") <*>
                     (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "projectId"))

instance ToJSON SetAddonsConfigRequest where
        toJSON SetAddonsConfigRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _sacrZone,
                  ("addonsConfig" .=) <$> _sacrAddonsConfig,
                  ("name" .=) <$> _sacrName,
                  ("clusterId" .=) <$> _sacrClusterId,
                  ("projectId" .=) <$> _sacrProjectId])

-- | Parameters that describe the nodes in a cluster.
--
-- /See:/ 'nodeConfig' smart constructor.
data NodeConfig =
  NodeConfig'
    { _ncLocalSsdCount  :: !(Maybe (Textual Int32))
    , _ncDiskSizeGb     :: !(Maybe (Textual Int32))
    , _ncTaints         :: !(Maybe [NodeTaint])
    , _ncOAuthScopes    :: !(Maybe [Text])
    , _ncServiceAccount :: !(Maybe Text)
    , _ncAccelerators   :: !(Maybe [AcceleratorConfig])
    , _ncImageType      :: !(Maybe Text)
    , _ncMachineType    :: !(Maybe Text)
    , _ncMetadata       :: !(Maybe NodeConfigMetadata)
    , _ncDiskType       :: !(Maybe Text)
    , _ncLabels         :: !(Maybe NodeConfigLabels)
    , _ncMinCPUPlatform :: !(Maybe Text)
    , _ncTags           :: !(Maybe [Text])
    , _ncPreemptible    :: !(Maybe Bool)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NodeConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ncLocalSsdCount'
--
-- * 'ncDiskSizeGb'
--
-- * 'ncTaints'
--
-- * 'ncOAuthScopes'
--
-- * 'ncServiceAccount'
--
-- * 'ncAccelerators'
--
-- * 'ncImageType'
--
-- * 'ncMachineType'
--
-- * 'ncMetadata'
--
-- * 'ncDiskType'
--
-- * 'ncLabels'
--
-- * 'ncMinCPUPlatform'
--
-- * 'ncTags'
--
-- * 'ncPreemptible'
nodeConfig
    :: NodeConfig
nodeConfig =
  NodeConfig'
    { _ncLocalSsdCount = Nothing
    , _ncDiskSizeGb = Nothing
    , _ncTaints = Nothing
    , _ncOAuthScopes = Nothing
    , _ncServiceAccount = Nothing
    , _ncAccelerators = Nothing
    , _ncImageType = Nothing
    , _ncMachineType = Nothing
    , _ncMetadata = Nothing
    , _ncDiskType = Nothing
    , _ncLabels = Nothing
    , _ncMinCPUPlatform = Nothing
    , _ncTags = Nothing
    , _ncPreemptible = Nothing
    }


-- | The number of local SSD disks to be attached to the node. The limit for
-- this value is dependant upon the maximum number of disks available on a
-- machine per zone. See:
-- https:\/\/cloud.google.com\/compute\/docs\/disks\/local-ssd#local_ssd_limits
-- for more information.
ncLocalSsdCount :: Lens' NodeConfig (Maybe Int32)
ncLocalSsdCount
  = lens _ncLocalSsdCount
      (\ s a -> s{_ncLocalSsdCount = a})
      . mapping _Coerce

-- | Size of the disk attached to each node, specified in GB. The smallest
-- allowed disk size is 10GB. If unspecified, the default disk size is
-- 100GB.
ncDiskSizeGb :: Lens' NodeConfig (Maybe Int32)
ncDiskSizeGb
  = lens _ncDiskSizeGb (\ s a -> s{_ncDiskSizeGb = a})
      . mapping _Coerce

-- | List of kubernetes taints to be applied to each node. For more
-- information, including usage and the valid values, see:
-- https:\/\/kubernetes.io\/docs\/concepts\/configuration\/taint-and-toleration\/
ncTaints :: Lens' NodeConfig [NodeTaint]
ncTaints
  = lens _ncTaints (\ s a -> s{_ncTaints = a}) .
      _Default
      . _Coerce

-- | The set of Google API scopes to be made available on all of the node VMs
-- under the \"default\" service account. The following scopes are
-- recommended, but not required, and by default are not included: *
-- \`https:\/\/www.googleapis.com\/auth\/compute\` is required for mounting
-- persistent storage on your nodes. *
-- \`https:\/\/www.googleapis.com\/auth\/devstorage.read_only\` is required
-- for communicating with **gcr.io** (the [Google Container
-- Registry](\/container-registry\/)). If unspecified, no scopes are added,
-- unless Cloud Logging or Cloud Monitoring are enabled, in which case
-- their required scopes will be added.
ncOAuthScopes :: Lens' NodeConfig [Text]
ncOAuthScopes
  = lens _ncOAuthScopes
      (\ s a -> s{_ncOAuthScopes = a})
      . _Default
      . _Coerce

-- | The Google Cloud Platform Service Account to be used by the node VMs. If
-- no Service Account is specified, the \"default\" service account is
-- used.
ncServiceAccount :: Lens' NodeConfig (Maybe Text)
ncServiceAccount
  = lens _ncServiceAccount
      (\ s a -> s{_ncServiceAccount = a})

-- | A list of hardware accelerators to be attached to each node. See
-- https:\/\/cloud.google.com\/compute\/docs\/gpus for more information
-- about support for GPUs.
ncAccelerators :: Lens' NodeConfig [AcceleratorConfig]
ncAccelerators
  = lens _ncAccelerators
      (\ s a -> s{_ncAccelerators = a})
      . _Default
      . _Coerce

-- | The image type to use for this node. Note that for a given image type,
-- the latest version of it will be used.
ncImageType :: Lens' NodeConfig (Maybe Text)
ncImageType
  = lens _ncImageType (\ s a -> s{_ncImageType = a})

-- | The name of a Google Compute Engine [machine
-- type](\/compute\/docs\/machine-types) (e.g. \`n1-standard-1\`). If
-- unspecified, the default machine type is \`n1-standard-1\`.
ncMachineType :: Lens' NodeConfig (Maybe Text)
ncMachineType
  = lens _ncMachineType
      (\ s a -> s{_ncMachineType = a})

-- | The metadata key\/value pairs assigned to instances in the cluster. Keys
-- must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in
-- length. These are reflected as part of a URL in the metadata server.
-- Additionally, to avoid ambiguity, keys must not conflict with any other
-- metadata keys for the project or be one of the reserved keys:
-- \"cluster-location\" \"cluster-name\" \"cluster-uid\" \"configure-sh\"
-- \"containerd-configure-sh\" \"enable-os-login\" \"gci-update-strategy\"
-- \"gci-ensure-gke-docker\" \"instance-template\" \"kube-env\"
-- \"startup-script\" \"user-data\" Values are free-form strings, and only
-- have meaning as interpreted by the image running in the instance. The
-- only restriction placed on them is that each value\'s size must be less
-- than or equal to 32 KB. The total size of all keys and values must be
-- less than 512 KB.
ncMetadata :: Lens' NodeConfig (Maybe NodeConfigMetadata)
ncMetadata
  = lens _ncMetadata (\ s a -> s{_ncMetadata = a})

-- | Type of the disk attached to each node (e.g. \'pd-standard\' or
-- \'pd-ssd\') If unspecified, the default disk type is \'pd-standard\'
ncDiskType :: Lens' NodeConfig (Maybe Text)
ncDiskType
  = lens _ncDiskType (\ s a -> s{_ncDiskType = a})

-- | The map of Kubernetes labels (key\/value pairs) to be applied to each
-- node. These will added in addition to any default label(s) that
-- Kubernetes may apply to the node. In case of conflict in label keys, the
-- applied set may differ depending on the Kubernetes version -- it\'s best
-- to assume the behavior is undefined and conflicts should be avoided. For
-- more information, including usage and the valid values, see:
-- https:\/\/kubernetes.io\/docs\/concepts\/overview\/working-with-objects\/labels\/
ncLabels :: Lens' NodeConfig (Maybe NodeConfigLabels)
ncLabels = lens _ncLabels (\ s a -> s{_ncLabels = a})

-- | Minimum CPU platform to be used by this instance. The instance may be
-- scheduled on the specified or newer CPU platform. Applicable values are
-- the friendly names of CPU platforms, such as
-- 'minCpuPlatform: \"Intel Haswell\"' or
-- 'minCpuPlatform: \"Intel Sandy Bridge\"'. For more information, read
-- [how to specify min CPU
-- platform](https:\/\/cloud.google.com\/compute\/docs\/instances\/specify-min-cpu-platform)
ncMinCPUPlatform :: Lens' NodeConfig (Maybe Text)
ncMinCPUPlatform
  = lens _ncMinCPUPlatform
      (\ s a -> s{_ncMinCPUPlatform = a})

-- | The list of instance tags applied to all nodes. Tags are used to
-- identify valid sources or targets for network firewalls and are
-- specified by the client during cluster or node pool creation. Each tag
-- within the list must comply with RFC1035.
ncTags :: Lens' NodeConfig [Text]
ncTags
  = lens _ncTags (\ s a -> s{_ncTags = a}) . _Default .
      _Coerce

-- | Whether the nodes are created as preemptible VM instances. See:
-- https:\/\/cloud.google.com\/compute\/docs\/instances\/preemptible for
-- more information about preemptible VM instances.
ncPreemptible :: Lens' NodeConfig (Maybe Bool)
ncPreemptible
  = lens _ncPreemptible
      (\ s a -> s{_ncPreemptible = a})

instance FromJSON NodeConfig where
        parseJSON
          = withObject "NodeConfig"
              (\ o ->
                 NodeConfig' <$>
                   (o .:? "localSsdCount") <*> (o .:? "diskSizeGb") <*>
                     (o .:? "taints" .!= mempty)
                     <*> (o .:? "oauthScopes" .!= mempty)
                     <*> (o .:? "serviceAccount")
                     <*> (o .:? "accelerators" .!= mempty)
                     <*> (o .:? "imageType")
                     <*> (o .:? "machineType")
                     <*> (o .:? "metadata")
                     <*> (o .:? "diskType")
                     <*> (o .:? "labels")
                     <*> (o .:? "minCpuPlatform")
                     <*> (o .:? "tags" .!= mempty)
                     <*> (o .:? "preemptible"))

instance ToJSON NodeConfig where
        toJSON NodeConfig'{..}
          = object
              (catMaybes
                 [("localSsdCount" .=) <$> _ncLocalSsdCount,
                  ("diskSizeGb" .=) <$> _ncDiskSizeGb,
                  ("taints" .=) <$> _ncTaints,
                  ("oauthScopes" .=) <$> _ncOAuthScopes,
                  ("serviceAccount" .=) <$> _ncServiceAccount,
                  ("accelerators" .=) <$> _ncAccelerators,
                  ("imageType" .=) <$> _ncImageType,
                  ("machineType" .=) <$> _ncMachineType,
                  ("metadata" .=) <$> _ncMetadata,
                  ("diskType" .=) <$> _ncDiskType,
                  ("labels" .=) <$> _ncLabels,
                  ("minCpuPlatform" .=) <$> _ncMinCPUPlatform,
                  ("tags" .=) <$> _ncTags,
                  ("preemptible" .=) <$> _ncPreemptible])

-- | Configuration options for the HTTP (L7) load balancing controller addon,
-- which makes it easy to set up HTTP load balancers for services in a
-- cluster.
--
-- /See:/ 'hTTPLoadBalancing' smart constructor.
newtype HTTPLoadBalancing =
  HTTPLoadBalancing'
    { _httplbDisabled :: Maybe Bool
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'HTTPLoadBalancing' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'httplbDisabled'
hTTPLoadBalancing
    :: HTTPLoadBalancing
hTTPLoadBalancing = HTTPLoadBalancing' {_httplbDisabled = Nothing}


-- | Whether the HTTP Load Balancing controller is enabled in the cluster.
-- When enabled, it runs a small pod in the cluster that manages the load
-- balancers.
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])

-- | This operation resource represents operations that may have happened or
-- are happening on the cluster. All fields are output only.
--
-- /See:/ 'operation' smart constructor.
data Operation =
  Operation'
    { _oNodepoolConditions :: !(Maybe [StatusCondition])
    , _oStatus             :: !(Maybe OperationStatus)
    , _oLocation           :: !(Maybe Text)
    , _oStartTime          :: !(Maybe Text)
    , _oZone               :: !(Maybe Text)
    , _oSelfLink           :: !(Maybe Text)
    , _oName               :: !(Maybe Text)
    , _oStatusMessage      :: !(Maybe Text)
    , _oEndTime            :: !(Maybe Text)
    , _oClusterConditions  :: !(Maybe [StatusCondition])
    , _oOperationType      :: !(Maybe OperationOperationType)
    , _oTargetLink         :: !(Maybe Text)
    , _oDetail             :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'Operation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oNodepoolConditions'
--
-- * 'oStatus'
--
-- * 'oLocation'
--
-- * 'oStartTime'
--
-- * 'oZone'
--
-- * 'oSelfLink'
--
-- * 'oName'
--
-- * 'oStatusMessage'
--
-- * 'oEndTime'
--
-- * 'oClusterConditions'
--
-- * 'oOperationType'
--
-- * 'oTargetLink'
--
-- * 'oDetail'
operation
    :: Operation
operation =
  Operation'
    { _oNodepoolConditions = Nothing
    , _oStatus = Nothing
    , _oLocation = Nothing
    , _oStartTime = Nothing
    , _oZone = Nothing
    , _oSelfLink = Nothing
    , _oName = Nothing
    , _oStatusMessage = Nothing
    , _oEndTime = Nothing
    , _oClusterConditions = Nothing
    , _oOperationType = Nothing
    , _oTargetLink = Nothing
    , _oDetail = Nothing
    }


-- | Which conditions caused the current node pool state.
oNodepoolConditions :: Lens' Operation [StatusCondition]
oNodepoolConditions
  = lens _oNodepoolConditions
      (\ s a -> s{_oNodepoolConditions = a})
      . _Default
      . _Coerce

-- | The current status of the operation.
oStatus :: Lens' Operation (Maybe OperationStatus)
oStatus = lens _oStatus (\ s a -> s{_oStatus = a})

-- | [Output only] The name of the Google Compute Engine
-- [zone](\/compute\/docs\/regions-zones\/regions-zones#available) or
-- [region](\/compute\/docs\/regions-zones\/regions-zones#available) in
-- which the cluster resides.
oLocation :: Lens' Operation (Maybe Text)
oLocation
  = lens _oLocation (\ s a -> s{_oLocation = a})

-- | [Output only] The time the operation started, in
-- [RFC3339](https:\/\/www.ietf.org\/rfc\/rfc3339.txt) text format.
oStartTime :: Lens' Operation (Maybe Text)
oStartTime
  = lens _oStartTime (\ s a -> s{_oStartTime = a})

-- | The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the operation is
-- taking place. This field is deprecated, use location instead.
oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a})

-- | Server-defined URL for the resource.
oSelfLink :: Lens' Operation (Maybe Text)
oSelfLink
  = lens _oSelfLink (\ s a -> s{_oSelfLink = a})

-- | The server-assigned ID for the operation.
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})

-- | If an error has occurred, a textual description of the error.
oStatusMessage :: Lens' Operation (Maybe Text)
oStatusMessage
  = lens _oStatusMessage
      (\ s a -> s{_oStatusMessage = a})

-- | [Output only] The time the operation completed, in
-- [RFC3339](https:\/\/www.ietf.org\/rfc\/rfc3339.txt) text format.
oEndTime :: Lens' Operation (Maybe Text)
oEndTime = lens _oEndTime (\ s a -> s{_oEndTime = a})

-- | Which conditions caused the current cluster state.
oClusterConditions :: Lens' Operation [StatusCondition]
oClusterConditions
  = lens _oClusterConditions
      (\ s a -> s{_oClusterConditions = a})
      . _Default
      . _Coerce

-- | The operation type.
oOperationType :: Lens' Operation (Maybe OperationOperationType)
oOperationType
  = lens _oOperationType
      (\ s a -> s{_oOperationType = a})

-- | Server-defined URL for the target of the operation.
oTargetLink :: Lens' Operation (Maybe Text)
oTargetLink
  = lens _oTargetLink (\ s a -> s{_oTargetLink = a})

-- | Detailed operation progress, if available.
oDetail :: Lens' Operation (Maybe Text)
oDetail = lens _oDetail (\ s a -> s{_oDetail = a})

instance FromJSON Operation where
        parseJSON
          = withObject "Operation"
              (\ o ->
                 Operation' <$>
                   (o .:? "nodepoolConditions" .!= mempty) <*>
                     (o .:? "status")
                     <*> (o .:? "location")
                     <*> (o .:? "startTime")
                     <*> (o .:? "zone")
                     <*> (o .:? "selfLink")
                     <*> (o .:? "name")
                     <*> (o .:? "statusMessage")
                     <*> (o .:? "endTime")
                     <*> (o .:? "clusterConditions" .!= mempty)
                     <*> (o .:? "operationType")
                     <*> (o .:? "targetLink")
                     <*> (o .:? "detail"))

instance ToJSON Operation where
        toJSON Operation'{..}
          = object
              (catMaybes
                 [("nodepoolConditions" .=) <$> _oNodepoolConditions,
                  ("status" .=) <$> _oStatus,
                  ("location" .=) <$> _oLocation,
                  ("startTime" .=) <$> _oStartTime,
                  ("zone" .=) <$> _oZone,
                  ("selfLink" .=) <$> _oSelfLink,
                  ("name" .=) <$> _oName,
                  ("statusMessage" .=) <$> _oStatusMessage,
                  ("endTime" .=) <$> _oEndTime,
                  ("clusterConditions" .=) <$> _oClusterConditions,
                  ("operationType" .=) <$> _oOperationType,
                  ("targetLink" .=) <$> _oTargetLink,
                  ("detail" .=) <$> _oDetail])

-- | The resource labels for the cluster to use to annotate any related
-- Google Compute Engine resources.
--
-- /See:/ 'clusterResourceLabels' smart constructor.
newtype ClusterResourceLabels =
  ClusterResourceLabels'
    { _crlAddtional :: HashMap Text Text
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'ClusterResourceLabels' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'crlAddtional'
clusterResourceLabels
    :: HashMap Text Text -- ^ 'crlAddtional'
    -> ClusterResourceLabels
clusterResourceLabels pCrlAddtional_ =
  ClusterResourceLabels' {_crlAddtional = _Coerce # pCrlAddtional_}


crlAddtional :: Lens' ClusterResourceLabels (HashMap Text Text)
crlAddtional
  = lens _crlAddtional (\ s a -> s{_crlAddtional = a})
      . _Coerce

instance FromJSON ClusterResourceLabels where
        parseJSON
          = withObject "ClusterResourceLabels"
              (\ o ->
                 ClusterResourceLabels' <$> (parseJSONObject o))

instance ToJSON ClusterResourceLabels where
        toJSON = toJSON . _crlAddtional

-- | A generic empty message that you can re-use to avoid defining duplicated
-- empty messages in your APIs. A typical example is to use it as the
-- request or the response type of an API method. For instance: service Foo
-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
--
-- /See:/ 'empty' smart constructor.
data Empty =
  Empty'
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'Empty' with the minimum fields required to make a request.
--
empty
    :: Empty
empty = Empty'


instance FromJSON Empty where
        parseJSON = withObject "Empty" (\ o -> pure Empty')

instance ToJSON Empty where
        toJSON = const emptyObject

-- | SetNodePoolAutoscalingRequest sets the autoscaler settings of a node
-- pool.
--
-- /See:/ 'setNodePoolAutoscalingRequest' smart constructor.
data SetNodePoolAutoscalingRequest =
  SetNodePoolAutoscalingRequest'
    { _snparAutoscaling :: !(Maybe NodePoolAutoscaling)
    , _snparZone        :: !(Maybe Text)
    , _snparNodePoolId  :: !(Maybe Text)
    , _snparName        :: !(Maybe Text)
    , _snparClusterId   :: !(Maybe Text)
    , _snparProjectId   :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'SetNodePoolAutoscalingRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'snparAutoscaling'
--
-- * 'snparZone'
--
-- * 'snparNodePoolId'
--
-- * 'snparName'
--
-- * 'snparClusterId'
--
-- * 'snparProjectId'
setNodePoolAutoscalingRequest
    :: SetNodePoolAutoscalingRequest
setNodePoolAutoscalingRequest =
  SetNodePoolAutoscalingRequest'
    { _snparAutoscaling = Nothing
    , _snparZone = Nothing
    , _snparNodePoolId = Nothing
    , _snparName = Nothing
    , _snparClusterId = Nothing
    , _snparProjectId = Nothing
    }


-- | Autoscaling configuration for the node pool.
snparAutoscaling :: Lens' SetNodePoolAutoscalingRequest (Maybe NodePoolAutoscaling)
snparAutoscaling
  = lens _snparAutoscaling
      (\ s a -> s{_snparAutoscaling = a})

-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
snparZone :: Lens' SetNodePoolAutoscalingRequest (Maybe Text)
snparZone
  = lens _snparZone (\ s a -> s{_snparZone = a})

-- | Deprecated. The name of the node pool to upgrade. This field has been
-- deprecated and replaced by the name field.
snparNodePoolId :: Lens' SetNodePoolAutoscalingRequest (Maybe Text)
snparNodePoolId
  = lens _snparNodePoolId
      (\ s a -> s{_snparNodePoolId = a})

-- | The name (project, location, cluster, node pool) of the node pool to set
-- autoscaler settings. Specified in the format
-- \'projects\/*\/locations\/*\/clusters\/*\/nodePools\/*\'.
snparName :: Lens' SetNodePoolAutoscalingRequest (Maybe Text)
snparName
  = lens _snparName (\ s a -> s{_snparName = a})

-- | Deprecated. The name of the cluster to upgrade. This field has been
-- deprecated and replaced by the name field.
snparClusterId :: Lens' SetNodePoolAutoscalingRequest (Maybe Text)
snparClusterId
  = lens _snparClusterId
      (\ s a -> s{_snparClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840). This
-- field has been deprecated and replaced by the name field.
snparProjectId :: Lens' SetNodePoolAutoscalingRequest (Maybe Text)
snparProjectId
  = lens _snparProjectId
      (\ s a -> s{_snparProjectId = a})

instance FromJSON SetNodePoolAutoscalingRequest where
        parseJSON
          = withObject "SetNodePoolAutoscalingRequest"
              (\ o ->
                 SetNodePoolAutoscalingRequest' <$>
                   (o .:? "autoscaling") <*> (o .:? "zone") <*>
                     (o .:? "nodePoolId")
                     <*> (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "projectId"))

instance ToJSON SetNodePoolAutoscalingRequest where
        toJSON SetNodePoolAutoscalingRequest'{..}
          = object
              (catMaybes
                 [("autoscaling" .=) <$> _snparAutoscaling,
                  ("zone" .=) <$> _snparZone,
                  ("nodePoolId" .=) <$> _snparNodePoolId,
                  ("name" .=) <$> _snparName,
                  ("clusterId" .=) <$> _snparClusterId,
                  ("projectId" .=) <$> _snparProjectId])

-- | CompleteIPRotationRequest moves the cluster master back into single-IP
-- mode.
--
-- /See:/ 'completeIPRotationRequest' smart constructor.
data CompleteIPRotationRequest =
  CompleteIPRotationRequest'
    { _cirrZone      :: !(Maybe Text)
    , _cirrName      :: !(Maybe Text)
    , _cirrClusterId :: !(Maybe Text)
    , _cirrProjectId :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'CompleteIPRotationRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cirrZone'
--
-- * 'cirrName'
--
-- * 'cirrClusterId'
--
-- * 'cirrProjectId'
completeIPRotationRequest
    :: CompleteIPRotationRequest
completeIPRotationRequest =
  CompleteIPRotationRequest'
    { _cirrZone = Nothing
    , _cirrName = Nothing
    , _cirrClusterId = Nothing
    , _cirrProjectId = Nothing
    }


-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
cirrZone :: Lens' CompleteIPRotationRequest (Maybe Text)
cirrZone = lens _cirrZone (\ s a -> s{_cirrZone = a})

-- | The name (project, location, cluster id) of the cluster to complete IP
-- rotation. Specified in the format
-- \'projects\/*\/locations\/*\/clusters\/*\'.
cirrName :: Lens' CompleteIPRotationRequest (Maybe Text)
cirrName = lens _cirrName (\ s a -> s{_cirrName = a})

-- | Deprecated. The name of the cluster. This field has been deprecated and
-- replaced by the name field.
cirrClusterId :: Lens' CompleteIPRotationRequest (Maybe Text)
cirrClusterId
  = lens _cirrClusterId
      (\ s a -> s{_cirrClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/developers.google.com\/console\/help\/new\/#projectnumber).
-- This field has been deprecated and replaced by the name field.
cirrProjectId :: Lens' CompleteIPRotationRequest (Maybe Text)
cirrProjectId
  = lens _cirrProjectId
      (\ s a -> s{_cirrProjectId = a})

instance FromJSON CompleteIPRotationRequest where
        parseJSON
          = withObject "CompleteIPRotationRequest"
              (\ o ->
                 CompleteIPRotationRequest' <$>
                   (o .:? "zone") <*> (o .:? "name") <*>
                     (o .:? "clusterId")
                     <*> (o .:? "projectId"))

instance ToJSON CompleteIPRotationRequest where
        toJSON CompleteIPRotationRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _cirrZone,
                  ("name" .=) <$> _cirrName,
                  ("clusterId" .=) <$> _cirrClusterId,
                  ("projectId" .=) <$> _cirrProjectId])

-- | Secondary IP range of a usable subnetwork.
--
-- /See:/ 'usableSubnetworkSecondaryRange' smart constructor.
data UsableSubnetworkSecondaryRange =
  UsableSubnetworkSecondaryRange'
    { _ussrStatus      :: !(Maybe UsableSubnetworkSecondaryRangeStatus)
    , _ussrRangeName   :: !(Maybe Text)
    , _ussrIPCIdRRange :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'UsableSubnetworkSecondaryRange' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ussrStatus'
--
-- * 'ussrRangeName'
--
-- * 'ussrIPCIdRRange'
usableSubnetworkSecondaryRange
    :: UsableSubnetworkSecondaryRange
usableSubnetworkSecondaryRange =
  UsableSubnetworkSecondaryRange'
    { _ussrStatus = Nothing
    , _ussrRangeName = Nothing
    , _ussrIPCIdRRange = Nothing
    }


-- | This field is to determine the status of the secondary range
-- programmably.
ussrStatus :: Lens' UsableSubnetworkSecondaryRange (Maybe UsableSubnetworkSecondaryRangeStatus)
ussrStatus
  = lens _ussrStatus (\ s a -> s{_ussrStatus = a})

-- | The name associated with this subnetwork secondary range, used when
-- adding an alias IP range to a VM instance.
ussrRangeName :: Lens' UsableSubnetworkSecondaryRange (Maybe Text)
ussrRangeName
  = lens _ussrRangeName
      (\ s a -> s{_ussrRangeName = a})

-- | The range of IP addresses belonging to this subnetwork secondary range.
ussrIPCIdRRange :: Lens' UsableSubnetworkSecondaryRange (Maybe Text)
ussrIPCIdRRange
  = lens _ussrIPCIdRRange
      (\ s a -> s{_ussrIPCIdRRange = a})

instance FromJSON UsableSubnetworkSecondaryRange
         where
        parseJSON
          = withObject "UsableSubnetworkSecondaryRange"
              (\ o ->
                 UsableSubnetworkSecondaryRange' <$>
                   (o .:? "status") <*> (o .:? "rangeName") <*>
                     (o .:? "ipCidrRange"))

instance ToJSON UsableSubnetworkSecondaryRange where
        toJSON UsableSubnetworkSecondaryRange'{..}
          = object
              (catMaybes
                 [("status" .=) <$> _ussrStatus,
                  ("rangeName" .=) <$> _ussrRangeName,
                  ("ipCidrRange" .=) <$> _ussrIPCIdRRange])

-- | NodeManagement defines the set of node management services turned on for
-- the node pool.
--
-- /See:/ 'nodeManagement' smart constructor.
data NodeManagement =
  NodeManagement'
    { _nmAutoUpgrade    :: !(Maybe Bool)
    , _nmAutoRepair     :: !(Maybe Bool)
    , _nmUpgradeOptions :: !(Maybe AutoUpgradeOptions)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NodeManagement' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'nmAutoUpgrade'
--
-- * 'nmAutoRepair'
--
-- * 'nmUpgradeOptions'
nodeManagement
    :: NodeManagement
nodeManagement =
  NodeManagement'
    { _nmAutoUpgrade = Nothing
    , _nmAutoRepair = Nothing
    , _nmUpgradeOptions = Nothing
    }


-- | A flag that specifies whether node auto-upgrade is enabled for the node
-- pool. If enabled, node auto-upgrade helps keep the nodes in your node
-- pool up to date with the latest release version of Kubernetes.
nmAutoUpgrade :: Lens' NodeManagement (Maybe Bool)
nmAutoUpgrade
  = lens _nmAutoUpgrade
      (\ s a -> s{_nmAutoUpgrade = a})

-- | A flag that specifies whether the node auto-repair is enabled for the
-- node pool. If enabled, the nodes in this node pool will be monitored
-- and, if they fail health checks too many times, an automatic repair
-- action will be triggered.
nmAutoRepair :: Lens' NodeManagement (Maybe Bool)
nmAutoRepair
  = lens _nmAutoRepair (\ s a -> s{_nmAutoRepair = a})

-- | Specifies the Auto Upgrade knobs for the node pool.
nmUpgradeOptions :: Lens' NodeManagement (Maybe AutoUpgradeOptions)
nmUpgradeOptions
  = lens _nmUpgradeOptions
      (\ s a -> s{_nmUpgradeOptions = a})

instance FromJSON NodeManagement where
        parseJSON
          = withObject "NodeManagement"
              (\ o ->
                 NodeManagement' <$>
                   (o .:? "autoUpgrade") <*> (o .:? "autoRepair") <*>
                     (o .:? "upgradeOptions"))

instance ToJSON NodeManagement where
        toJSON NodeManagement'{..}
          = object
              (catMaybes
                 [("autoUpgrade" .=) <$> _nmAutoUpgrade,
                  ("autoRepair" .=) <$> _nmAutoRepair,
                  ("upgradeOptions" .=) <$> _nmUpgradeOptions])

-- | Kubernetes taint is comprised of three fields: key, value, and effect.
-- Effect can only be one of three types: NoSchedule, PreferNoSchedule or
-- NoExecute. For more information, including usage and the valid values,
-- see:
-- https:\/\/kubernetes.io\/docs\/concepts\/configuration\/taint-and-toleration\/
--
-- /See:/ 'nodeTaint' smart constructor.
data NodeTaint =
  NodeTaint'
    { _ntEffect :: !(Maybe NodeTaintEffect)
    , _ntValue  :: !(Maybe Text)
    , _ntKey    :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NodeTaint' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ntEffect'
--
-- * 'ntValue'
--
-- * 'ntKey'
nodeTaint
    :: NodeTaint
nodeTaint =
  NodeTaint' {_ntEffect = Nothing, _ntValue = Nothing, _ntKey = Nothing}


-- | Effect for taint.
ntEffect :: Lens' NodeTaint (Maybe NodeTaintEffect)
ntEffect = lens _ntEffect (\ s a -> s{_ntEffect = a})

-- | Value for taint.
ntValue :: Lens' NodeTaint (Maybe Text)
ntValue = lens _ntValue (\ s a -> s{_ntValue = a})

-- | Key for taint.
ntKey :: Lens' NodeTaint (Maybe Text)
ntKey = lens _ntKey (\ s a -> s{_ntKey = a})

instance FromJSON NodeTaint where
        parseJSON
          = withObject "NodeTaint"
              (\ o ->
                 NodeTaint' <$>
                   (o .:? "effect") <*> (o .:? "value") <*>
                     (o .:? "key"))

instance ToJSON NodeTaint where
        toJSON NodeTaint'{..}
          = object
              (catMaybes
                 [("effect" .=) <$> _ntEffect,
                  ("value" .=) <$> _ntValue, ("key" .=) <$> _ntKey])

-- | NodePoolAutoscaling contains information required by cluster autoscaler
-- to adjust the size of the node pool to the current cluster usage.
--
-- /See:/ 'nodePoolAutoscaling' smart constructor.
data NodePoolAutoscaling =
  NodePoolAutoscaling'
    { _npaMaxNodeCount :: !(Maybe (Textual Int32))
    , _npaEnabled      :: !(Maybe Bool)
    , _npaMinNodeCount :: !(Maybe (Textual Int32))
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NodePoolAutoscaling' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'npaMaxNodeCount'
--
-- * 'npaEnabled'
--
-- * 'npaMinNodeCount'
nodePoolAutoscaling
    :: NodePoolAutoscaling
nodePoolAutoscaling =
  NodePoolAutoscaling'
    { _npaMaxNodeCount = Nothing
    , _npaEnabled = Nothing
    , _npaMinNodeCount = Nothing
    }


-- | Maximum number of nodes in the NodePool. Must be >= min_node_count.
-- There has to enough quota to scale up the cluster.
npaMaxNodeCount :: Lens' NodePoolAutoscaling (Maybe Int32)
npaMaxNodeCount
  = lens _npaMaxNodeCount
      (\ s a -> s{_npaMaxNodeCount = a})
      . mapping _Coerce

-- | Is autoscaling enabled for this node pool.
npaEnabled :: Lens' NodePoolAutoscaling (Maybe Bool)
npaEnabled
  = lens _npaEnabled (\ s a -> s{_npaEnabled = a})

-- | Minimum number of nodes in the NodePool. Must be >= 1 and \<=
-- max_node_count.
npaMinNodeCount :: Lens' NodePoolAutoscaling (Maybe Int32)
npaMinNodeCount
  = lens _npaMinNodeCount
      (\ s a -> s{_npaMinNodeCount = a})
      . mapping _Coerce

instance FromJSON NodePoolAutoscaling where
        parseJSON
          = withObject "NodePoolAutoscaling"
              (\ o ->
                 NodePoolAutoscaling' <$>
                   (o .:? "maxNodeCount") <*> (o .:? "enabled") <*>
                     (o .:? "minNodeCount"))

instance ToJSON NodePoolAutoscaling where
        toJSON NodePoolAutoscaling'{..}
          = object
              (catMaybes
                 [("maxNodeCount" .=) <$> _npaMaxNodeCount,
                  ("enabled" .=) <$> _npaEnabled,
                  ("minNodeCount" .=) <$> _npaMinNodeCount])

-- | SetMaintenancePolicyRequest sets the maintenance policy for a cluster.
--
-- /See:/ 'setMaintenancePolicyRequest' smart constructor.
data SetMaintenancePolicyRequest =
  SetMaintenancePolicyRequest'
    { _smprZone              :: !(Maybe Text)
    , _smprName              :: !(Maybe Text)
    , _smprClusterId         :: !(Maybe Text)
    , _smprMaintenancePolicy :: !(Maybe MaintenancePolicy)
    , _smprProjectId         :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'SetMaintenancePolicyRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'smprZone'
--
-- * 'smprName'
--
-- * 'smprClusterId'
--
-- * 'smprMaintenancePolicy'
--
-- * 'smprProjectId'
setMaintenancePolicyRequest
    :: SetMaintenancePolicyRequest
setMaintenancePolicyRequest =
  SetMaintenancePolicyRequest'
    { _smprZone = Nothing
    , _smprName = Nothing
    , _smprClusterId = Nothing
    , _smprMaintenancePolicy = Nothing
    , _smprProjectId = Nothing
    }


-- | The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
smprZone :: Lens' SetMaintenancePolicyRequest (Maybe Text)
smprZone = lens _smprZone (\ s a -> s{_smprZone = a})

-- | The name (project, location, cluster id) of the cluster to set
-- maintenance policy. Specified in the format
-- \'projects\/*\/locations\/*\/clusters\/*\'.
smprName :: Lens' SetMaintenancePolicyRequest (Maybe Text)
smprName = lens _smprName (\ s a -> s{_smprName = a})

-- | The name of the cluster to update.
smprClusterId :: Lens' SetMaintenancePolicyRequest (Maybe Text)
smprClusterId
  = lens _smprClusterId
      (\ s a -> s{_smprClusterId = a})

-- | The maintenance policy to be set for the cluster. An empty field clears
-- the existing maintenance policy.
smprMaintenancePolicy :: Lens' SetMaintenancePolicyRequest (Maybe MaintenancePolicy)
smprMaintenancePolicy
  = lens _smprMaintenancePolicy
      (\ s a -> s{_smprMaintenancePolicy = a})

-- | The Google Developers Console [project ID or project
-- number](https:\/\/support.google.com\/cloud\/answer\/6158840).
smprProjectId :: Lens' SetMaintenancePolicyRequest (Maybe Text)
smprProjectId
  = lens _smprProjectId
      (\ s a -> s{_smprProjectId = a})

instance FromJSON SetMaintenancePolicyRequest where
        parseJSON
          = withObject "SetMaintenancePolicyRequest"
              (\ o ->
                 SetMaintenancePolicyRequest' <$>
                   (o .:? "zone") <*> (o .:? "name") <*>
                     (o .:? "clusterId")
                     <*> (o .:? "maintenancePolicy")
                     <*> (o .:? "projectId"))

instance ToJSON SetMaintenancePolicyRequest where
        toJSON SetMaintenancePolicyRequest'{..}
          = object
              (catMaybes
                 [("zone" .=) <$> _smprZone,
                  ("name" .=) <$> _smprName,
                  ("clusterId" .=) <$> _smprClusterId,
                  ("maintenancePolicy" .=) <$> _smprMaintenancePolicy,
                  ("projectId" .=) <$> _smprProjectId])

-- | UsableSubnetwork resource returns the subnetwork name, its associated
-- network and the primary CIDR range.
--
-- /See:/ 'usableSubnetwork' smart constructor.
data UsableSubnetwork =
  UsableSubnetwork'
    { _usNetwork           :: !(Maybe Text)
    , _usStatusMessage     :: !(Maybe Text)
    , _usSecondaryIPRanges :: !(Maybe [UsableSubnetworkSecondaryRange])
    , _usIPCIdRRange       :: !(Maybe Text)
    , _usSubnetwork        :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'UsableSubnetwork' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'usNetwork'
--
-- * 'usStatusMessage'
--
-- * 'usSecondaryIPRanges'
--
-- * 'usIPCIdRRange'
--
-- * 'usSubnetwork'
usableSubnetwork
    :: UsableSubnetwork
usableSubnetwork =
  UsableSubnetwork'
    { _usNetwork = Nothing
    , _usStatusMessage = Nothing
    , _usSecondaryIPRanges = Nothing
    , _usIPCIdRRange = Nothing
    , _usSubnetwork = Nothing
    }


-- | Network Name. Example:
-- projects\/my-project\/global\/networks\/my-network
usNetwork :: Lens' UsableSubnetwork (Maybe Text)
usNetwork
  = lens _usNetwork (\ s a -> s{_usNetwork = a})

-- | A human readable status message representing the reasons for cases where
-- the caller cannot use the secondary ranges under the subnet. For example
-- if the secondary_ip_ranges is empty due to a permission issue, an
-- insufficient permission message will be given by status_message.
usStatusMessage :: Lens' UsableSubnetwork (Maybe Text)
usStatusMessage
  = lens _usStatusMessage
      (\ s a -> s{_usStatusMessage = a})

-- | Secondary IP ranges.
usSecondaryIPRanges :: Lens' UsableSubnetwork [UsableSubnetworkSecondaryRange]
usSecondaryIPRanges
  = lens _usSecondaryIPRanges
      (\ s a -> s{_usSecondaryIPRanges = a})
      . _Default
      . _Coerce

-- | The range of internal addresses that are owned by this subnetwork.
usIPCIdRRange :: Lens' UsableSubnetwork (Maybe Text)
usIPCIdRRange
  = lens _usIPCIdRRange
      (\ s a -> s{_usIPCIdRRange = a})

-- | Subnetwork Name. Example:
-- projects\/my-project\/regions\/us-central1\/subnetworks\/my-subnet
usSubnetwork :: Lens' UsableSubnetwork (Maybe Text)
usSubnetwork
  = lens _usSubnetwork (\ s a -> s{_usSubnetwork = a})

instance FromJSON UsableSubnetwork where
        parseJSON
          = withObject "UsableSubnetwork"
              (\ o ->
                 UsableSubnetwork' <$>
                   (o .:? "network") <*> (o .:? "statusMessage") <*>
                     (o .:? "secondaryIpRanges" .!= mempty)
                     <*> (o .:? "ipCidrRange")
                     <*> (o .:? "subnetwork"))

instance ToJSON UsableSubnetwork where
        toJSON UsableSubnetwork'{..}
          = object
              (catMaybes
                 [("network" .=) <$> _usNetwork,
                  ("statusMessage" .=) <$> _usStatusMessage,
                  ("secondaryIpRanges" .=) <$> _usSecondaryIPRanges,
                  ("ipCidrRange" .=) <$> _usIPCIdRRange,
                  ("subnetwork" .=) <$> _usSubnetwork])

-- | Configuration for the Kubernetes Dashboard.
--
-- /See:/ 'kubernetesDashboard' smart constructor.
newtype KubernetesDashboard =
  KubernetesDashboard'
    { _kdDisabled :: Maybe Bool
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'KubernetesDashboard' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'kdDisabled'
kubernetesDashboard
    :: KubernetesDashboard
kubernetesDashboard = KubernetesDashboard' {_kdDisabled = Nothing}


-- | Whether the Kubernetes Dashboard is enabled for this cluster.
kdDisabled :: Lens' KubernetesDashboard (Maybe Bool)
kdDisabled
  = lens _kdDisabled (\ s a -> s{_kdDisabled = a})

instance FromJSON KubernetesDashboard where
        parseJSON
          = withObject "KubernetesDashboard"
              (\ o -> KubernetesDashboard' <$> (o .:? "disabled"))

instance ToJSON KubernetesDashboard where
        toJSON KubernetesDashboard'{..}
          = object
              (catMaybes [("disabled" .=) <$> _kdDisabled])

-- | Configuration for client certificates on the cluster.
--
-- /See:/ 'clientCertificateConfig' smart constructor.
newtype ClientCertificateConfig =
  ClientCertificateConfig'
    { _cccIssueClientCertificate :: Maybe Bool
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'ClientCertificateConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cccIssueClientCertificate'
clientCertificateConfig
    :: ClientCertificateConfig
clientCertificateConfig =
  ClientCertificateConfig' {_cccIssueClientCertificate = Nothing}


-- | Issue a client certificate.
cccIssueClientCertificate :: Lens' ClientCertificateConfig (Maybe Bool)
cccIssueClientCertificate
  = lens _cccIssueClientCertificate
      (\ s a -> s{_cccIssueClientCertificate = a})

instance FromJSON ClientCertificateConfig where
        parseJSON
          = withObject "ClientCertificateConfig"
              (\ o ->
                 ClientCertificateConfig' <$>
                   (o .:? "issueClientCertificate"))

instance ToJSON ClientCertificateConfig where
        toJSON ClientCertificateConfig'{..}
          = object
              (catMaybes
                 [("issueClientCertificate" .=) <$>
                    _cccIssueClientCertificate])

-- | SetLabelsRequest sets the Google Cloud Platform labels on a Google
-- Container Engine cluster, which will in turn set them for Google Compute
-- Engine resources used by that cluster
--
-- /See:/ 'setLabelsRequest' smart constructor.
data SetLabelsRequest =
  SetLabelsRequest'
    { _slrResourceLabels   :: !(Maybe SetLabelsRequestResourceLabels)
    , _slrZone             :: !(Maybe Text)
    , _slrName             :: !(Maybe Text)
    , _slrClusterId        :: !(Maybe Text)
    , _slrProjectId        :: !(Maybe Text)
    , _slrLabelFingerprint :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'SetLabelsRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'slrResourceLabels'
--
-- * 'slrZone'
--
-- * 'slrName'
--
-- * 'slrClusterId'
--
-- * 'slrProjectId'
--
-- * 'slrLabelFingerprint'
setLabelsRequest
    :: SetLabelsRequest
setLabelsRequest =
  SetLabelsRequest'
    { _slrResourceLabels = Nothing
    , _slrZone = Nothing
    , _slrName = Nothing
    , _slrClusterId = Nothing
    , _slrProjectId = Nothing
    , _slrLabelFingerprint = Nothing
    }


-- | The labels to set for that cluster.
slrResourceLabels :: Lens' SetLabelsRequest (Maybe SetLabelsRequestResourceLabels)
slrResourceLabels
  = lens _slrResourceLabels
      (\ s a -> s{_slrResourceLabels = a})

-- | Deprecated. The name of the Google Compute Engine
-- [zone](\/compute\/docs\/zones#available) in which the cluster resides.
-- This field has been deprecated and replaced by the name field.
slrZone :: Lens' SetLabelsRequest (Maybe Text)
slrZone = lens _slrZone (\ s a -> s{_slrZone = a})

-- | The name (project, location, cluster id) of the cluster to set labels.
-- Specified in the format \'projects\/*\/locations\/*\/clusters\/*\'.
slrName :: Lens' SetLabelsRequest (Maybe Text)
slrName = lens _slrName (\ s a -> s{_slrName = a})

-- | Deprecated. The name of the cluster. This field has been deprecated and
-- replaced by the name field.
slrClusterId :: Lens' SetLabelsRequest (Maybe Text)
slrClusterId
  = lens _slrClusterId (\ s a -> s{_slrClusterId = a})

-- | Deprecated. The Google Developers Console [project ID or project
-- number](https:\/\/developers.google.com\/console\/help\/new\/#projectnumber).
-- This field has been deprecated and replaced by the name field.
slrProjectId :: Lens' SetLabelsRequest (Maybe Text)
slrProjectId
  = lens _slrProjectId (\ s a -> s{_slrProjectId = a})

-- | The fingerprint of the previous set of labels for this resource, used to
-- detect conflicts. The fingerprint is initially generated by Kubernetes
-- Engine and changes after every request to modify or update labels. You
-- must always provide an up-to-date fingerprint hash when updating or
-- changing labels. Make a 'get()' request to the resource to get the
-- latest fingerprint.
slrLabelFingerprint :: Lens' SetLabelsRequest (Maybe Text)
slrLabelFingerprint
  = lens _slrLabelFingerprint
      (\ s a -> s{_slrLabelFingerprint = a})

instance FromJSON SetLabelsRequest where
        parseJSON
          = withObject "SetLabelsRequest"
              (\ o ->
                 SetLabelsRequest' <$>
                   (o .:? "resourceLabels") <*> (o .:? "zone") <*>
                     (o .:? "name")
                     <*> (o .:? "clusterId")
                     <*> (o .:? "projectId")
                     <*> (o .:? "labelFingerprint"))

instance ToJSON SetLabelsRequest where
        toJSON SetLabelsRequest'{..}
          = object
              (catMaybes
                 [("resourceLabels" .=) <$> _slrResourceLabels,
                  ("zone" .=) <$> _slrZone, ("name" .=) <$> _slrName,
                  ("clusterId" .=) <$> _slrClusterId,
                  ("projectId" .=) <$> _slrProjectId,
                  ("labelFingerprint" .=) <$> _slrLabelFingerprint])

-- | GetOpenIDConfigResponse is an OIDC discovery document for the cluster.
-- See the OpenID Connect Discovery 1.0 specification for details.
--
-- /See:/ 'getOpenIdConfigResponse' smart constructor.
data GetOpenIdConfigResponse =
  GetOpenIdConfigResponse'
    { _goicrIdTokenSigningAlgValuesSupported :: !(Maybe [Text])
    , _goicrResponseTypesSupported           :: !(Maybe [Text])
    , _goicrJWKsURI                          :: !(Maybe Text)
    , _goicrGrantTypes                       :: !(Maybe [Text])
    , _goicrClaimsSupported                  :: !(Maybe [Text])
    , _goicrIssuer                           :: !(Maybe Text)
    , _goicrSubjectTypesSupported            :: !(Maybe [Text])
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'GetOpenIdConfigResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'goicrIdTokenSigningAlgValuesSupported'
--
-- * 'goicrResponseTypesSupported'
--
-- * 'goicrJWKsURI'
--
-- * 'goicrGrantTypes'
--
-- * 'goicrClaimsSupported'
--
-- * 'goicrIssuer'
--
-- * 'goicrSubjectTypesSupported'
getOpenIdConfigResponse
    :: GetOpenIdConfigResponse
getOpenIdConfigResponse =
  GetOpenIdConfigResponse'
    { _goicrIdTokenSigningAlgValuesSupported = Nothing
    , _goicrResponseTypesSupported = Nothing
    , _goicrJWKsURI = Nothing
    , _goicrGrantTypes = Nothing
    , _goicrClaimsSupported = Nothing
    , _goicrIssuer = Nothing
    , _goicrSubjectTypesSupported = Nothing
    }


-- | NOLINT
goicrIdTokenSigningAlgValuesSupported :: Lens' GetOpenIdConfigResponse [Text]
goicrIdTokenSigningAlgValuesSupported
  = lens _goicrIdTokenSigningAlgValuesSupported
      (\ s a ->
         s{_goicrIdTokenSigningAlgValuesSupported = a})
      . _Default
      . _Coerce

-- | NOLINT
goicrResponseTypesSupported :: Lens' GetOpenIdConfigResponse [Text]
goicrResponseTypesSupported
  = lens _goicrResponseTypesSupported
      (\ s a -> s{_goicrResponseTypesSupported = a})
      . _Default
      . _Coerce

-- | NOLINT
goicrJWKsURI :: Lens' GetOpenIdConfigResponse (Maybe Text)
goicrJWKsURI
  = lens _goicrJWKsURI (\ s a -> s{_goicrJWKsURI = a})

-- | NOLINT
goicrGrantTypes :: Lens' GetOpenIdConfigResponse [Text]
goicrGrantTypes
  = lens _goicrGrantTypes
      (\ s a -> s{_goicrGrantTypes = a})
      . _Default
      . _Coerce

-- | NOLINT
goicrClaimsSupported :: Lens' GetOpenIdConfigResponse [Text]
goicrClaimsSupported
  = lens _goicrClaimsSupported
      (\ s a -> s{_goicrClaimsSupported = a})
      . _Default
      . _Coerce

-- | NOLINT
goicrIssuer :: Lens' GetOpenIdConfigResponse (Maybe Text)
goicrIssuer
  = lens _goicrIssuer (\ s a -> s{_goicrIssuer = a})

-- | NOLINT
goicrSubjectTypesSupported :: Lens' GetOpenIdConfigResponse [Text]
goicrSubjectTypesSupported
  = lens _goicrSubjectTypesSupported
      (\ s a -> s{_goicrSubjectTypesSupported = a})
      . _Default
      . _Coerce

instance FromJSON GetOpenIdConfigResponse where
        parseJSON
          = withObject "GetOpenIdConfigResponse"
              (\ o ->
                 GetOpenIdConfigResponse' <$>
                   (o .:? "id_token_signing_alg_values_supported" .!=
                      mempty)
                     <*> (o .:? "response_types_supported" .!= mempty)
                     <*> (o .:? "jwks_uri")
                     <*> (o .:? "grant_types" .!= mempty)
                     <*> (o .:? "claims_supported" .!= mempty)
                     <*> (o .:? "issuer")
                     <*> (o .:? "subject_types_supported" .!= mempty))

instance ToJSON GetOpenIdConfigResponse where
        toJSON GetOpenIdConfigResponse'{..}
          = object
              (catMaybes
                 [("id_token_signing_alg_values_supported" .=) <$>
                    _goicrIdTokenSigningAlgValuesSupported,
                  ("response_types_supported" .=) <$>
                    _goicrResponseTypesSupported,
                  ("jwks_uri" .=) <$> _goicrJWKsURI,
                  ("grant_types" .=) <$> _goicrGrantTypes,
                  ("claims_supported" .=) <$> _goicrClaimsSupported,
                  ("issuer" .=) <$> _goicrIssuer,
                  ("subject_types_supported" .=) <$>
                    _goicrSubjectTypesSupported])

-- | Jwk is a JSON Web Key as specified in RFC 7517
--
-- /See:/ 'jwk' smart constructor.
data JWK =
  JWK'
    { _jCrv :: !(Maybe Text)
    , _jAlg :: !(Maybe Text)
    , _jUse :: !(Maybe Text)
    , _jKid :: !(Maybe Text)
    , _jN   :: !(Maybe Text)
    , _jE   :: !(Maybe Text)
    , _jX   :: !(Maybe Text)
    , _jKty :: !(Maybe Text)
    , _jY   :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'JWK' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'jCrv'
--
-- * 'jAlg'
--
-- * 'jUse'
--
-- * 'jKid'
--
-- * 'jN'
--
-- * 'jE'
--
-- * 'jX'
--
-- * 'jKty'
--
-- * 'jY'
jwk
    :: JWK
jwk =
  JWK'
    { _jCrv = Nothing
    , _jAlg = Nothing
    , _jUse = Nothing
    , _jKid = Nothing
    , _jN = Nothing
    , _jE = Nothing
    , _jX = Nothing
    , _jKty = Nothing
    , _jY = Nothing
    }


-- | NOLINT
jCrv :: Lens' JWK (Maybe Text)
jCrv = lens _jCrv (\ s a -> s{_jCrv = a})

-- | NOLINT
jAlg :: Lens' JWK (Maybe Text)
jAlg = lens _jAlg (\ s a -> s{_jAlg = a})

-- | NOLINT
jUse :: Lens' JWK (Maybe Text)
jUse = lens _jUse (\ s a -> s{_jUse = a})

-- | NOLINT
jKid :: Lens' JWK (Maybe Text)
jKid = lens _jKid (\ s a -> s{_jKid = a})

-- | Fields for RSA keys. NOLINT
jN :: Lens' JWK (Maybe Text)
jN = lens _jN (\ s a -> s{_jN = a})

-- | NOLINT
jE :: Lens' JWK (Maybe Text)
jE = lens _jE (\ s a -> s{_jE = a})

-- | Fields for ECDSA keys. NOLINT
jX :: Lens' JWK (Maybe Text)
jX = lens _jX (\ s a -> s{_jX = a})

-- | NOLINT
jKty :: Lens' JWK (Maybe Text)
jKty = lens _jKty (\ s a -> s{_jKty = a})

-- | NOLINT
jY :: Lens' JWK (Maybe Text)
jY = lens _jY (\ s a -> s{_jY = a})

instance FromJSON JWK where
        parseJSON
          = withObject "JWK"
              (\ o ->
                 JWK' <$>
                   (o .:? "crv") <*> (o .:? "alg") <*> (o .:? "use") <*>
                     (o .:? "kid")
                     <*> (o .:? "n")
                     <*> (o .:? "e")
                     <*> (o .:? "x")
                     <*> (o .:? "kty")
                     <*> (o .:? "y"))

instance ToJSON JWK where
        toJSON JWK'{..}
          = object
              (catMaybes
                 [("crv" .=) <$> _jCrv, ("alg" .=) <$> _jAlg,
                  ("use" .=) <$> _jUse, ("kid" .=) <$> _jKid,
                  ("n" .=) <$> _jN, ("e" .=) <$> _jE, ("x" .=) <$> _jX,
                  ("kty" .=) <$> _jKty, ("y" .=) <$> _jY])

-- | MaintenanceWindow defines the maintenance window to be used for the
-- cluster.
--
-- /See:/ 'maintenanceWindow' smart constructor.
newtype MaintenanceWindow =
  MaintenanceWindow'
    { _mwDailyMaintenanceWindow :: Maybe DailyMaintenanceWindow
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'MaintenanceWindow' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mwDailyMaintenanceWindow'
maintenanceWindow
    :: MaintenanceWindow
maintenanceWindow = MaintenanceWindow' {_mwDailyMaintenanceWindow = Nothing}


-- | DailyMaintenanceWindow specifies a daily maintenance operation window.
mwDailyMaintenanceWindow :: Lens' MaintenanceWindow (Maybe DailyMaintenanceWindow)
mwDailyMaintenanceWindow
  = lens _mwDailyMaintenanceWindow
      (\ s a -> s{_mwDailyMaintenanceWindow = a})

instance FromJSON MaintenanceWindow where
        parseJSON
          = withObject "MaintenanceWindow"
              (\ o ->
                 MaintenanceWindow' <$>
                   (o .:? "dailyMaintenanceWindow"))

instance ToJSON MaintenanceWindow where
        toJSON MaintenanceWindow'{..}
          = object
              (catMaybes
                 [("dailyMaintenanceWindow" .=) <$>
                    _mwDailyMaintenanceWindow])

-- | Constraints applied to pods.
--
-- /See:/ 'maxPodsConstraint' smart constructor.
newtype MaxPodsConstraint =
  MaxPodsConstraint'
    { _mpcMaxPodsPerNode :: Maybe (Textual Int64)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'MaxPodsConstraint' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'mpcMaxPodsPerNode'
maxPodsConstraint
    :: MaxPodsConstraint
maxPodsConstraint = MaxPodsConstraint' {_mpcMaxPodsPerNode = Nothing}


-- | Constraint enforced on the max num of pods per node.
mpcMaxPodsPerNode :: Lens' MaxPodsConstraint (Maybe Int64)
mpcMaxPodsPerNode
  = lens _mpcMaxPodsPerNode
      (\ s a -> s{_mpcMaxPodsPerNode = a})
      . mapping _Coerce

instance FromJSON MaxPodsConstraint where
        parseJSON
          = withObject "MaxPodsConstraint"
              (\ o ->
                 MaxPodsConstraint' <$> (o .:? "maxPodsPerNode"))

instance ToJSON MaxPodsConstraint where
        toJSON MaxPodsConstraint'{..}
          = object
              (catMaybes
                 [("maxPodsPerNode" .=) <$> _mpcMaxPodsPerNode])

-- | Configuration for controlling how IPs are allocated in the cluster.
--
-- /See:/ 'ipAllocationPolicy' smart constructor.
data IPAllocationPolicy =
  IPAllocationPolicy'
    { _iapServicesSecondaryRangeName :: !(Maybe Text)
    , _iapTpuIPv4CIdRBlock           :: !(Maybe Text)
    , _iapNodeIPv4CIdR               :: !(Maybe Text)
    , _iapUseIPAliases               :: !(Maybe Bool)
    , _iapClusterIPv4CIdR            :: !(Maybe Text)
    , _iapSubnetworkName             :: !(Maybe Text)
    , _iapClusterSecondaryRangeName  :: !(Maybe Text)
    , _iapNodeIPv4CIdRBlock          :: !(Maybe Text)
    , _iapServicesIPv4CIdR           :: !(Maybe Text)
    , _iapClusterIPv4CIdRBlock       :: !(Maybe Text)
    , _iapServicesIPv4CIdRBlock      :: !(Maybe Text)
    , _iapCreateSubnetwork           :: !(Maybe Bool)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'IPAllocationPolicy' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iapServicesSecondaryRangeName'
--
-- * 'iapTpuIPv4CIdRBlock'
--
-- * 'iapNodeIPv4CIdR'
--
-- * 'iapUseIPAliases'
--
-- * 'iapClusterIPv4CIdR'
--
-- * 'iapSubnetworkName'
--
-- * 'iapClusterSecondaryRangeName'
--
-- * 'iapNodeIPv4CIdRBlock'
--
-- * 'iapServicesIPv4CIdR'
--
-- * 'iapClusterIPv4CIdRBlock'
--
-- * 'iapServicesIPv4CIdRBlock'
--
-- * 'iapCreateSubnetwork'
ipAllocationPolicy
    :: IPAllocationPolicy
ipAllocationPolicy =
  IPAllocationPolicy'
    { _iapServicesSecondaryRangeName = Nothing
    , _iapTpuIPv4CIdRBlock = Nothing
    , _iapNodeIPv4CIdR = Nothing
    , _iapUseIPAliases = Nothing
    , _iapClusterIPv4CIdR = Nothing
    , _iapSubnetworkName = Nothing
    , _iapClusterSecondaryRangeName = Nothing
    , _iapNodeIPv4CIdRBlock = Nothing
    , _iapServicesIPv4CIdR = Nothing
    , _iapClusterIPv4CIdRBlock = Nothing
    , _iapServicesIPv4CIdRBlock = Nothing
    , _iapCreateSubnetwork = Nothing
    }


-- | The name of the secondary range to be used as for the services CIDR
-- block. The secondary range will be used for service ClusterIPs. This
-- must be an existing secondary range associated with the cluster
-- subnetwork. This field is only applicable with use_ip_aliases is true
-- and create_subnetwork is false.
iapServicesSecondaryRangeName :: Lens' IPAllocationPolicy (Maybe Text)
iapServicesSecondaryRangeName
  = lens _iapServicesSecondaryRangeName
      (\ s a -> s{_iapServicesSecondaryRangeName = a})

-- | The IP address range of the Cloud TPUs in this cluster. If unspecified,
-- a range will be automatically chosen with the default size. This field
-- is only applicable when \`use_ip_aliases\` is true. If unspecified, the
-- range will use the default size. Set to \/netmask (e.g. \`\/14\`) to
-- have a range chosen with a specific netmask. Set to a
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`10.96.0.0\/14\`) from the RFC-1918 private networks
-- (e.g. \`10.0.0.0\/8\`, \`172.16.0.0\/12\`, \`192.168.0.0\/16\`) to pick
-- a specific range to use.
iapTpuIPv4CIdRBlock :: Lens' IPAllocationPolicy (Maybe Text)
iapTpuIPv4CIdRBlock
  = lens _iapTpuIPv4CIdRBlock
      (\ s a -> s{_iapTpuIPv4CIdRBlock = a})

-- | This field is deprecated, use node_ipv4_cidr_block.
iapNodeIPv4CIdR :: Lens' IPAllocationPolicy (Maybe Text)
iapNodeIPv4CIdR
  = lens _iapNodeIPv4CIdR
      (\ s a -> s{_iapNodeIPv4CIdR = a})

-- | Whether alias IPs will be used for pod IPs in the cluster.
iapUseIPAliases :: Lens' IPAllocationPolicy (Maybe Bool)
iapUseIPAliases
  = lens _iapUseIPAliases
      (\ s a -> s{_iapUseIPAliases = a})

-- | This field is deprecated, use cluster_ipv4_cidr_block.
iapClusterIPv4CIdR :: Lens' IPAllocationPolicy (Maybe Text)
iapClusterIPv4CIdR
  = lens _iapClusterIPv4CIdR
      (\ s a -> s{_iapClusterIPv4CIdR = a})

-- | A custom subnetwork name to be used if \`create_subnetwork\` is true. If
-- this field is empty, then an automatic name will be chosen for the new
-- subnetwork.
iapSubnetworkName :: Lens' IPAllocationPolicy (Maybe Text)
iapSubnetworkName
  = lens _iapSubnetworkName
      (\ s a -> s{_iapSubnetworkName = a})

-- | The name of the secondary range to be used for the cluster CIDR block.
-- The secondary range will be used for pod IP addresses. This must be an
-- existing secondary range associated with the cluster subnetwork. This
-- field is only applicable with use_ip_aliases is true and
-- create_subnetwork is false.
iapClusterSecondaryRangeName :: Lens' IPAllocationPolicy (Maybe Text)
iapClusterSecondaryRangeName
  = lens _iapClusterSecondaryRangeName
      (\ s a -> s{_iapClusterSecondaryRangeName = a})

-- | The IP address range of the instance IPs in this cluster. This is
-- applicable only if \`create_subnetwork\` is true. Set to blank to have a
-- range chosen with the default size. Set to \/netmask (e.g. \`\/14\`) to
-- have a range chosen with a specific netmask. Set to a
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`10.96.0.0\/14\`) from the RFC-1918 private networks
-- (e.g. \`10.0.0.0\/8\`, \`172.16.0.0\/12\`, \`192.168.0.0\/16\`) to pick
-- a specific range to use.
iapNodeIPv4CIdRBlock :: Lens' IPAllocationPolicy (Maybe Text)
iapNodeIPv4CIdRBlock
  = lens _iapNodeIPv4CIdRBlock
      (\ s a -> s{_iapNodeIPv4CIdRBlock = a})

-- | This field is deprecated, use services_ipv4_cidr_block.
iapServicesIPv4CIdR :: Lens' IPAllocationPolicy (Maybe Text)
iapServicesIPv4CIdR
  = lens _iapServicesIPv4CIdR
      (\ s a -> s{_iapServicesIPv4CIdR = a})

-- | The IP address range for the cluster pod IPs. If this field is set, then
-- \`cluster.cluster_ipv4_cidr\` must be left blank. This field is only
-- applicable when \`use_ip_aliases\` is true. Set to blank to have a range
-- chosen with the default size. Set to \/netmask (e.g. \`\/14\`) to have a
-- range chosen with a specific netmask. Set to a
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`10.96.0.0\/14\`) from the RFC-1918 private networks
-- (e.g. \`10.0.0.0\/8\`, \`172.16.0.0\/12\`, \`192.168.0.0\/16\`) to pick
-- a specific range to use.
iapClusterIPv4CIdRBlock :: Lens' IPAllocationPolicy (Maybe Text)
iapClusterIPv4CIdRBlock
  = lens _iapClusterIPv4CIdRBlock
      (\ s a -> s{_iapClusterIPv4CIdRBlock = a})

-- | The IP address range of the services IPs in this cluster. If blank, a
-- range will be automatically chosen with the default size. This field is
-- only applicable when \`use_ip_aliases\` is true. Set to blank to have a
-- range chosen with the default size. Set to \/netmask (e.g. \`\/14\`) to
-- have a range chosen with a specific netmask. Set to a
-- [CIDR](http:\/\/en.wikipedia.org\/wiki\/Classless_Inter-Domain_Routing)
-- notation (e.g. \`10.96.0.0\/14\`) from the RFC-1918 private networks
-- (e.g. \`10.0.0.0\/8\`, \`172.16.0.0\/12\`, \`192.168.0.0\/16\`) to pick
-- a specific range to use.
iapServicesIPv4CIdRBlock :: Lens' IPAllocationPolicy (Maybe Text)
iapServicesIPv4CIdRBlock
  = lens _iapServicesIPv4CIdRBlock
      (\ s a -> s{_iapServicesIPv4CIdRBlock = a})

-- | Whether a new subnetwork will be created automatically for the cluster.
-- This field is only applicable when \`use_ip_aliases\` is true.
iapCreateSubnetwork :: Lens' IPAllocationPolicy (Maybe Bool)
iapCreateSubnetwork
  = lens _iapCreateSubnetwork
      (\ s a -> s{_iapCreateSubnetwork = a})

instance FromJSON IPAllocationPolicy where
        parseJSON
          = withObject "IPAllocationPolicy"
              (\ o ->
                 IPAllocationPolicy' <$>
                   (o .:? "servicesSecondaryRangeName") <*>
                     (o .:? "tpuIpv4CidrBlock")
                     <*> (o .:? "nodeIpv4Cidr")
                     <*> (o .:? "useIpAliases")
                     <*> (o .:? "clusterIpv4Cidr")
                     <*> (o .:? "subnetworkName")
                     <*> (o .:? "clusterSecondaryRangeName")
                     <*> (o .:? "nodeIpv4CidrBlock")
                     <*> (o .:? "servicesIpv4Cidr")
                     <*> (o .:? "clusterIpv4CidrBlock")
                     <*> (o .:? "servicesIpv4CidrBlock")
                     <*> (o .:? "createSubnetwork"))

instance ToJSON IPAllocationPolicy where
        toJSON IPAllocationPolicy'{..}
          = object
              (catMaybes
                 [("servicesSecondaryRangeName" .=) <$>
                    _iapServicesSecondaryRangeName,
                  ("tpuIpv4CidrBlock" .=) <$> _iapTpuIPv4CIdRBlock,
                  ("nodeIpv4Cidr" .=) <$> _iapNodeIPv4CIdR,
                  ("useIpAliases" .=) <$> _iapUseIPAliases,
                  ("clusterIpv4Cidr" .=) <$> _iapClusterIPv4CIdR,
                  ("subnetworkName" .=) <$> _iapSubnetworkName,
                  ("clusterSecondaryRangeName" .=) <$>
                    _iapClusterSecondaryRangeName,
                  ("nodeIpv4CidrBlock" .=) <$> _iapNodeIPv4CIdRBlock,
                  ("servicesIpv4Cidr" .=) <$> _iapServicesIPv4CIdR,
                  ("clusterIpv4CidrBlock" .=) <$>
                    _iapClusterIPv4CIdRBlock,
                  ("servicesIpv4CidrBlock" .=) <$>
                    _iapServicesIPv4CIdRBlock,
                  ("createSubnetwork" .=) <$> _iapCreateSubnetwork])

-- | Configuration for the addons that can be automatically spun up in the
-- cluster, enabling additional functionality.
--
-- /See:/ 'addonsConfig' smart constructor.
data AddonsConfig =
  AddonsConfig'
    { _acNetworkPolicyConfig      :: !(Maybe NetworkPolicyConfig)
    , _acHorizontalPodAutoscaling :: !(Maybe HorizontalPodAutoscaling)
    , _acHTTPLoadBalancing        :: !(Maybe HTTPLoadBalancing)
    , _acKubernetesDashboard      :: !(Maybe KubernetesDashboard)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'AddonsConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'acNetworkPolicyConfig'
--
-- * 'acHorizontalPodAutoscaling'
--
-- * 'acHTTPLoadBalancing'
--
-- * 'acKubernetesDashboard'
addonsConfig
    :: AddonsConfig
addonsConfig =
  AddonsConfig'
    { _acNetworkPolicyConfig = Nothing
    , _acHorizontalPodAutoscaling = Nothing
    , _acHTTPLoadBalancing = Nothing
    , _acKubernetesDashboard = Nothing
    }


-- | Configuration for NetworkPolicy. This only tracks whether the addon is
-- enabled or not on the Master, it does not track whether network policy
-- is enabled for the nodes.
acNetworkPolicyConfig :: Lens' AddonsConfig (Maybe NetworkPolicyConfig)
acNetworkPolicyConfig
  = lens _acNetworkPolicyConfig
      (\ s a -> s{_acNetworkPolicyConfig = a})

-- | Configuration for the horizontal pod autoscaling feature, which
-- increases or decreases the number of replica pods a replication
-- controller has based on the resource usage of the existing pods.
acHorizontalPodAutoscaling :: Lens' AddonsConfig (Maybe HorizontalPodAutoscaling)
acHorizontalPodAutoscaling
  = lens _acHorizontalPodAutoscaling
      (\ s a -> s{_acHorizontalPodAutoscaling = a})

-- | Configuration for the HTTP (L7) load balancing controller addon, which
-- makes it easy to set up HTTP load balancers for services in a cluster.
acHTTPLoadBalancing :: Lens' AddonsConfig (Maybe HTTPLoadBalancing)
acHTTPLoadBalancing
  = lens _acHTTPLoadBalancing
      (\ s a -> s{_acHTTPLoadBalancing = a})

-- | Configuration for the Kubernetes Dashboard.
acKubernetesDashboard :: Lens' AddonsConfig (Maybe KubernetesDashboard)
acKubernetesDashboard
  = lens _acKubernetesDashboard
      (\ s a -> s{_acKubernetesDashboard = a})

instance FromJSON AddonsConfig where
        parseJSON
          = withObject "AddonsConfig"
              (\ o ->
                 AddonsConfig' <$>
                   (o .:? "networkPolicyConfig") <*>
                     (o .:? "horizontalPodAutoscaling")
                     <*> (o .:? "httpLoadBalancing")
                     <*> (o .:? "kubernetesDashboard"))

instance ToJSON AddonsConfig where
        toJSON AddonsConfig'{..}
          = object
              (catMaybes
                 [("networkPolicyConfig" .=) <$>
                    _acNetworkPolicyConfig,
                  ("horizontalPodAutoscaling" .=) <$>
                    _acHorizontalPodAutoscaling,
                  ("httpLoadBalancing" .=) <$> _acHTTPLoadBalancing,
                  ("kubernetesDashboard" .=) <$>
                    _acKubernetesDashboard])

-- | NetworkConfig reports the relative names of network & subnetwork.
--
-- /See:/ 'networkConfig' smart constructor.
data NetworkConfig =
  NetworkConfig'
    { _ncNetwork    :: !(Maybe Text)
    , _ncSubnetwork :: !(Maybe Text)
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NetworkConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ncNetwork'
--
-- * 'ncSubnetwork'
networkConfig
    :: NetworkConfig
networkConfig = NetworkConfig' {_ncNetwork = Nothing, _ncSubnetwork = Nothing}


-- | Output only. The relative name of the Google Compute Engine
-- network(\/compute\/docs\/networks-and-firewalls#networks) to which the
-- cluster is connected. Example:
-- projects\/my-project\/global\/networks\/my-network
ncNetwork :: Lens' NetworkConfig (Maybe Text)
ncNetwork
  = lens _ncNetwork (\ s a -> s{_ncNetwork = a})

-- | Output only. The relative name of the Google Compute Engine
-- [subnetwork](\/compute\/docs\/vpc) to which the cluster is connected.
-- Example:
-- projects\/my-project\/regions\/us-central1\/subnetworks\/my-subnet
ncSubnetwork :: Lens' NetworkConfig (Maybe Text)
ncSubnetwork
  = lens _ncSubnetwork (\ s a -> s{_ncSubnetwork = a})

instance FromJSON NetworkConfig where
        parseJSON
          = withObject "NetworkConfig"
              (\ o ->
                 NetworkConfig' <$>
                   (o .:? "network") <*> (o .:? "subnetwork"))

instance ToJSON NetworkConfig where
        toJSON NetworkConfig'{..}
          = object
              (catMaybes
                 [("network" .=) <$> _ncNetwork,
                  ("subnetwork" .=) <$> _ncSubnetwork])

-- | NodePool contains the name and configuration for a cluster\'s node pool.
-- Node pools are a set of nodes (i.e. VM\'s), with a common configuration
-- and specification, under the control of the cluster master. They may
-- have a set of Kubernetes labels applied to them, which may be used to
-- reference them during pod scheduling. They may also be resized up or
-- down, to accommodate the workload.
--
-- /See:/ 'nodePool' smart constructor.
data NodePool =
  NodePool'
    { _npStatus            :: !(Maybe NodePoolStatus)
    , _npAutoscaling       :: !(Maybe NodePoolAutoscaling)
    , _npConfig            :: !(Maybe NodeConfig)
    , _npInitialNodeCount  :: !(Maybe (Textual Int32))
    , _npManagement        :: !(Maybe NodeManagement)
    , _npMaxPodsConstraint :: !(Maybe MaxPodsConstraint)
    , _npSelfLink          :: !(Maybe Text)
    , _npName              :: !(Maybe Text)
    , _npStatusMessage     :: !(Maybe Text)
    , _npVersion           :: !(Maybe Text)
    , _npConditions        :: !(Maybe [StatusCondition])
    , _npInstanceGroupURLs :: !(Maybe [Text])
    }
  deriving (Eq, Show, Data, Typeable, Generic)


-- | Creates a value of 'NodePool' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'npStatus'
--
-- * 'npAutoscaling'
--
-- * 'npConfig'
--
-- * 'npInitialNodeCount'
--
-- * 'npManagement'
--
-- * 'npMaxPodsConstraint'
--
-- * 'npSelfLink'
--
-- * 'npName'
--
-- * 'npStatusMessage'
--
-- * 'npVersion'
--
-- * 'npConditions'
--
-- * 'npInstanceGroupURLs'
nodePool
    :: NodePool
nodePool =
  NodePool'
    { _npStatus = Nothing
    , _npAutoscaling = Nothing
    , _npConfig = Nothing
    , _npInitialNodeCount = Nothing
    , _npManagement = Nothing
    , _npMaxPodsConstraint = Nothing
    , _npSelfLink = Nothing
    , _npName = Nothing
    , _npStatusMessage = Nothing
    , _npVersion = Nothing
    , _npConditions = Nothing
    , _npInstanceGroupURLs = Nothing
    }


-- | [Output only] The status of the nodes in this pool instance.
npStatus :: Lens' NodePool (Maybe NodePoolStatus)
npStatus = lens _npStatus (\ s a -> s{_npStatus = a})

-- | Autoscaler configuration for this NodePool. Autoscaler is enabled only
-- if a valid configuration is present.
npAutoscaling :: Lens' NodePool (Maybe NodePoolAutoscaling)
npAutoscaling
  = lens _npAutoscaling
      (\ s a -> s{_npAutoscaling = a})

-- | The node configuration of the pool.
npConfig :: Lens' NodePool (Maybe NodeConfig)
npConfig = lens _npConfig (\ s a -> s{_npConfig = a})

-- | The initial node count for the pool. You must ensure that your Compute
-- Engine </compute/docs/resource-quotas resource quota> is sufficient for
-- this number of instances. You must also have available firewall and
-- routes quota.
npInitialNodeCount :: Lens' NodePool (Maybe Int32)
npInitialNodeCount
  = lens _npInitialNodeCount
      (\ s a -> s{_npInitialNodeCount = a})
      . mapping _Coerce

-- | NodeManagement configuration for this NodePool.
npManagement :: Lens' NodePool (Maybe NodeManagement)
npManagement
  = lens _npManagement (\ s a -> s{_npManagement = a})

-- | The constraint on the maximum number of pods that can be run
-- simultaneously on a node in the node pool.
npMaxPodsConstraint :: Lens' NodePool (Maybe MaxPodsConstraint)
npMaxPodsConstraint
  = lens _npMaxPodsConstraint
      (\ s a -> s{_npMaxPodsConstraint = a})

-- | [Output only] Server-defined URL for the resource.
npSelfLink :: Lens' NodePool (Maybe Text)
npSelfLink
  = lens _npSelfLink (\ s a -> s{_npSelfLink = a})

-- | The name of the node pool.
npName :: Lens' NodePool (Maybe Text)
npName = lens _npName (\ s a -> s{_npName = a})

-- | [Output only] Additional information about the current status of this
-- node pool instance, if available.
npStatusMessage :: Lens' NodePool (Maybe Text)
npStatusMessage
  = lens _npStatusMessage
      (\ s a -> s{_npStatusMessage = a})

-- | The version of the Kubernetes of this node.
npVersion :: Lens' NodePool (Maybe Text)
npVersion
  = lens _npVersion (\ s a -> s{_npVersion = a})

-- | Which conditions caused the current node pool state.
npConditions :: Lens' NodePool [StatusCondition]
npConditions
  = lens _npConditions (\ s a -> s{_npConditions = a})
      . _Default
      . _Coerce

-- | [Output only] The resource URLs of the [managed instance
-- groups](\/compute\/docs\/instance-groups\/creating-groups-of-managed-instances)
-- associated with this node pool.
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 .:? "autoscaling") <*>
                     (o .:? "config")
                     <*> (o .:? "initialNodeCount")
                     <*> (o .:? "management")
                     <*> (o .:? "maxPodsConstraint")
                     <*> (o .:? "selfLink")
                     <*> (o .:? "name")
                     <*> (o .:? "statusMessage")
                     <*> (o .:? "version")
                     <*> (o .:? "conditions" .!= mempty)
                     <*> (o .:? "instanceGroupUrls" .!= mempty))

instance ToJSON NodePool where
        toJSON NodePool'{..}
          = object
              (catMaybes
                 [("status" .=) <$> _npStatus,
                  ("autoscaling" .=) <$> _npAutoscaling,
                  ("config" .=) <$> _npConfig,
                  ("initialNodeCount" .=) <$> _npInitialNodeCount,
                  ("management" .=) <$> _npManagement,
                  ("maxPodsConstraint" .=) <$> _npMaxPodsConstraint,
                  ("selfLink" .=) <$> _npSelfLink,
                  ("name" .=) <$> _npName,
                  ("statusMessage" .=) <$> _npStatusMessage,
                  ("version" .=) <$> _npVersion,
                  ("conditions" .=) <$> _npConditions,
                  ("instanceGroupUrls" .=) <$> _npInstanceGroupURLs])

-- | SetNodePoolManagementRequest sets the node management properties of a
-- node pool.
--
-- /See:/ 'setNodePoolManagementRequest' smart constructor.
data SetNodePoolManagementRequest =
  SetNodePoolManagementRequest'
    { _snpmrManagement :: !(Maybe NodeManagement)
    ,