{-# 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.TPU.Types.Product where
import Network.Google.Prelude
import Network.Google.TPU.Types.Sum
data Status = Status'
{ _sDetails :: !(Maybe [StatusDetailsItem])
, _sCode :: !(Maybe (Textual Int32))
, _sMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
status
:: Status
status =
Status'
{ _sDetails = Nothing
, _sCode = Nothing
, _sMessage = Nothing
}
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
= lens _sDetails (\ s a -> s{_sDetails = a}) .
_Default
. _Coerce
sCode :: Lens' Status (Maybe Int32)
sCode
= lens _sCode (\ s a -> s{_sCode = a}) .
mapping _Coerce
sMessage :: Lens' Status (Maybe Text)
sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
instance FromJSON Status where
parseJSON
= withObject "Status"
(\ o ->
Status' <$>
(o .:? "details" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON Status where
toJSON Status'{..}
= object
(catMaybes
[("details" .=) <$> _sDetails,
("code" .=) <$> _sCode,
("message" .=) <$> _sMessage])
newtype OperationSchema = OperationSchema'
{ _osAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
operationSchema
:: HashMap Text JSONValue
-> OperationSchema
operationSchema pOsAddtional_ =
OperationSchema'
{ _osAddtional = _Coerce # pOsAddtional_
}
osAddtional :: Lens' OperationSchema (HashMap Text JSONValue)
osAddtional
= lens _osAddtional (\ s a -> s{_osAddtional = a}) .
_Coerce
instance FromJSON OperationSchema where
parseJSON
= withObject "OperationSchema"
(\ o -> OperationSchema' <$> (parseJSONObject o))
instance ToJSON OperationSchema where
toJSON = toJSON . _osAddtional
data ListLocationsResponse = ListLocationsResponse'
{ _llrNextPageToken :: !(Maybe Text)
, _llrLocations :: !(Maybe [Location])
} deriving (Eq,Show,Data,Typeable,Generic)
listLocationsResponse
:: ListLocationsResponse
listLocationsResponse =
ListLocationsResponse'
{ _llrNextPageToken = Nothing
, _llrLocations = Nothing
}
llrNextPageToken :: Lens' ListLocationsResponse (Maybe Text)
llrNextPageToken
= lens _llrNextPageToken
(\ s a -> s{_llrNextPageToken = a})
llrLocations :: Lens' ListLocationsResponse [Location]
llrLocations
= lens _llrLocations (\ s a -> s{_llrLocations = a})
. _Default
. _Coerce
instance FromJSON ListLocationsResponse where
parseJSON
= withObject "ListLocationsResponse"
(\ o ->
ListLocationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "locations" .!= mempty))
instance ToJSON ListLocationsResponse where
toJSON ListLocationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _llrNextPageToken,
("locations" .=) <$> _llrLocations])
data AcceleratorType = AcceleratorType'
{ _atName :: !(Maybe Text)
, _atType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
acceleratorType
:: AcceleratorType
acceleratorType =
AcceleratorType'
{ _atName = Nothing
, _atType = Nothing
}
atName :: Lens' AcceleratorType (Maybe Text)
atName = lens _atName (\ s a -> s{_atName = a})
atType :: Lens' AcceleratorType (Maybe Text)
atType = lens _atType (\ s a -> s{_atType = a})
instance FromJSON AcceleratorType where
parseJSON
= withObject "AcceleratorType"
(\ o ->
AcceleratorType' <$>
(o .:? "name") <*> (o .:? "type"))
instance ToJSON AcceleratorType where
toJSON AcceleratorType'{..}
= object
(catMaybes
[("name" .=) <$> _atName, ("type" .=) <$> _atType])
data ListOperationsResponse = ListOperationsResponse'
{ _lorNextPageToken :: !(Maybe Text)
, _lorOperations :: !(Maybe [Operation])
} deriving (Eq,Show,Data,Typeable,Generic)
listOperationsResponse
:: ListOperationsResponse
listOperationsResponse =
ListOperationsResponse'
{ _lorNextPageToken = Nothing
, _lorOperations = Nothing
}
lorNextPageToken :: Lens' ListOperationsResponse (Maybe Text)
lorNextPageToken
= lens _lorNextPageToken
(\ s a -> s{_lorNextPageToken = a})
lorOperations :: Lens' ListOperationsResponse [Operation]
lorOperations
= lens _lorOperations
(\ s a -> s{_lorOperations = a})
. _Default
. _Coerce
instance FromJSON ListOperationsResponse where
parseJSON
= withObject "ListOperationsResponse"
(\ o ->
ListOperationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "operations" .!= mempty))
instance ToJSON ListOperationsResponse where
toJSON ListOperationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lorNextPageToken,
("operations" .=) <$> _lorOperations])
data ListAcceleratorTypesResponse = ListAcceleratorTypesResponse'
{ _latrAcceleratorTypes :: !(Maybe [AcceleratorType])
, _latrNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listAcceleratorTypesResponse
:: ListAcceleratorTypesResponse
listAcceleratorTypesResponse =
ListAcceleratorTypesResponse'
{ _latrAcceleratorTypes = Nothing
, _latrNextPageToken = Nothing
}
latrAcceleratorTypes :: Lens' ListAcceleratorTypesResponse [AcceleratorType]
latrAcceleratorTypes
= lens _latrAcceleratorTypes
(\ s a -> s{_latrAcceleratorTypes = a})
. _Default
. _Coerce
latrNextPageToken :: Lens' ListAcceleratorTypesResponse (Maybe Text)
latrNextPageToken
= lens _latrNextPageToken
(\ s a -> s{_latrNextPageToken = a})
instance FromJSON ListAcceleratorTypesResponse where
parseJSON
= withObject "ListAcceleratorTypesResponse"
(\ o ->
ListAcceleratorTypesResponse' <$>
(o .:? "acceleratorTypes" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListAcceleratorTypesResponse where
toJSON ListAcceleratorTypesResponse'{..}
= object
(catMaybes
[("acceleratorTypes" .=) <$> _latrAcceleratorTypes,
("nextPageToken" .=) <$> _latrNextPageToken])
data Location = Location'
{ _lName :: !(Maybe Text)
, _lMetadata :: !(Maybe LocationMetadata)
, _lDisplayName :: !(Maybe Text)
, _lLabels :: !(Maybe LocationLabels)
, _lLocationId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
location
:: Location
location =
Location'
{ _lName = Nothing
, _lMetadata = Nothing
, _lDisplayName = Nothing
, _lLabels = Nothing
, _lLocationId = Nothing
}
lName :: Lens' Location (Maybe Text)
lName = lens _lName (\ s a -> s{_lName = a})
lMetadata :: Lens' Location (Maybe LocationMetadata)
lMetadata
= lens _lMetadata (\ s a -> s{_lMetadata = a})
lDisplayName :: Lens' Location (Maybe Text)
lDisplayName
= lens _lDisplayName (\ s a -> s{_lDisplayName = a})
lLabels :: Lens' Location (Maybe LocationLabels)
lLabels = lens _lLabels (\ s a -> s{_lLabels = a})
lLocationId :: Lens' Location (Maybe Text)
lLocationId
= lens _lLocationId (\ s a -> s{_lLocationId = a})
instance FromJSON Location where
parseJSON
= withObject "Location"
(\ o ->
Location' <$>
(o .:? "name") <*> (o .:? "metadata") <*>
(o .:? "displayName")
<*> (o .:? "labels")
<*> (o .:? "locationId"))
instance ToJSON Location where
toJSON Location'{..}
= object
(catMaybes
[("name" .=) <$> _lName,
("metadata" .=) <$> _lMetadata,
("displayName" .=) <$> _lDisplayName,
("labels" .=) <$> _lLabels,
("locationId" .=) <$> _lLocationId])
data Operation = Operation'
{ _oDone :: !(Maybe Bool)
, _oError :: !(Maybe Status)
, _oResponse :: !(Maybe OperationResponse)
, _oName :: !(Maybe Text)
, _oMetadata :: !(Maybe OperationSchema)
} deriving (Eq,Show,Data,Typeable,Generic)
operation
:: Operation
operation =
Operation'
{ _oDone = Nothing
, _oError = Nothing
, _oResponse = Nothing
, _oName = Nothing
, _oMetadata = Nothing
}
oDone :: Lens' Operation (Maybe Bool)
oDone = lens _oDone (\ s a -> s{_oDone = a})
oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a})
oResponse :: Lens' Operation (Maybe OperationResponse)
oResponse
= lens _oResponse (\ s a -> s{_oResponse = a})
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
oMetadata :: Lens' Operation (Maybe OperationSchema)
oMetadata
= lens _oMetadata (\ s a -> s{_oMetadata = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "done") <*> (o .:? "error") <*>
(o .:? "response")
<*> (o .:? "name")
<*> (o .:? "metadata"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("done" .=) <$> _oDone, ("error" .=) <$> _oError,
("response" .=) <$> _oResponse,
("name" .=) <$> _oName,
("metadata" .=) <$> _oMetadata])
data NetworkEndpoint = NetworkEndpoint'
{ _neIPAddress :: !(Maybe Text)
, _nePort :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
networkEndpoint
:: NetworkEndpoint
networkEndpoint =
NetworkEndpoint'
{ _neIPAddress = Nothing
, _nePort = Nothing
}
neIPAddress :: Lens' NetworkEndpoint (Maybe Text)
neIPAddress
= lens _neIPAddress (\ s a -> s{_neIPAddress = a})
nePort :: Lens' NetworkEndpoint (Maybe Int32)
nePort
= lens _nePort (\ s a -> s{_nePort = a}) .
mapping _Coerce
instance FromJSON NetworkEndpoint where
parseJSON
= withObject "NetworkEndpoint"
(\ o ->
NetworkEndpoint' <$>
(o .:? "ipAddress") <*> (o .:? "port"))
instance ToJSON NetworkEndpoint where
toJSON NetworkEndpoint'{..}
= object
(catMaybes
[("ipAddress" .=) <$> _neIPAddress,
("port" .=) <$> _nePort])
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
data Node = Node'
{ _nAcceleratorType :: !(Maybe Text)
, _nIPAddress :: !(Maybe Text)
, _nState :: !(Maybe NodeState)
, _nNetwork :: !(Maybe Text)
, _nHealth :: !(Maybe NodeHealth)
, _nServiceAccount :: !(Maybe Text)
, _nName :: !(Maybe Text)
, _nSchedulingConfig :: !(Maybe SchedulingConfig)
, _nHealthDescription :: !(Maybe Text)
, _nCIdRBlock :: !(Maybe Text)
, _nLabels :: !(Maybe NodeLabels)
, _nNetworkEndpoints :: !(Maybe [NetworkEndpoint])
, _nDescription :: !(Maybe Text)
, _nCreateTime :: !(Maybe DateTime')
, _nTensorflowVersion :: !(Maybe Text)
, _nPort :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
node
:: Node
node =
Node'
{ _nAcceleratorType = Nothing
, _nIPAddress = Nothing
, _nState = Nothing
, _nNetwork = Nothing
, _nHealth = Nothing
, _nServiceAccount = Nothing
, _nName = Nothing
, _nSchedulingConfig = Nothing
, _nHealthDescription = Nothing
, _nCIdRBlock = Nothing
, _nLabels = Nothing
, _nNetworkEndpoints = Nothing
, _nDescription = Nothing
, _nCreateTime = Nothing
, _nTensorflowVersion = Nothing
, _nPort = Nothing
}
nAcceleratorType :: Lens' Node (Maybe Text)
nAcceleratorType
= lens _nAcceleratorType
(\ s a -> s{_nAcceleratorType = a})
nIPAddress :: Lens' Node (Maybe Text)
nIPAddress
= lens _nIPAddress (\ s a -> s{_nIPAddress = a})
nState :: Lens' Node (Maybe NodeState)
nState = lens _nState (\ s a -> s{_nState = a})
nNetwork :: Lens' Node (Maybe Text)
nNetwork = lens _nNetwork (\ s a -> s{_nNetwork = a})
nHealth :: Lens' Node (Maybe NodeHealth)
nHealth = lens _nHealth (\ s a -> s{_nHealth = a})
nServiceAccount :: Lens' Node (Maybe Text)
nServiceAccount
= lens _nServiceAccount
(\ s a -> s{_nServiceAccount = a})
nName :: Lens' Node (Maybe Text)
nName = lens _nName (\ s a -> s{_nName = a})
nSchedulingConfig :: Lens' Node (Maybe SchedulingConfig)
nSchedulingConfig
= lens _nSchedulingConfig
(\ s a -> s{_nSchedulingConfig = a})
nHealthDescription :: Lens' Node (Maybe Text)
nHealthDescription
= lens _nHealthDescription
(\ s a -> s{_nHealthDescription = a})
nCIdRBlock :: Lens' Node (Maybe Text)
nCIdRBlock
= lens _nCIdRBlock (\ s a -> s{_nCIdRBlock = a})
nLabels :: Lens' Node (Maybe NodeLabels)
nLabels = lens _nLabels (\ s a -> s{_nLabels = a})
nNetworkEndpoints :: Lens' Node [NetworkEndpoint]
nNetworkEndpoints
= lens _nNetworkEndpoints
(\ s a -> s{_nNetworkEndpoints = a})
. _Default
. _Coerce
nDescription :: Lens' Node (Maybe Text)
nDescription
= lens _nDescription (\ s a -> s{_nDescription = a})
nCreateTime :: Lens' Node (Maybe UTCTime)
nCreateTime
= lens _nCreateTime (\ s a -> s{_nCreateTime = a}) .
mapping _DateTime
nTensorflowVersion :: Lens' Node (Maybe Text)
nTensorflowVersion
= lens _nTensorflowVersion
(\ s a -> s{_nTensorflowVersion = a})
nPort :: Lens' Node (Maybe Text)
nPort = lens _nPort (\ s a -> s{_nPort = a})
instance FromJSON Node where
parseJSON
= withObject "Node"
(\ o ->
Node' <$>
(o .:? "acceleratorType") <*> (o .:? "ipAddress") <*>
(o .:? "state")
<*> (o .:? "network")
<*> (o .:? "health")
<*> (o .:? "serviceAccount")
<*> (o .:? "name")
<*> (o .:? "schedulingConfig")
<*> (o .:? "healthDescription")
<*> (o .:? "cidrBlock")
<*> (o .:? "labels")
<*> (o .:? "networkEndpoints" .!= mempty)
<*> (o .:? "description")
<*> (o .:? "createTime")
<*> (o .:? "tensorflowVersion")
<*> (o .:? "port"))
instance ToJSON Node where
toJSON Node'{..}
= object
(catMaybes
[("acceleratorType" .=) <$> _nAcceleratorType,
("ipAddress" .=) <$> _nIPAddress,
("state" .=) <$> _nState,
("network" .=) <$> _nNetwork,
("health" .=) <$> _nHealth,
("serviceAccount" .=) <$> _nServiceAccount,
("name" .=) <$> _nName,
("schedulingConfig" .=) <$> _nSchedulingConfig,
("healthDescription" .=) <$> _nHealthDescription,
("cidrBlock" .=) <$> _nCIdRBlock,
("labels" .=) <$> _nLabels,
("networkEndpoints" .=) <$> _nNetworkEndpoints,
("description" .=) <$> _nDescription,
("createTime" .=) <$> _nCreateTime,
("tensorflowVersion" .=) <$> _nTensorflowVersion,
("port" .=) <$> _nPort])
newtype StatusDetailsItem = StatusDetailsItem'
{ _sdiAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
statusDetailsItem
:: HashMap Text JSONValue
-> StatusDetailsItem
statusDetailsItem pSdiAddtional_ =
StatusDetailsItem'
{ _sdiAddtional = _Coerce # pSdiAddtional_
}
sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
sdiAddtional
= lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
. _Coerce
instance FromJSON StatusDetailsItem where
parseJSON
= withObject "StatusDetailsItem"
(\ o -> StatusDetailsItem' <$> (parseJSONObject o))
instance ToJSON StatusDetailsItem where
toJSON = toJSON . _sdiAddtional
data StopNodeRequest =
StopNodeRequest'
deriving (Eq,Show,Data,Typeable,Generic)
stopNodeRequest
:: StopNodeRequest
stopNodeRequest = StopNodeRequest'
instance FromJSON StopNodeRequest where
parseJSON
= withObject "StopNodeRequest"
(\ o -> pure StopNodeRequest')
instance ToJSON StopNodeRequest where
toJSON = const emptyObject
newtype ReimageNodeRequest = ReimageNodeRequest'
{ _rnrTensorflowVersion :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
reimageNodeRequest
:: ReimageNodeRequest
reimageNodeRequest =
ReimageNodeRequest'
{ _rnrTensorflowVersion = Nothing
}
rnrTensorflowVersion :: Lens' ReimageNodeRequest (Maybe Text)
rnrTensorflowVersion
= lens _rnrTensorflowVersion
(\ s a -> s{_rnrTensorflowVersion = a})
instance FromJSON ReimageNodeRequest where
parseJSON
= withObject "ReimageNodeRequest"
(\ o ->
ReimageNodeRequest' <$> (o .:? "tensorflowVersion"))
instance ToJSON ReimageNodeRequest where
toJSON ReimageNodeRequest'{..}
= object
(catMaybes
[("tensorflowVersion" .=) <$> _rnrTensorflowVersion])
data ListNodesResponse = ListNodesResponse'
{ _lnrNextPageToken :: !(Maybe Text)
, _lnrUnreachable :: !(Maybe [Text])
, _lnrNodes :: !(Maybe [Node])
} deriving (Eq,Show,Data,Typeable,Generic)
listNodesResponse
:: ListNodesResponse
listNodesResponse =
ListNodesResponse'
{ _lnrNextPageToken = Nothing
, _lnrUnreachable = Nothing
, _lnrNodes = Nothing
}
lnrNextPageToken :: Lens' ListNodesResponse (Maybe Text)
lnrNextPageToken
= lens _lnrNextPageToken
(\ s a -> s{_lnrNextPageToken = a})
lnrUnreachable :: Lens' ListNodesResponse [Text]
lnrUnreachable
= lens _lnrUnreachable
(\ s a -> s{_lnrUnreachable = a})
. _Default
. _Coerce
lnrNodes :: Lens' ListNodesResponse [Node]
lnrNodes
= lens _lnrNodes (\ s a -> s{_lnrNodes = a}) .
_Default
. _Coerce
instance FromJSON ListNodesResponse where
parseJSON
= withObject "ListNodesResponse"
(\ o ->
ListNodesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "unreachable" .!= mempty)
<*> (o .:? "nodes" .!= mempty))
instance ToJSON ListNodesResponse where
toJSON ListNodesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lnrNextPageToken,
("unreachable" .=) <$> _lnrUnreachable,
("nodes" .=) <$> _lnrNodes])
newtype SchedulingConfig = SchedulingConfig'
{ _scPreemptible :: Maybe Bool
} deriving (Eq,Show,Data,Typeable,Generic)
schedulingConfig
:: SchedulingConfig
schedulingConfig =
SchedulingConfig'
{ _scPreemptible = Nothing
}
scPreemptible :: Lens' SchedulingConfig (Maybe Bool)
scPreemptible
= lens _scPreemptible
(\ s a -> s{_scPreemptible = a})
instance FromJSON SchedulingConfig where
parseJSON
= withObject "SchedulingConfig"
(\ o -> SchedulingConfig' <$> (o .:? "preemptible"))
instance ToJSON SchedulingConfig where
toJSON SchedulingConfig'{..}
= object
(catMaybes [("preemptible" .=) <$> _scPreemptible])
newtype NodeLabels = NodeLabels'
{ _nlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
nodeLabels
:: HashMap Text Text
-> NodeLabels
nodeLabels pNlAddtional_ =
NodeLabels'
{ _nlAddtional = _Coerce # pNlAddtional_
}
nlAddtional :: Lens' NodeLabels (HashMap Text Text)
nlAddtional
= lens _nlAddtional (\ s a -> s{_nlAddtional = a}) .
_Coerce
instance FromJSON NodeLabels where
parseJSON
= withObject "NodeLabels"
(\ o -> NodeLabels' <$> (parseJSONObject o))
instance ToJSON NodeLabels where
toJSON = toJSON . _nlAddtional
newtype LocationLabels = LocationLabels'
{ _llAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
locationLabels
:: HashMap Text Text
-> LocationLabels
locationLabels pLlAddtional_ =
LocationLabels'
{ _llAddtional = _Coerce # pLlAddtional_
}
llAddtional :: Lens' LocationLabels (HashMap Text Text)
llAddtional
= lens _llAddtional (\ s a -> s{_llAddtional = a}) .
_Coerce
instance FromJSON LocationLabels where
parseJSON
= withObject "LocationLabels"
(\ o -> LocationLabels' <$> (parseJSONObject o))
instance ToJSON LocationLabels where
toJSON = toJSON . _llAddtional
newtype LocationMetadata = LocationMetadata'
{ _lmAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
locationMetadata
:: HashMap Text JSONValue
-> LocationMetadata
locationMetadata pLmAddtional_ =
LocationMetadata'
{ _lmAddtional = _Coerce # pLmAddtional_
}
lmAddtional :: Lens' LocationMetadata (HashMap Text JSONValue)
lmAddtional
= lens _lmAddtional (\ s a -> s{_lmAddtional = a}) .
_Coerce
instance FromJSON LocationMetadata where
parseJSON
= withObject "LocationMetadata"
(\ o -> LocationMetadata' <$> (parseJSONObject o))
instance ToJSON LocationMetadata where
toJSON = toJSON . _lmAddtional
data OperationMetadata = OperationMetadata'
{ _omAPIVersion :: !(Maybe Text)
, _omEndTime :: !(Maybe DateTime')
, _omStatusDetail :: !(Maybe Text)
, _omVerb :: !(Maybe Text)
, _omCancelRequested :: !(Maybe Bool)
, _omTarget :: !(Maybe Text)
, _omCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
operationMetadata
:: OperationMetadata
operationMetadata =
OperationMetadata'
{ _omAPIVersion = Nothing
, _omEndTime = Nothing
, _omStatusDetail = Nothing
, _omVerb = Nothing
, _omCancelRequested = Nothing
, _omTarget = Nothing
, _omCreateTime = Nothing
}
omAPIVersion :: Lens' OperationMetadata (Maybe Text)
omAPIVersion
= lens _omAPIVersion (\ s a -> s{_omAPIVersion = a})
omEndTime :: Lens' OperationMetadata (Maybe UTCTime)
omEndTime
= lens _omEndTime (\ s a -> s{_omEndTime = a}) .
mapping _DateTime
omStatusDetail :: Lens' OperationMetadata (Maybe Text)
omStatusDetail
= lens _omStatusDetail
(\ s a -> s{_omStatusDetail = a})
omVerb :: Lens' OperationMetadata (Maybe Text)
omVerb = lens _omVerb (\ s a -> s{_omVerb = a})
omCancelRequested :: Lens' OperationMetadata (Maybe Bool)
omCancelRequested
= lens _omCancelRequested
(\ s a -> s{_omCancelRequested = a})
omTarget :: Lens' OperationMetadata (Maybe Text)
omTarget = lens _omTarget (\ s a -> s{_omTarget = a})
omCreateTime :: Lens' OperationMetadata (Maybe UTCTime)
omCreateTime
= lens _omCreateTime (\ s a -> s{_omCreateTime = a})
. mapping _DateTime
instance FromJSON OperationMetadata where
parseJSON
= withObject "OperationMetadata"
(\ o ->
OperationMetadata' <$>
(o .:? "apiVersion") <*> (o .:? "endTime") <*>
(o .:? "statusDetail")
<*> (o .:? "verb")
<*> (o .:? "cancelRequested")
<*> (o .:? "target")
<*> (o .:? "createTime"))
instance ToJSON OperationMetadata where
toJSON OperationMetadata'{..}
= object
(catMaybes
[("apiVersion" .=) <$> _omAPIVersion,
("endTime" .=) <$> _omEndTime,
("statusDetail" .=) <$> _omStatusDetail,
("verb" .=) <$> _omVerb,
("cancelRequested" .=) <$> _omCancelRequested,
("target" .=) <$> _omTarget,
("createTime" .=) <$> _omCreateTime])
data ListTensorFlowVersionsResponse = ListTensorFlowVersionsResponse'
{ _ltfvrNextPageToken :: !(Maybe Text)
, _ltfvrTensorflowVersions :: !(Maybe [TensorFlowVersion])
} deriving (Eq,Show,Data,Typeable,Generic)
listTensorFlowVersionsResponse
:: ListTensorFlowVersionsResponse
listTensorFlowVersionsResponse =
ListTensorFlowVersionsResponse'
{ _ltfvrNextPageToken = Nothing
, _ltfvrTensorflowVersions = Nothing
}
ltfvrNextPageToken :: Lens' ListTensorFlowVersionsResponse (Maybe Text)
ltfvrNextPageToken
= lens _ltfvrNextPageToken
(\ s a -> s{_ltfvrNextPageToken = a})
ltfvrTensorflowVersions :: Lens' ListTensorFlowVersionsResponse [TensorFlowVersion]
ltfvrTensorflowVersions
= lens _ltfvrTensorflowVersions
(\ s a -> s{_ltfvrTensorflowVersions = a})
. _Default
. _Coerce
instance FromJSON ListTensorFlowVersionsResponse
where
parseJSON
= withObject "ListTensorFlowVersionsResponse"
(\ o ->
ListTensorFlowVersionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "tensorflowVersions" .!= mempty))
instance ToJSON ListTensorFlowVersionsResponse where
toJSON ListTensorFlowVersionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltfvrNextPageToken,
("tensorflowVersions" .=) <$>
_ltfvrTensorflowVersions])
newtype OperationResponse = OperationResponse'
{ _orAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
operationResponse
:: HashMap Text JSONValue
-> OperationResponse
operationResponse pOrAddtional_ =
OperationResponse'
{ _orAddtional = _Coerce # pOrAddtional_
}
orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
orAddtional
= lens _orAddtional (\ s a -> s{_orAddtional = a}) .
_Coerce
instance FromJSON OperationResponse where
parseJSON
= withObject "OperationResponse"
(\ o -> OperationResponse' <$> (parseJSONObject o))
instance ToJSON OperationResponse where
toJSON = toJSON . _orAddtional
data TensorFlowVersion = TensorFlowVersion'
{ _tfvName :: !(Maybe Text)
, _tfvVersion :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
tensorFlowVersion
:: TensorFlowVersion
tensorFlowVersion =
TensorFlowVersion'
{ _tfvName = Nothing
, _tfvVersion = Nothing
}
tfvName :: Lens' TensorFlowVersion (Maybe Text)
tfvName = lens _tfvName (\ s a -> s{_tfvName = a})
tfvVersion :: Lens' TensorFlowVersion (Maybe Text)
tfvVersion
= lens _tfvVersion (\ s a -> s{_tfvVersion = a})
instance FromJSON TensorFlowVersion where
parseJSON
= withObject "TensorFlowVersion"
(\ o ->
TensorFlowVersion' <$>
(o .:? "name") <*> (o .:? "version"))
instance ToJSON TensorFlowVersion where
toJSON TensorFlowVersion'{..}
= object
(catMaybes
[("name" .=) <$> _tfvName,
("version" .=) <$> _tfvVersion])
data StartNodeRequest =
StartNodeRequest'
deriving (Eq,Show,Data,Typeable,Generic)
startNodeRequest
:: StartNodeRequest
startNodeRequest = StartNodeRequest'
instance FromJSON StartNodeRequest where
parseJSON
= withObject "StartNodeRequest"
(\ o -> pure StartNodeRequest')
instance ToJSON StartNodeRequest where
toJSON = const emptyObject