module Network.Google.Autoscaler.Types.Product where
import Network.Google.Autoscaler.Types.Sum
import Network.Google.Prelude
data OperationWarningsItemDataItem = OperationWarningsItemDataItem'
{ _owidiValue :: !(Maybe Text)
, _owidiKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
operationWarningsItemDataItem
:: OperationWarningsItemDataItem
operationWarningsItemDataItem =
OperationWarningsItemDataItem'
{ _owidiValue = Nothing
, _owidiKey = Nothing
}
owidiValue :: Lens' OperationWarningsItemDataItem (Maybe Text)
owidiValue
= lens _owidiValue (\ s a -> s{_owidiValue = a})
owidiKey :: Lens' OperationWarningsItemDataItem (Maybe Text)
owidiKey = lens _owidiKey (\ s a -> s{_owidiKey = a})
instance FromJSON OperationWarningsItemDataItem where
parseJSON
= withObject "OperationWarningsItemDataItem"
(\ o ->
OperationWarningsItemDataItem' <$>
(o .:? "value") <*> (o .:? "key"))
instance ToJSON OperationWarningsItemDataItem where
toJSON OperationWarningsItemDataItem'{..}
= object
(catMaybes
[("value" .=) <$> _owidiValue,
("key" .=) <$> _owidiKey])
data DeprecationStatus = DeprecationStatus'
{ _dsState :: !(Maybe Text)
, _dsDeleted :: !(Maybe Text)
, _dsReplacement :: !(Maybe Text)
, _dsObsolete :: !(Maybe Text)
, _dsDeprecated :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
deprecationStatus
:: DeprecationStatus
deprecationStatus =
DeprecationStatus'
{ _dsState = Nothing
, _dsDeleted = Nothing
, _dsReplacement = Nothing
, _dsObsolete = Nothing
, _dsDeprecated = Nothing
}
dsState :: Lens' DeprecationStatus (Maybe Text)
dsState = lens _dsState (\ s a -> s{_dsState = a})
dsDeleted :: Lens' DeprecationStatus (Maybe Text)
dsDeleted
= lens _dsDeleted (\ s a -> s{_dsDeleted = a})
dsReplacement :: Lens' DeprecationStatus (Maybe Text)
dsReplacement
= lens _dsReplacement
(\ s a -> s{_dsReplacement = a})
dsObsolete :: Lens' DeprecationStatus (Maybe Text)
dsObsolete
= lens _dsObsolete (\ s a -> s{_dsObsolete = a})
dsDeprecated :: Lens' DeprecationStatus (Maybe Text)
dsDeprecated
= lens _dsDeprecated (\ s a -> s{_dsDeprecated = a})
instance FromJSON DeprecationStatus where
parseJSON
= withObject "DeprecationStatus"
(\ o ->
DeprecationStatus' <$>
(o .:? "state") <*> (o .:? "deleted") <*>
(o .:? "replacement")
<*> (o .:? "obsolete")
<*> (o .:? "deprecated"))
instance ToJSON DeprecationStatus where
toJSON DeprecationStatus'{..}
= object
(catMaybes
[("state" .=) <$> _dsState,
("deleted" .=) <$> _dsDeleted,
("replacement" .=) <$> _dsReplacement,
("obsolete" .=) <$> _dsObsolete,
("deprecated" .=) <$> _dsDeprecated])
data AutoscalingPolicyCustomMetricUtilization = AutoscalingPolicyCustomMetricUtilization'
{ _apcmuUtilizationTarget :: !(Maybe (Textual Double))
, _apcmuMetric :: !(Maybe Text)
, _apcmuUtilizationTargetType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
autoscalingPolicyCustomMetricUtilization
:: AutoscalingPolicyCustomMetricUtilization
autoscalingPolicyCustomMetricUtilization =
AutoscalingPolicyCustomMetricUtilization'
{ _apcmuUtilizationTarget = Nothing
, _apcmuMetric = Nothing
, _apcmuUtilizationTargetType = Nothing
}
apcmuUtilizationTarget :: Lens' AutoscalingPolicyCustomMetricUtilization (Maybe Double)
apcmuUtilizationTarget
= lens _apcmuUtilizationTarget
(\ s a -> s{_apcmuUtilizationTarget = a})
. mapping _Coerce
apcmuMetric :: Lens' AutoscalingPolicyCustomMetricUtilization (Maybe Text)
apcmuMetric
= lens _apcmuMetric (\ s a -> s{_apcmuMetric = a})
apcmuUtilizationTargetType :: Lens' AutoscalingPolicyCustomMetricUtilization (Maybe Text)
apcmuUtilizationTargetType
= lens _apcmuUtilizationTargetType
(\ s a -> s{_apcmuUtilizationTargetType = a})
instance FromJSON
AutoscalingPolicyCustomMetricUtilization where
parseJSON
= withObject
"AutoscalingPolicyCustomMetricUtilization"
(\ o ->
AutoscalingPolicyCustomMetricUtilization' <$>
(o .:? "utilizationTarget") <*> (o .:? "metric") <*>
(o .:? "utilizationTargetType"))
instance ToJSON
AutoscalingPolicyCustomMetricUtilization where
toJSON AutoscalingPolicyCustomMetricUtilization'{..}
= object
(catMaybes
[("utilizationTarget" .=) <$>
_apcmuUtilizationTarget,
("metric" .=) <$> _apcmuMetric,
("utilizationTargetType" .=) <$>
_apcmuUtilizationTargetType])
data OperationList = OperationList'
{ _olNextPageToken :: !(Maybe Text)
, _olKind :: !Text
, _olItems :: !(Maybe [Operation])
, _olSelfLink :: !(Maybe Text)
, _olId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
operationList
:: OperationList
operationList =
OperationList'
{ _olNextPageToken = Nothing
, _olKind = "autoscaler#operationList"
, _olItems = Nothing
, _olSelfLink = Nothing
, _olId = Nothing
}
olNextPageToken :: Lens' OperationList (Maybe Text)
olNextPageToken
= lens _olNextPageToken
(\ s a -> s{_olNextPageToken = a})
olKind :: Lens' OperationList Text
olKind = lens _olKind (\ s a -> s{_olKind = a})
olItems :: Lens' OperationList [Operation]
olItems
= lens _olItems (\ s a -> s{_olItems = a}) . _Default
. _Coerce
olSelfLink :: Lens' OperationList (Maybe Text)
olSelfLink
= lens _olSelfLink (\ s a -> s{_olSelfLink = a})
olId :: Lens' OperationList (Maybe Text)
olId = lens _olId (\ s a -> s{_olId = a})
instance FromJSON OperationList where
parseJSON
= withObject "OperationList"
(\ o ->
OperationList' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "autoscaler#operationList")
<*> (o .:? "items" .!= mempty)
<*> (o .:? "selfLink")
<*> (o .:? "id"))
instance ToJSON OperationList where
toJSON OperationList'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _olNextPageToken,
Just ("kind" .= _olKind), ("items" .=) <$> _olItems,
("selfLink" .=) <$> _olSelfLink,
("id" .=) <$> _olId])
data Operation = Operation'
{ _oTargetId :: !(Maybe (Textual Word64))
, _oStatus :: !(Maybe Text)
, _oInsertTime :: !(Maybe Text)
, _oProgress :: !(Maybe (Textual Int32))
, _oStartTime :: !(Maybe Text)
, _oKind :: !Text
, _oError :: !(Maybe OperationError)
, _oHTTPErrorMessage :: !(Maybe Text)
, _oZone :: !(Maybe Text)
, _oWarnings :: !(Maybe [OperationWarningsItem])
, _oHTTPErrorStatusCode :: !(Maybe (Textual Int32))
, _oUser :: !(Maybe Text)
, _oSelfLink :: !(Maybe Text)
, _oName :: !(Maybe Text)
, _oStatusMessage :: !(Maybe Text)
, _oCreationTimestamp :: !(Maybe Text)
, _oEndTime :: !(Maybe Text)
, _oId :: !(Maybe (Textual Word64))
, _oOperationType :: !(Maybe Text)
, _oRegion :: !(Maybe Text)
, _oDescription :: !(Maybe Text)
, _oTargetLink :: !(Maybe Text)
, _oClientOperationId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
operation
:: Operation
operation =
Operation'
{ _oTargetId = Nothing
, _oStatus = Nothing
, _oInsertTime = Nothing
, _oProgress = Nothing
, _oStartTime = Nothing
, _oKind = "autoscaler#operation"
, _oError = Nothing
, _oHTTPErrorMessage = Nothing
, _oZone = Nothing
, _oWarnings = Nothing
, _oHTTPErrorStatusCode = Nothing
, _oUser = Nothing
, _oSelfLink = Nothing
, _oName = Nothing
, _oStatusMessage = Nothing
, _oCreationTimestamp = Nothing
, _oEndTime = Nothing
, _oId = Nothing
, _oOperationType = Nothing
, _oRegion = Nothing
, _oDescription = Nothing
, _oTargetLink = Nothing
, _oClientOperationId = Nothing
}
oTargetId :: Lens' Operation (Maybe Word64)
oTargetId
= lens _oTargetId (\ s a -> s{_oTargetId = a}) .
mapping _Coerce
oStatus :: Lens' Operation (Maybe Text)
oStatus = lens _oStatus (\ s a -> s{_oStatus = a})
oInsertTime :: Lens' Operation (Maybe Text)
oInsertTime
= lens _oInsertTime (\ s a -> s{_oInsertTime = a})
oProgress :: Lens' Operation (Maybe Int32)
oProgress
= lens _oProgress (\ s a -> s{_oProgress = a}) .
mapping _Coerce
oStartTime :: Lens' Operation (Maybe Text)
oStartTime
= lens _oStartTime (\ s a -> s{_oStartTime = a})
oKind :: Lens' Operation Text
oKind = lens _oKind (\ s a -> s{_oKind = a})
oError :: Lens' Operation (Maybe OperationError)
oError = lens _oError (\ s a -> s{_oError = a})
oHTTPErrorMessage :: Lens' Operation (Maybe Text)
oHTTPErrorMessage
= lens _oHTTPErrorMessage
(\ s a -> s{_oHTTPErrorMessage = a})
oZone :: Lens' Operation (Maybe Text)
oZone = lens _oZone (\ s a -> s{_oZone = a})
oWarnings :: Lens' Operation [OperationWarningsItem]
oWarnings
= lens _oWarnings (\ s a -> s{_oWarnings = a}) .
_Default
. _Coerce
oHTTPErrorStatusCode :: Lens' Operation (Maybe Int32)
oHTTPErrorStatusCode
= lens _oHTTPErrorStatusCode
(\ s a -> s{_oHTTPErrorStatusCode = a})
. mapping _Coerce
oUser :: Lens' Operation (Maybe Text)
oUser = lens _oUser (\ s a -> s{_oUser = a})
oSelfLink :: Lens' Operation (Maybe Text)
oSelfLink
= lens _oSelfLink (\ s a -> s{_oSelfLink = a})
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
oStatusMessage :: Lens' Operation (Maybe Text)
oStatusMessage
= lens _oStatusMessage
(\ s a -> s{_oStatusMessage = a})
oCreationTimestamp :: Lens' Operation (Maybe Text)
oCreationTimestamp
= lens _oCreationTimestamp
(\ s a -> s{_oCreationTimestamp = a})
oEndTime :: Lens' Operation (Maybe Text)
oEndTime = lens _oEndTime (\ s a -> s{_oEndTime = a})
oId :: Lens' Operation (Maybe Word64)
oId
= lens _oId (\ s a -> s{_oId = a}) . mapping _Coerce
oOperationType :: Lens' Operation (Maybe Text)
oOperationType
= lens _oOperationType
(\ s a -> s{_oOperationType = a})
oRegion :: Lens' Operation (Maybe Text)
oRegion = lens _oRegion (\ s a -> s{_oRegion = a})
oDescription :: Lens' Operation (Maybe Text)
oDescription
= lens _oDescription (\ s a -> s{_oDescription = a})
oTargetLink :: Lens' Operation (Maybe Text)
oTargetLink
= lens _oTargetLink (\ s a -> s{_oTargetLink = a})
oClientOperationId :: Lens' Operation (Maybe Text)
oClientOperationId
= lens _oClientOperationId
(\ s a -> s{_oClientOperationId = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "targetId") <*> (o .:? "status") <*>
(o .:? "insertTime")
<*> (o .:? "progress")
<*> (o .:? "startTime")
<*> (o .:? "kind" .!= "autoscaler#operation")
<*> (o .:? "error")
<*> (o .:? "httpErrorMessage")
<*> (o .:? "zone")
<*> (o .:? "warnings" .!= mempty)
<*> (o .:? "httpErrorStatusCode")
<*> (o .:? "user")
<*> (o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "statusMessage")
<*> (o .:? "creationTimestamp")
<*> (o .:? "endTime")
<*> (o .:? "id")
<*> (o .:? "operationType")
<*> (o .:? "region")
<*> (o .:? "description")
<*> (o .:? "targetLink")
<*> (o .:? "clientOperationId"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("targetId" .=) <$> _oTargetId,
("status" .=) <$> _oStatus,
("insertTime" .=) <$> _oInsertTime,
("progress" .=) <$> _oProgress,
("startTime" .=) <$> _oStartTime,
Just ("kind" .= _oKind), ("error" .=) <$> _oError,
("httpErrorMessage" .=) <$> _oHTTPErrorMessage,
("zone" .=) <$> _oZone,
("warnings" .=) <$> _oWarnings,
("httpErrorStatusCode" .=) <$> _oHTTPErrorStatusCode,
("user" .=) <$> _oUser,
("selfLink" .=) <$> _oSelfLink,
("name" .=) <$> _oName,
("statusMessage" .=) <$> _oStatusMessage,
("creationTimestamp" .=) <$> _oCreationTimestamp,
("endTime" .=) <$> _oEndTime, ("id" .=) <$> _oId,
("operationType" .=) <$> _oOperationType,
("region" .=) <$> _oRegion,
("description" .=) <$> _oDescription,
("targetLink" .=) <$> _oTargetLink,
("clientOperationId" .=) <$> _oClientOperationId])
newtype AutoscalingPolicyLoadBalancingUtilization = AutoscalingPolicyLoadBalancingUtilization'
{ _aplbuUtilizationTarget :: Maybe (Textual Double)
} deriving (Eq,Show,Data,Typeable,Generic)
autoscalingPolicyLoadBalancingUtilization
:: AutoscalingPolicyLoadBalancingUtilization
autoscalingPolicyLoadBalancingUtilization =
AutoscalingPolicyLoadBalancingUtilization'
{ _aplbuUtilizationTarget = Nothing
}
aplbuUtilizationTarget :: Lens' AutoscalingPolicyLoadBalancingUtilization (Maybe Double)
aplbuUtilizationTarget
= lens _aplbuUtilizationTarget
(\ s a -> s{_aplbuUtilizationTarget = a})
. mapping _Coerce
instance FromJSON
AutoscalingPolicyLoadBalancingUtilization where
parseJSON
= withObject
"AutoscalingPolicyLoadBalancingUtilization"
(\ o ->
AutoscalingPolicyLoadBalancingUtilization' <$>
(o .:? "utilizationTarget"))
instance ToJSON
AutoscalingPolicyLoadBalancingUtilization where
toJSON AutoscalingPolicyLoadBalancingUtilization'{..}
= object
(catMaybes
[("utilizationTarget" .=) <$>
_aplbuUtilizationTarget])
data Zone = Zone'
{ _zStatus :: !(Maybe Text)
, _zKind :: !Text
, _zSelfLink :: !(Maybe Text)
, _zName :: !(Maybe Text)
, _zCreationTimestamp :: !(Maybe Text)
, _zId :: !(Maybe (Textual Word64))
, _zRegion :: !(Maybe Text)
, _zDescription :: !(Maybe Text)
, _zDeprecated :: !(Maybe DeprecationStatus)
} deriving (Eq,Show,Data,Typeable,Generic)
zone
:: Zone
zone =
Zone'
{ _zStatus = Nothing
, _zKind = "autoscaler#zone"
, _zSelfLink = Nothing
, _zName = Nothing
, _zCreationTimestamp = Nothing
, _zId = Nothing
, _zRegion = Nothing
, _zDescription = Nothing
, _zDeprecated = Nothing
}
zStatus :: Lens' Zone (Maybe Text)
zStatus = lens _zStatus (\ s a -> s{_zStatus = a})
zKind :: Lens' Zone Text
zKind = lens _zKind (\ s a -> s{_zKind = a})
zSelfLink :: Lens' Zone (Maybe Text)
zSelfLink
= lens _zSelfLink (\ s a -> s{_zSelfLink = a})
zName :: Lens' Zone (Maybe Text)
zName = lens _zName (\ s a -> s{_zName = a})
zCreationTimestamp :: Lens' Zone (Maybe Text)
zCreationTimestamp
= lens _zCreationTimestamp
(\ s a -> s{_zCreationTimestamp = a})
zId :: Lens' Zone (Maybe Word64)
zId
= lens _zId (\ s a -> s{_zId = a}) . mapping _Coerce
zRegion :: Lens' Zone (Maybe Text)
zRegion = lens _zRegion (\ s a -> s{_zRegion = a})
zDescription :: Lens' Zone (Maybe Text)
zDescription
= lens _zDescription (\ s a -> s{_zDescription = a})
zDeprecated :: Lens' Zone (Maybe DeprecationStatus)
zDeprecated
= lens _zDeprecated (\ s a -> s{_zDeprecated = a})
instance FromJSON Zone where
parseJSON
= withObject "Zone"
(\ o ->
Zone' <$>
(o .:? "status") <*>
(o .:? "kind" .!= "autoscaler#zone")
<*> (o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "creationTimestamp")
<*> (o .:? "id")
<*> (o .:? "region")
<*> (o .:? "description")
<*> (o .:? "deprecated"))
instance ToJSON Zone where
toJSON Zone'{..}
= object
(catMaybes
[("status" .=) <$> _zStatus, Just ("kind" .= _zKind),
("selfLink" .=) <$> _zSelfLink,
("name" .=) <$> _zName,
("creationTimestamp" .=) <$> _zCreationTimestamp,
("id" .=) <$> _zId, ("region" .=) <$> _zRegion,
("description" .=) <$> _zDescription,
("deprecated" .=) <$> _zDeprecated])
data ZoneList = ZoneList'
{ _zlNextPageToken :: !(Maybe Text)
, _zlKind :: !Text
, _zlItems :: !(Maybe [Zone])
, _zlSelfLink :: !(Maybe Text)
, _zlId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
zoneList
:: ZoneList
zoneList =
ZoneList'
{ _zlNextPageToken = Nothing
, _zlKind = "autoscaler#zoneList"
, _zlItems = Nothing
, _zlSelfLink = Nothing
, _zlId = Nothing
}
zlNextPageToken :: Lens' ZoneList (Maybe Text)
zlNextPageToken
= lens _zlNextPageToken
(\ s a -> s{_zlNextPageToken = a})
zlKind :: Lens' ZoneList Text
zlKind = lens _zlKind (\ s a -> s{_zlKind = a})
zlItems :: Lens' ZoneList [Zone]
zlItems
= lens _zlItems (\ s a -> s{_zlItems = a}) . _Default
. _Coerce
zlSelfLink :: Lens' ZoneList (Maybe Text)
zlSelfLink
= lens _zlSelfLink (\ s a -> s{_zlSelfLink = a})
zlId :: Lens' ZoneList (Maybe Text)
zlId = lens _zlId (\ s a -> s{_zlId = a})
instance FromJSON ZoneList where
parseJSON
= withObject "ZoneList"
(\ o ->
ZoneList' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "autoscaler#zoneList")
<*> (o .:? "items" .!= mempty)
<*> (o .:? "selfLink")
<*> (o .:? "id"))
instance ToJSON ZoneList where
toJSON ZoneList'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _zlNextPageToken,
Just ("kind" .= _zlKind), ("items" .=) <$> _zlItems,
("selfLink" .=) <$> _zlSelfLink,
("id" .=) <$> _zlId])
data AutoscalerListResponse = AutoscalerListResponse'
{ _alrNextPageToken :: !(Maybe Text)
, _alrKind :: !Text
, _alrItems :: !(Maybe [Autoscaler])
} deriving (Eq,Show,Data,Typeable,Generic)
autoscalerListResponse
:: AutoscalerListResponse
autoscalerListResponse =
AutoscalerListResponse'
{ _alrNextPageToken = Nothing
, _alrKind = "compute#autoscalerList"
, _alrItems = Nothing
}
alrNextPageToken :: Lens' AutoscalerListResponse (Maybe Text)
alrNextPageToken
= lens _alrNextPageToken
(\ s a -> s{_alrNextPageToken = a})
alrKind :: Lens' AutoscalerListResponse Text
alrKind = lens _alrKind (\ s a -> s{_alrKind = a})
alrItems :: Lens' AutoscalerListResponse [Autoscaler]
alrItems
= lens _alrItems (\ s a -> s{_alrItems = a}) .
_Default
. _Coerce
instance FromJSON AutoscalerListResponse where
parseJSON
= withObject "AutoscalerListResponse"
(\ o ->
AutoscalerListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "compute#autoscalerList")
<*> (o .:? "items" .!= mempty))
instance ToJSON AutoscalerListResponse where
toJSON AutoscalerListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _alrNextPageToken,
Just ("kind" .= _alrKind),
("items" .=) <$> _alrItems])
data AutoscalingPolicy = AutoscalingPolicy'
{ _apCustomMetricUtilizations :: !(Maybe [AutoscalingPolicyCustomMetricUtilization])
, _apMaxNumReplicas :: !(Maybe (Textual Int32))
, _apCPUUtilization :: !(Maybe AutoscalingPolicyCPUUtilization)
, _apLoadBalancingUtilization :: !(Maybe AutoscalingPolicyLoadBalancingUtilization)
, _apMinNumReplicas :: !(Maybe (Textual Int32))
, _apCoolDownPeriodSec :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
autoscalingPolicy
:: AutoscalingPolicy
autoscalingPolicy =
AutoscalingPolicy'
{ _apCustomMetricUtilizations = Nothing
, _apMaxNumReplicas = Nothing
, _apCPUUtilization = Nothing
, _apLoadBalancingUtilization = Nothing
, _apMinNumReplicas = Nothing
, _apCoolDownPeriodSec = Nothing
}
apCustomMetricUtilizations :: Lens' AutoscalingPolicy [AutoscalingPolicyCustomMetricUtilization]
apCustomMetricUtilizations
= lens _apCustomMetricUtilizations
(\ s a -> s{_apCustomMetricUtilizations = a})
. _Default
. _Coerce
apMaxNumReplicas :: Lens' AutoscalingPolicy (Maybe Int32)
apMaxNumReplicas
= lens _apMaxNumReplicas
(\ s a -> s{_apMaxNumReplicas = a})
. mapping _Coerce
apCPUUtilization :: Lens' AutoscalingPolicy (Maybe AutoscalingPolicyCPUUtilization)
apCPUUtilization
= lens _apCPUUtilization
(\ s a -> s{_apCPUUtilization = a})
apLoadBalancingUtilization :: Lens' AutoscalingPolicy (Maybe AutoscalingPolicyLoadBalancingUtilization)
apLoadBalancingUtilization
= lens _apLoadBalancingUtilization
(\ s a -> s{_apLoadBalancingUtilization = a})
apMinNumReplicas :: Lens' AutoscalingPolicy (Maybe Int32)
apMinNumReplicas
= lens _apMinNumReplicas
(\ s a -> s{_apMinNumReplicas = a})
. mapping _Coerce
apCoolDownPeriodSec :: Lens' AutoscalingPolicy (Maybe Int32)
apCoolDownPeriodSec
= lens _apCoolDownPeriodSec
(\ s a -> s{_apCoolDownPeriodSec = a})
. mapping _Coerce
instance FromJSON AutoscalingPolicy where
parseJSON
= withObject "AutoscalingPolicy"
(\ o ->
AutoscalingPolicy' <$>
(o .:? "customMetricUtilizations" .!= mempty) <*>
(o .:? "maxNumReplicas")
<*> (o .:? "cpuUtilization")
<*> (o .:? "loadBalancingUtilization")
<*> (o .:? "minNumReplicas")
<*> (o .:? "coolDownPeriodSec"))
instance ToJSON AutoscalingPolicy where
toJSON AutoscalingPolicy'{..}
= object
(catMaybes
[("customMetricUtilizations" .=) <$>
_apCustomMetricUtilizations,
("maxNumReplicas" .=) <$> _apMaxNumReplicas,
("cpuUtilization" .=) <$> _apCPUUtilization,
("loadBalancingUtilization" .=) <$>
_apLoadBalancingUtilization,
("minNumReplicas" .=) <$> _apMinNumReplicas,
("coolDownPeriodSec" .=) <$> _apCoolDownPeriodSec])
newtype OperationError = OperationError'
{ _oeErrors :: Maybe [OperationErrorErrorsItem]
} deriving (Eq,Show,Data,Typeable,Generic)
operationError
:: OperationError
operationError =
OperationError'
{ _oeErrors = Nothing
}
oeErrors :: Lens' OperationError [OperationErrorErrorsItem]
oeErrors
= lens _oeErrors (\ s a -> s{_oeErrors = a}) .
_Default
. _Coerce
instance FromJSON OperationError where
parseJSON
= withObject "OperationError"
(\ o ->
OperationError' <$> (o .:? "errors" .!= mempty))
instance ToJSON OperationError where
toJSON OperationError'{..}
= object (catMaybes [("errors" .=) <$> _oeErrors])
data Autoscaler = Autoscaler'
{ _aKind :: !Text
, _aSelfLink :: !(Maybe Text)
, _aName :: !(Maybe Text)
, _aCreationTimestamp :: !(Maybe Text)
, _aAutoscalingPolicy :: !(Maybe AutoscalingPolicy)
, _aId :: !(Maybe (Textual Word64))
, _aDescription :: !(Maybe Text)
, _aTarget :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
autoscaler
:: Autoscaler
autoscaler =
Autoscaler'
{ _aKind = "compute#autoscaler"
, _aSelfLink = Nothing
, _aName = Nothing
, _aCreationTimestamp = Nothing
, _aAutoscalingPolicy = Nothing
, _aId = Nothing
, _aDescription = Nothing
, _aTarget = Nothing
}
aKind :: Lens' Autoscaler Text
aKind = lens _aKind (\ s a -> s{_aKind = a})
aSelfLink :: Lens' Autoscaler (Maybe Text)
aSelfLink
= lens _aSelfLink (\ s a -> s{_aSelfLink = a})
aName :: Lens' Autoscaler (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a})
aCreationTimestamp :: Lens' Autoscaler (Maybe Text)
aCreationTimestamp
= lens _aCreationTimestamp
(\ s a -> s{_aCreationTimestamp = a})
aAutoscalingPolicy :: Lens' Autoscaler (Maybe AutoscalingPolicy)
aAutoscalingPolicy
= lens _aAutoscalingPolicy
(\ s a -> s{_aAutoscalingPolicy = a})
aId :: Lens' Autoscaler (Maybe Word64)
aId
= lens _aId (\ s a -> s{_aId = a}) . mapping _Coerce
aDescription :: Lens' Autoscaler (Maybe Text)
aDescription
= lens _aDescription (\ s a -> s{_aDescription = a})
aTarget :: Lens' Autoscaler (Maybe Text)
aTarget = lens _aTarget (\ s a -> s{_aTarget = a})
instance FromJSON Autoscaler where
parseJSON
= withObject "Autoscaler"
(\ o ->
Autoscaler' <$>
(o .:? "kind" .!= "compute#autoscaler") <*>
(o .:? "selfLink")
<*> (o .:? "name")
<*> (o .:? "creationTimestamp")
<*> (o .:? "autoscalingPolicy")
<*> (o .:? "id")
<*> (o .:? "description")
<*> (o .:? "target"))
instance ToJSON Autoscaler where
toJSON Autoscaler'{..}
= object
(catMaybes
[Just ("kind" .= _aKind),
("selfLink" .=) <$> _aSelfLink,
("name" .=) <$> _aName,
("creationTimestamp" .=) <$> _aCreationTimestamp,
("autoscalingPolicy" .=) <$> _aAutoscalingPolicy,
("id" .=) <$> _aId,
("description" .=) <$> _aDescription,
("target" .=) <$> _aTarget])
data OperationErrorErrorsItem = OperationErrorErrorsItem'
{ _oeeiLocation :: !(Maybe Text)
, _oeeiCode :: !(Maybe Text)
, _oeeiMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
operationErrorErrorsItem
:: OperationErrorErrorsItem
operationErrorErrorsItem =
OperationErrorErrorsItem'
{ _oeeiLocation = Nothing
, _oeeiCode = Nothing
, _oeeiMessage = Nothing
}
oeeiLocation :: Lens' OperationErrorErrorsItem (Maybe Text)
oeeiLocation
= lens _oeeiLocation (\ s a -> s{_oeeiLocation = a})
oeeiCode :: Lens' OperationErrorErrorsItem (Maybe Text)
oeeiCode = lens _oeeiCode (\ s a -> s{_oeeiCode = a})
oeeiMessage :: Lens' OperationErrorErrorsItem (Maybe Text)
oeeiMessage
= lens _oeeiMessage (\ s a -> s{_oeeiMessage = a})
instance FromJSON OperationErrorErrorsItem where
parseJSON
= withObject "OperationErrorErrorsItem"
(\ o ->
OperationErrorErrorsItem' <$>
(o .:? "location") <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON OperationErrorErrorsItem where
toJSON OperationErrorErrorsItem'{..}
= object
(catMaybes
[("location" .=) <$> _oeeiLocation,
("code" .=) <$> _oeeiCode,
("message" .=) <$> _oeeiMessage])
newtype AutoscalingPolicyCPUUtilization = AutoscalingPolicyCPUUtilization'
{ _apcuUtilizationTarget :: Maybe (Textual Double)
} deriving (Eq,Show,Data,Typeable,Generic)
autoscalingPolicyCPUUtilization
:: AutoscalingPolicyCPUUtilization
autoscalingPolicyCPUUtilization =
AutoscalingPolicyCPUUtilization'
{ _apcuUtilizationTarget = Nothing
}
apcuUtilizationTarget :: Lens' AutoscalingPolicyCPUUtilization (Maybe Double)
apcuUtilizationTarget
= lens _apcuUtilizationTarget
(\ s a -> s{_apcuUtilizationTarget = a})
. mapping _Coerce
instance FromJSON AutoscalingPolicyCPUUtilization
where
parseJSON
= withObject "AutoscalingPolicyCPUUtilization"
(\ o ->
AutoscalingPolicyCPUUtilization' <$>
(o .:? "utilizationTarget"))
instance ToJSON AutoscalingPolicyCPUUtilization where
toJSON AutoscalingPolicyCPUUtilization'{..}
= object
(catMaybes
[("utilizationTarget" .=) <$>
_apcuUtilizationTarget])
data OperationWarningsItem = OperationWarningsItem'
{ _owiData :: !(Maybe [OperationWarningsItemDataItem])
, _owiCode :: !(Maybe Text)
, _owiMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
operationWarningsItem
:: OperationWarningsItem
operationWarningsItem =
OperationWarningsItem'
{ _owiData = Nothing
, _owiCode = Nothing
, _owiMessage = Nothing
}
owiData :: Lens' OperationWarningsItem [OperationWarningsItemDataItem]
owiData
= lens _owiData (\ s a -> s{_owiData = a}) . _Default
. _Coerce
owiCode :: Lens' OperationWarningsItem (Maybe Text)
owiCode = lens _owiCode (\ s a -> s{_owiCode = a})
owiMessage :: Lens' OperationWarningsItem (Maybe Text)
owiMessage
= lens _owiMessage (\ s a -> s{_owiMessage = a})
instance FromJSON OperationWarningsItem where
parseJSON
= withObject "OperationWarningsItem"
(\ o ->
OperationWarningsItem' <$>
(o .:? "data" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON OperationWarningsItem where
toJSON OperationWarningsItem'{..}
= object
(catMaybes
[("data" .=) <$> _owiData, ("code" .=) <$> _owiCode,
("message" .=) <$> _owiMessage])