module Network.AWS.EMR.Types.Product where
import Network.AWS.EMR.Types.Sum
import Network.AWS.Prelude
data Application = Application'
{ _aAdditionalInfo :: !(Maybe (Map Text Text))
, _aArgs :: !(Maybe [Text])
, _aName :: !(Maybe Text)
, _aVersion :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
application
:: Application
application =
Application'
{ _aAdditionalInfo = Nothing
, _aArgs = Nothing
, _aName = Nothing
, _aVersion = Nothing
}
aAdditionalInfo :: Lens' Application (HashMap Text Text)
aAdditionalInfo = lens _aAdditionalInfo (\ s a -> s{_aAdditionalInfo = a}) . _Default . _Map;
aArgs :: Lens' Application [Text]
aArgs = lens _aArgs (\ s a -> s{_aArgs = a}) . _Default . _Coerce;
aName :: Lens' Application (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a});
aVersion :: Lens' Application (Maybe Text)
aVersion = lens _aVersion (\ s a -> s{_aVersion = a});
instance FromJSON Application where
parseJSON
= withObject "Application"
(\ x ->
Application' <$>
(x .:? "AdditionalInfo" .!= mempty) <*>
(x .:? "Args" .!= mempty)
<*> (x .:? "Name")
<*> (x .:? "Version"))
instance ToJSON Application where
toJSON Application'{..}
= object
(catMaybes
[("AdditionalInfo" .=) <$> _aAdditionalInfo,
("Args" .=) <$> _aArgs, ("Name" .=) <$> _aName,
("Version" .=) <$> _aVersion])
data BootstrapActionConfig = BootstrapActionConfig'
{ _bacName :: !Text
, _bacScriptBootstrapAction :: !ScriptBootstrapActionConfig
} deriving (Eq,Read,Show,Data,Typeable,Generic)
bootstrapActionConfig
:: Text
-> ScriptBootstrapActionConfig
-> BootstrapActionConfig
bootstrapActionConfig pName_ pScriptBootstrapAction_ =
BootstrapActionConfig'
{ _bacName = pName_
, _bacScriptBootstrapAction = pScriptBootstrapAction_
}
bacName :: Lens' BootstrapActionConfig Text
bacName = lens _bacName (\ s a -> s{_bacName = a});
bacScriptBootstrapAction :: Lens' BootstrapActionConfig ScriptBootstrapActionConfig
bacScriptBootstrapAction = lens _bacScriptBootstrapAction (\ s a -> s{_bacScriptBootstrapAction = a});
instance ToJSON BootstrapActionConfig where
toJSON BootstrapActionConfig'{..}
= object
(catMaybes
[Just ("Name" .= _bacName),
Just
("ScriptBootstrapAction" .=
_bacScriptBootstrapAction)])
data Cluster = Cluster'
{ _cluRequestedAMIVersion :: !(Maybe Text)
, _cluEC2InstanceAttributes :: !(Maybe EC2InstanceAttributes)
, _cluNormalizedInstanceHours :: !(Maybe Int)
, _cluConfigurations :: !(Maybe [Configuration])
, _cluReleaseLabel :: !(Maybe Text)
, _cluLogURI :: !(Maybe Text)
, _cluRunningAMIVersion :: !(Maybe Text)
, _cluMasterPublicDNSName :: !(Maybe Text)
, _cluAutoTerminate :: !(Maybe Bool)
, _cluTerminationProtected :: !(Maybe Bool)
, _cluVisibleToAllUsers :: !(Maybe Bool)
, _cluApplications :: !(Maybe [Application])
, _cluTags :: !(Maybe [Tag])
, _cluServiceRole :: !(Maybe Text)
, _cluId :: !Text
, _cluName :: !Text
, _cluStatus :: !ClusterStatus
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cluster
:: Text
-> Text
-> ClusterStatus
-> Cluster
cluster pId_ pName_ pStatus_ =
Cluster'
{ _cluRequestedAMIVersion = Nothing
, _cluEC2InstanceAttributes = Nothing
, _cluNormalizedInstanceHours = Nothing
, _cluConfigurations = Nothing
, _cluReleaseLabel = Nothing
, _cluLogURI = Nothing
, _cluRunningAMIVersion = Nothing
, _cluMasterPublicDNSName = Nothing
, _cluAutoTerminate = Nothing
, _cluTerminationProtected = Nothing
, _cluVisibleToAllUsers = Nothing
, _cluApplications = Nothing
, _cluTags = Nothing
, _cluServiceRole = Nothing
, _cluId = pId_
, _cluName = pName_
, _cluStatus = pStatus_
}
cluRequestedAMIVersion :: Lens' Cluster (Maybe Text)
cluRequestedAMIVersion = lens _cluRequestedAMIVersion (\ s a -> s{_cluRequestedAMIVersion = a});
cluEC2InstanceAttributes :: Lens' Cluster (Maybe EC2InstanceAttributes)
cluEC2InstanceAttributes = lens _cluEC2InstanceAttributes (\ s a -> s{_cluEC2InstanceAttributes = a});
cluNormalizedInstanceHours :: Lens' Cluster (Maybe Int)
cluNormalizedInstanceHours = lens _cluNormalizedInstanceHours (\ s a -> s{_cluNormalizedInstanceHours = a});
cluConfigurations :: Lens' Cluster [Configuration]
cluConfigurations = lens _cluConfigurations (\ s a -> s{_cluConfigurations = a}) . _Default . _Coerce;
cluReleaseLabel :: Lens' Cluster (Maybe Text)
cluReleaseLabel = lens _cluReleaseLabel (\ s a -> s{_cluReleaseLabel = a});
cluLogURI :: Lens' Cluster (Maybe Text)
cluLogURI = lens _cluLogURI (\ s a -> s{_cluLogURI = a});
cluRunningAMIVersion :: Lens' Cluster (Maybe Text)
cluRunningAMIVersion = lens _cluRunningAMIVersion (\ s a -> s{_cluRunningAMIVersion = a});
cluMasterPublicDNSName :: Lens' Cluster (Maybe Text)
cluMasterPublicDNSName = lens _cluMasterPublicDNSName (\ s a -> s{_cluMasterPublicDNSName = a});
cluAutoTerminate :: Lens' Cluster (Maybe Bool)
cluAutoTerminate = lens _cluAutoTerminate (\ s a -> s{_cluAutoTerminate = a});
cluTerminationProtected :: Lens' Cluster (Maybe Bool)
cluTerminationProtected = lens _cluTerminationProtected (\ s a -> s{_cluTerminationProtected = a});
cluVisibleToAllUsers :: Lens' Cluster (Maybe Bool)
cluVisibleToAllUsers = lens _cluVisibleToAllUsers (\ s a -> s{_cluVisibleToAllUsers = a});
cluApplications :: Lens' Cluster [Application]
cluApplications = lens _cluApplications (\ s a -> s{_cluApplications = a}) . _Default . _Coerce;
cluTags :: Lens' Cluster [Tag]
cluTags = lens _cluTags (\ s a -> s{_cluTags = a}) . _Default . _Coerce;
cluServiceRole :: Lens' Cluster (Maybe Text)
cluServiceRole = lens _cluServiceRole (\ s a -> s{_cluServiceRole = a});
cluId :: Lens' Cluster Text
cluId = lens _cluId (\ s a -> s{_cluId = a});
cluName :: Lens' Cluster Text
cluName = lens _cluName (\ s a -> s{_cluName = a});
cluStatus :: Lens' Cluster ClusterStatus
cluStatus = lens _cluStatus (\ s a -> s{_cluStatus = a});
instance FromJSON Cluster where
parseJSON
= withObject "Cluster"
(\ x ->
Cluster' <$>
(x .:? "RequestedAmiVersion") <*>
(x .:? "Ec2InstanceAttributes")
<*> (x .:? "NormalizedInstanceHours")
<*> (x .:? "Configurations" .!= mempty)
<*> (x .:? "ReleaseLabel")
<*> (x .:? "LogUri")
<*> (x .:? "RunningAmiVersion")
<*> (x .:? "MasterPublicDnsName")
<*> (x .:? "AutoTerminate")
<*> (x .:? "TerminationProtected")
<*> (x .:? "VisibleToAllUsers")
<*> (x .:? "Applications" .!= mempty)
<*> (x .:? "Tags" .!= mempty)
<*> (x .:? "ServiceRole")
<*> (x .: "Id")
<*> (x .: "Name")
<*> (x .: "Status"))
data ClusterStateChangeReason = ClusterStateChangeReason'
{ _cscrCode :: !(Maybe ClusterStateChangeReasonCode)
, _cscrMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
clusterStateChangeReason
:: ClusterStateChangeReason
clusterStateChangeReason =
ClusterStateChangeReason'
{ _cscrCode = Nothing
, _cscrMessage = Nothing
}
cscrCode :: Lens' ClusterStateChangeReason (Maybe ClusterStateChangeReasonCode)
cscrCode = lens _cscrCode (\ s a -> s{_cscrCode = a});
cscrMessage :: Lens' ClusterStateChangeReason (Maybe Text)
cscrMessage = lens _cscrMessage (\ s a -> s{_cscrMessage = a});
instance FromJSON ClusterStateChangeReason where
parseJSON
= withObject "ClusterStateChangeReason"
(\ x ->
ClusterStateChangeReason' <$>
(x .:? "Code") <*> (x .:? "Message"))
data ClusterStatus = ClusterStatus'
{ _csState :: !(Maybe ClusterState)
, _csStateChangeReason :: !(Maybe ClusterStateChangeReason)
, _csTimeline :: !(Maybe ClusterTimeline)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
clusterStatus
:: ClusterStatus
clusterStatus =
ClusterStatus'
{ _csState = Nothing
, _csStateChangeReason = Nothing
, _csTimeline = Nothing
}
csState :: Lens' ClusterStatus (Maybe ClusterState)
csState = lens _csState (\ s a -> s{_csState = a});
csStateChangeReason :: Lens' ClusterStatus (Maybe ClusterStateChangeReason)
csStateChangeReason = lens _csStateChangeReason (\ s a -> s{_csStateChangeReason = a});
csTimeline :: Lens' ClusterStatus (Maybe ClusterTimeline)
csTimeline = lens _csTimeline (\ s a -> s{_csTimeline = a});
instance FromJSON ClusterStatus where
parseJSON
= withObject "ClusterStatus"
(\ x ->
ClusterStatus' <$>
(x .:? "State") <*> (x .:? "StateChangeReason") <*>
(x .:? "Timeline"))
data ClusterSummary = ClusterSummary'
{ _csStatus :: !(Maybe ClusterStatus)
, _csNormalizedInstanceHours :: !(Maybe Int)
, _csName :: !(Maybe Text)
, _csId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
clusterSummary
:: ClusterSummary
clusterSummary =
ClusterSummary'
{ _csStatus = Nothing
, _csNormalizedInstanceHours = Nothing
, _csName = Nothing
, _csId = Nothing
}
csStatus :: Lens' ClusterSummary (Maybe ClusterStatus)
csStatus = lens _csStatus (\ s a -> s{_csStatus = a});
csNormalizedInstanceHours :: Lens' ClusterSummary (Maybe Int)
csNormalizedInstanceHours = lens _csNormalizedInstanceHours (\ s a -> s{_csNormalizedInstanceHours = a});
csName :: Lens' ClusterSummary (Maybe Text)
csName = lens _csName (\ s a -> s{_csName = a});
csId :: Lens' ClusterSummary (Maybe Text)
csId = lens _csId (\ s a -> s{_csId = a});
instance FromJSON ClusterSummary where
parseJSON
= withObject "ClusterSummary"
(\ x ->
ClusterSummary' <$>
(x .:? "Status") <*>
(x .:? "NormalizedInstanceHours")
<*> (x .:? "Name")
<*> (x .:? "Id"))
data ClusterTimeline = ClusterTimeline'
{ _ctReadyDateTime :: !(Maybe POSIX)
, _ctCreationDateTime :: !(Maybe POSIX)
, _ctEndDateTime :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
clusterTimeline
:: ClusterTimeline
clusterTimeline =
ClusterTimeline'
{ _ctReadyDateTime = Nothing
, _ctCreationDateTime = Nothing
, _ctEndDateTime = Nothing
}
ctReadyDateTime :: Lens' ClusterTimeline (Maybe UTCTime)
ctReadyDateTime = lens _ctReadyDateTime (\ s a -> s{_ctReadyDateTime = a}) . mapping _Time;
ctCreationDateTime :: Lens' ClusterTimeline (Maybe UTCTime)
ctCreationDateTime = lens _ctCreationDateTime (\ s a -> s{_ctCreationDateTime = a}) . mapping _Time;
ctEndDateTime :: Lens' ClusterTimeline (Maybe UTCTime)
ctEndDateTime = lens _ctEndDateTime (\ s a -> s{_ctEndDateTime = a}) . mapping _Time;
instance FromJSON ClusterTimeline where
parseJSON
= withObject "ClusterTimeline"
(\ x ->
ClusterTimeline' <$>
(x .:? "ReadyDateTime") <*>
(x .:? "CreationDateTime")
<*> (x .:? "EndDateTime"))
data Command = Command'
{ _cArgs :: !(Maybe [Text])
, _cScriptPath :: !(Maybe Text)
, _cName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
command
:: Command
command =
Command'
{ _cArgs = Nothing
, _cScriptPath = Nothing
, _cName = Nothing
}
cArgs :: Lens' Command [Text]
cArgs = lens _cArgs (\ s a -> s{_cArgs = a}) . _Default . _Coerce;
cScriptPath :: Lens' Command (Maybe Text)
cScriptPath = lens _cScriptPath (\ s a -> s{_cScriptPath = a});
cName :: Lens' Command (Maybe Text)
cName = lens _cName (\ s a -> s{_cName = a});
instance FromJSON Command where
parseJSON
= withObject "Command"
(\ x ->
Command' <$>
(x .:? "Args" .!= mempty) <*> (x .:? "ScriptPath")
<*> (x .:? "Name"))
data Configuration = Configuration'
{ _cConfigurations :: !(Maybe [Configuration])
, _cClassification :: !(Maybe Text)
, _cProperties :: !(Maybe (Map Text Text))
} deriving (Eq,Read,Show,Data,Typeable,Generic)
configuration
:: Configuration
configuration =
Configuration'
{ _cConfigurations = Nothing
, _cClassification = Nothing
, _cProperties = Nothing
}
cConfigurations :: Lens' Configuration [Configuration]
cConfigurations = lens _cConfigurations (\ s a -> s{_cConfigurations = a}) . _Default . _Coerce;
cClassification :: Lens' Configuration (Maybe Text)
cClassification = lens _cClassification (\ s a -> s{_cClassification = a});
cProperties :: Lens' Configuration (HashMap Text Text)
cProperties = lens _cProperties (\ s a -> s{_cProperties = a}) . _Default . _Map;
instance FromJSON Configuration where
parseJSON
= withObject "Configuration"
(\ x ->
Configuration' <$>
(x .:? "Configurations" .!= mempty) <*>
(x .:? "Classification")
<*> (x .:? "Properties" .!= mempty))
instance ToJSON Configuration where
toJSON Configuration'{..}
= object
(catMaybes
[("Configurations" .=) <$> _cConfigurations,
("Classification" .=) <$> _cClassification,
("Properties" .=) <$> _cProperties])
data EC2InstanceAttributes = EC2InstanceAttributes'
{ _eiaEC2KeyName :: !(Maybe Text)
, _eiaEmrManagedSlaveSecurityGroup :: !(Maybe Text)
, _eiaAdditionalSlaveSecurityGroups :: !(Maybe [Text])
, _eiaIAMInstanceProfile :: !(Maybe Text)
, _eiaAdditionalMasterSecurityGroups :: !(Maybe [Text])
, _eiaEmrManagedMasterSecurityGroup :: !(Maybe Text)
, _eiaEC2SubnetId :: !(Maybe Text)
, _eiaEC2AvailabilityZone :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
ec2InstanceAttributes
:: EC2InstanceAttributes
ec2InstanceAttributes =
EC2InstanceAttributes'
{ _eiaEC2KeyName = Nothing
, _eiaEmrManagedSlaveSecurityGroup = Nothing
, _eiaAdditionalSlaveSecurityGroups = Nothing
, _eiaIAMInstanceProfile = Nothing
, _eiaAdditionalMasterSecurityGroups = Nothing
, _eiaEmrManagedMasterSecurityGroup = Nothing
, _eiaEC2SubnetId = Nothing
, _eiaEC2AvailabilityZone = Nothing
}
eiaEC2KeyName :: Lens' EC2InstanceAttributes (Maybe Text)
eiaEC2KeyName = lens _eiaEC2KeyName (\ s a -> s{_eiaEC2KeyName = a});
eiaEmrManagedSlaveSecurityGroup :: Lens' EC2InstanceAttributes (Maybe Text)
eiaEmrManagedSlaveSecurityGroup = lens _eiaEmrManagedSlaveSecurityGroup (\ s a -> s{_eiaEmrManagedSlaveSecurityGroup = a});
eiaAdditionalSlaveSecurityGroups :: Lens' EC2InstanceAttributes [Text]
eiaAdditionalSlaveSecurityGroups = lens _eiaAdditionalSlaveSecurityGroups (\ s a -> s{_eiaAdditionalSlaveSecurityGroups = a}) . _Default . _Coerce;
eiaIAMInstanceProfile :: Lens' EC2InstanceAttributes (Maybe Text)
eiaIAMInstanceProfile = lens _eiaIAMInstanceProfile (\ s a -> s{_eiaIAMInstanceProfile = a});
eiaAdditionalMasterSecurityGroups :: Lens' EC2InstanceAttributes [Text]
eiaAdditionalMasterSecurityGroups = lens _eiaAdditionalMasterSecurityGroups (\ s a -> s{_eiaAdditionalMasterSecurityGroups = a}) . _Default . _Coerce;
eiaEmrManagedMasterSecurityGroup :: Lens' EC2InstanceAttributes (Maybe Text)
eiaEmrManagedMasterSecurityGroup = lens _eiaEmrManagedMasterSecurityGroup (\ s a -> s{_eiaEmrManagedMasterSecurityGroup = a});
eiaEC2SubnetId :: Lens' EC2InstanceAttributes (Maybe Text)
eiaEC2SubnetId = lens _eiaEC2SubnetId (\ s a -> s{_eiaEC2SubnetId = a});
eiaEC2AvailabilityZone :: Lens' EC2InstanceAttributes (Maybe Text)
eiaEC2AvailabilityZone = lens _eiaEC2AvailabilityZone (\ s a -> s{_eiaEC2AvailabilityZone = a});
instance FromJSON EC2InstanceAttributes where
parseJSON
= withObject "EC2InstanceAttributes"
(\ x ->
EC2InstanceAttributes' <$>
(x .:? "Ec2KeyName") <*>
(x .:? "EmrManagedSlaveSecurityGroup")
<*>
(x .:? "AdditionalSlaveSecurityGroups" .!= mempty)
<*> (x .:? "IamInstanceProfile")
<*>
(x .:? "AdditionalMasterSecurityGroups" .!= mempty)
<*> (x .:? "EmrManagedMasterSecurityGroup")
<*> (x .:? "Ec2SubnetId")
<*> (x .:? "Ec2AvailabilityZone"))
data HadoopJARStepConfig = HadoopJARStepConfig'
{ _hjscArgs :: !(Maybe [Text])
, _hjscMainClass :: !(Maybe Text)
, _hjscProperties :: !(Maybe [KeyValue])
, _hjscJAR :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
hadoopJARStepConfig
:: Text
-> HadoopJARStepConfig
hadoopJARStepConfig pJAR_ =
HadoopJARStepConfig'
{ _hjscArgs = Nothing
, _hjscMainClass = Nothing
, _hjscProperties = Nothing
, _hjscJAR = pJAR_
}
hjscArgs :: Lens' HadoopJARStepConfig [Text]
hjscArgs = lens _hjscArgs (\ s a -> s{_hjscArgs = a}) . _Default . _Coerce;
hjscMainClass :: Lens' HadoopJARStepConfig (Maybe Text)
hjscMainClass = lens _hjscMainClass (\ s a -> s{_hjscMainClass = a});
hjscProperties :: Lens' HadoopJARStepConfig [KeyValue]
hjscProperties = lens _hjscProperties (\ s a -> s{_hjscProperties = a}) . _Default . _Coerce;
hjscJAR :: Lens' HadoopJARStepConfig Text
hjscJAR = lens _hjscJAR (\ s a -> s{_hjscJAR = a});
instance ToJSON HadoopJARStepConfig where
toJSON HadoopJARStepConfig'{..}
= object
(catMaybes
[("Args" .=) <$> _hjscArgs,
("MainClass" .=) <$> _hjscMainClass,
("Properties" .=) <$> _hjscProperties,
Just ("Jar" .= _hjscJAR)])
data HadoopStepConfig = HadoopStepConfig'
{ _hscArgs :: !(Maybe [Text])
, _hscJAR :: !(Maybe Text)
, _hscMainClass :: !(Maybe Text)
, _hscProperties :: !(Maybe (Map Text Text))
} deriving (Eq,Read,Show,Data,Typeable,Generic)
hadoopStepConfig
:: HadoopStepConfig
hadoopStepConfig =
HadoopStepConfig'
{ _hscArgs = Nothing
, _hscJAR = Nothing
, _hscMainClass = Nothing
, _hscProperties = Nothing
}
hscArgs :: Lens' HadoopStepConfig [Text]
hscArgs = lens _hscArgs (\ s a -> s{_hscArgs = a}) . _Default . _Coerce;
hscJAR :: Lens' HadoopStepConfig (Maybe Text)
hscJAR = lens _hscJAR (\ s a -> s{_hscJAR = a});
hscMainClass :: Lens' HadoopStepConfig (Maybe Text)
hscMainClass = lens _hscMainClass (\ s a -> s{_hscMainClass = a});
hscProperties :: Lens' HadoopStepConfig (HashMap Text Text)
hscProperties = lens _hscProperties (\ s a -> s{_hscProperties = a}) . _Default . _Map;
instance FromJSON HadoopStepConfig where
parseJSON
= withObject "HadoopStepConfig"
(\ x ->
HadoopStepConfig' <$>
(x .:? "Args" .!= mempty) <*> (x .:? "Jar") <*>
(x .:? "MainClass")
<*> (x .:? "Properties" .!= mempty))
data Instance = Instance'
{ _iStatus :: !(Maybe InstanceStatus)
, _iPublicDNSName :: !(Maybe Text)
, _iEC2InstanceId :: !(Maybe Text)
, _iPrivateIPAddress :: !(Maybe Text)
, _iId :: !(Maybe Text)
, _iPrivateDNSName :: !(Maybe Text)
, _iPublicIPAddress :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instance'
:: Instance
instance' =
Instance'
{ _iStatus = Nothing
, _iPublicDNSName = Nothing
, _iEC2InstanceId = Nothing
, _iPrivateIPAddress = Nothing
, _iId = Nothing
, _iPrivateDNSName = Nothing
, _iPublicIPAddress = Nothing
}
iStatus :: Lens' Instance (Maybe InstanceStatus)
iStatus = lens _iStatus (\ s a -> s{_iStatus = a});
iPublicDNSName :: Lens' Instance (Maybe Text)
iPublicDNSName = lens _iPublicDNSName (\ s a -> s{_iPublicDNSName = a});
iEC2InstanceId :: Lens' Instance (Maybe Text)
iEC2InstanceId = lens _iEC2InstanceId (\ s a -> s{_iEC2InstanceId = a});
iPrivateIPAddress :: Lens' Instance (Maybe Text)
iPrivateIPAddress = lens _iPrivateIPAddress (\ s a -> s{_iPrivateIPAddress = a});
iId :: Lens' Instance (Maybe Text)
iId = lens _iId (\ s a -> s{_iId = a});
iPrivateDNSName :: Lens' Instance (Maybe Text)
iPrivateDNSName = lens _iPrivateDNSName (\ s a -> s{_iPrivateDNSName = a});
iPublicIPAddress :: Lens' Instance (Maybe Text)
iPublicIPAddress = lens _iPublicIPAddress (\ s a -> s{_iPublicIPAddress = a});
instance FromJSON Instance where
parseJSON
= withObject "Instance"
(\ x ->
Instance' <$>
(x .:? "Status") <*> (x .:? "PublicDnsName") <*>
(x .:? "Ec2InstanceId")
<*> (x .:? "PrivateIpAddress")
<*> (x .:? "Id")
<*> (x .:? "PrivateDnsName")
<*> (x .:? "PublicIpAddress"))
data InstanceGroup = InstanceGroup'
{ _igStatus :: !(Maybe InstanceGroupStatus)
, _igBidPrice :: !(Maybe Text)
, _igRequestedInstanceCount :: !(Maybe Int)
, _igRunningInstanceCount :: !(Maybe Int)
, _igConfigurations :: !(Maybe [Configuration])
, _igInstanceGroupType :: !(Maybe InstanceGroupType)
, _igInstanceType :: !(Maybe Text)
, _igMarket :: !(Maybe MarketType)
, _igName :: !(Maybe Text)
, _igId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceGroup
:: InstanceGroup
instanceGroup =
InstanceGroup'
{ _igStatus = Nothing
, _igBidPrice = Nothing
, _igRequestedInstanceCount = Nothing
, _igRunningInstanceCount = Nothing
, _igConfigurations = Nothing
, _igInstanceGroupType = Nothing
, _igInstanceType = Nothing
, _igMarket = Nothing
, _igName = Nothing
, _igId = Nothing
}
igStatus :: Lens' InstanceGroup (Maybe InstanceGroupStatus)
igStatus = lens _igStatus (\ s a -> s{_igStatus = a});
igBidPrice :: Lens' InstanceGroup (Maybe Text)
igBidPrice = lens _igBidPrice (\ s a -> s{_igBidPrice = a});
igRequestedInstanceCount :: Lens' InstanceGroup (Maybe Int)
igRequestedInstanceCount = lens _igRequestedInstanceCount (\ s a -> s{_igRequestedInstanceCount = a});
igRunningInstanceCount :: Lens' InstanceGroup (Maybe Int)
igRunningInstanceCount = lens _igRunningInstanceCount (\ s a -> s{_igRunningInstanceCount = a});
igConfigurations :: Lens' InstanceGroup [Configuration]
igConfigurations = lens _igConfigurations (\ s a -> s{_igConfigurations = a}) . _Default . _Coerce;
igInstanceGroupType :: Lens' InstanceGroup (Maybe InstanceGroupType)
igInstanceGroupType = lens _igInstanceGroupType (\ s a -> s{_igInstanceGroupType = a});
igInstanceType :: Lens' InstanceGroup (Maybe Text)
igInstanceType = lens _igInstanceType (\ s a -> s{_igInstanceType = a});
igMarket :: Lens' InstanceGroup (Maybe MarketType)
igMarket = lens _igMarket (\ s a -> s{_igMarket = a});
igName :: Lens' InstanceGroup (Maybe Text)
igName = lens _igName (\ s a -> s{_igName = a});
igId :: Lens' InstanceGroup (Maybe Text)
igId = lens _igId (\ s a -> s{_igId = a});
instance FromJSON InstanceGroup where
parseJSON
= withObject "InstanceGroup"
(\ x ->
InstanceGroup' <$>
(x .:? "Status") <*> (x .:? "BidPrice") <*>
(x .:? "RequestedInstanceCount")
<*> (x .:? "RunningInstanceCount")
<*> (x .:? "Configurations" .!= mempty)
<*> (x .:? "InstanceGroupType")
<*> (x .:? "InstanceType")
<*> (x .:? "Market")
<*> (x .:? "Name")
<*> (x .:? "Id"))
data InstanceGroupConfig = InstanceGroupConfig'
{ _igcBidPrice :: !(Maybe Text)
, _igcConfigurations :: !(Maybe [Configuration])
, _igcMarket :: !(Maybe MarketType)
, _igcName :: !(Maybe Text)
, _igcInstanceRole :: !InstanceRoleType
, _igcInstanceType :: !Text
, _igcInstanceCount :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceGroupConfig
:: InstanceRoleType
-> Text
-> Int
-> InstanceGroupConfig
instanceGroupConfig pInstanceRole_ pInstanceType_ pInstanceCount_ =
InstanceGroupConfig'
{ _igcBidPrice = Nothing
, _igcConfigurations = Nothing
, _igcMarket = Nothing
, _igcName = Nothing
, _igcInstanceRole = pInstanceRole_
, _igcInstanceType = pInstanceType_
, _igcInstanceCount = pInstanceCount_
}
igcBidPrice :: Lens' InstanceGroupConfig (Maybe Text)
igcBidPrice = lens _igcBidPrice (\ s a -> s{_igcBidPrice = a});
igcConfigurations :: Lens' InstanceGroupConfig [Configuration]
igcConfigurations = lens _igcConfigurations (\ s a -> s{_igcConfigurations = a}) . _Default . _Coerce;
igcMarket :: Lens' InstanceGroupConfig (Maybe MarketType)
igcMarket = lens _igcMarket (\ s a -> s{_igcMarket = a});
igcName :: Lens' InstanceGroupConfig (Maybe Text)
igcName = lens _igcName (\ s a -> s{_igcName = a});
igcInstanceRole :: Lens' InstanceGroupConfig InstanceRoleType
igcInstanceRole = lens _igcInstanceRole (\ s a -> s{_igcInstanceRole = a});
igcInstanceType :: Lens' InstanceGroupConfig Text
igcInstanceType = lens _igcInstanceType (\ s a -> s{_igcInstanceType = a});
igcInstanceCount :: Lens' InstanceGroupConfig Int
igcInstanceCount = lens _igcInstanceCount (\ s a -> s{_igcInstanceCount = a});
instance ToJSON InstanceGroupConfig where
toJSON InstanceGroupConfig'{..}
= object
(catMaybes
[("BidPrice" .=) <$> _igcBidPrice,
("Configurations" .=) <$> _igcConfigurations,
("Market" .=) <$> _igcMarket,
("Name" .=) <$> _igcName,
Just ("InstanceRole" .= _igcInstanceRole),
Just ("InstanceType" .= _igcInstanceType),
Just ("InstanceCount" .= _igcInstanceCount)])
data InstanceGroupModifyConfig = InstanceGroupModifyConfig'
{ _igmcInstanceCount :: !(Maybe Int)
, _igmcEC2InstanceIdsToTerminate :: !(Maybe [Text])
, _igmcInstanceGroupId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceGroupModifyConfig
:: Text
-> InstanceGroupModifyConfig
instanceGroupModifyConfig pInstanceGroupId_ =
InstanceGroupModifyConfig'
{ _igmcInstanceCount = Nothing
, _igmcEC2InstanceIdsToTerminate = Nothing
, _igmcInstanceGroupId = pInstanceGroupId_
}
igmcInstanceCount :: Lens' InstanceGroupModifyConfig (Maybe Int)
igmcInstanceCount = lens _igmcInstanceCount (\ s a -> s{_igmcInstanceCount = a});
igmcEC2InstanceIdsToTerminate :: Lens' InstanceGroupModifyConfig [Text]
igmcEC2InstanceIdsToTerminate = lens _igmcEC2InstanceIdsToTerminate (\ s a -> s{_igmcEC2InstanceIdsToTerminate = a}) . _Default . _Coerce;
igmcInstanceGroupId :: Lens' InstanceGroupModifyConfig Text
igmcInstanceGroupId = lens _igmcInstanceGroupId (\ s a -> s{_igmcInstanceGroupId = a});
instance ToJSON InstanceGroupModifyConfig where
toJSON InstanceGroupModifyConfig'{..}
= object
(catMaybes
[("InstanceCount" .=) <$> _igmcInstanceCount,
("EC2InstanceIdsToTerminate" .=) <$>
_igmcEC2InstanceIdsToTerminate,
Just ("InstanceGroupId" .= _igmcInstanceGroupId)])
data InstanceGroupStateChangeReason = InstanceGroupStateChangeReason'
{ _igscrCode :: !(Maybe InstanceGroupStateChangeReasonCode)
, _igscrMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceGroupStateChangeReason
:: InstanceGroupStateChangeReason
instanceGroupStateChangeReason =
InstanceGroupStateChangeReason'
{ _igscrCode = Nothing
, _igscrMessage = Nothing
}
igscrCode :: Lens' InstanceGroupStateChangeReason (Maybe InstanceGroupStateChangeReasonCode)
igscrCode = lens _igscrCode (\ s a -> s{_igscrCode = a});
igscrMessage :: Lens' InstanceGroupStateChangeReason (Maybe Text)
igscrMessage = lens _igscrMessage (\ s a -> s{_igscrMessage = a});
instance FromJSON InstanceGroupStateChangeReason
where
parseJSON
= withObject "InstanceGroupStateChangeReason"
(\ x ->
InstanceGroupStateChangeReason' <$>
(x .:? "Code") <*> (x .:? "Message"))
data InstanceGroupStatus = InstanceGroupStatus'
{ _igsState :: !(Maybe InstanceGroupState)
, _igsStateChangeReason :: !(Maybe InstanceGroupStateChangeReason)
, _igsTimeline :: !(Maybe InstanceGroupTimeline)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceGroupStatus
:: InstanceGroupStatus
instanceGroupStatus =
InstanceGroupStatus'
{ _igsState = Nothing
, _igsStateChangeReason = Nothing
, _igsTimeline = Nothing
}
igsState :: Lens' InstanceGroupStatus (Maybe InstanceGroupState)
igsState = lens _igsState (\ s a -> s{_igsState = a});
igsStateChangeReason :: Lens' InstanceGroupStatus (Maybe InstanceGroupStateChangeReason)
igsStateChangeReason = lens _igsStateChangeReason (\ s a -> s{_igsStateChangeReason = a});
igsTimeline :: Lens' InstanceGroupStatus (Maybe InstanceGroupTimeline)
igsTimeline = lens _igsTimeline (\ s a -> s{_igsTimeline = a});
instance FromJSON InstanceGroupStatus where
parseJSON
= withObject "InstanceGroupStatus"
(\ x ->
InstanceGroupStatus' <$>
(x .:? "State") <*> (x .:? "StateChangeReason") <*>
(x .:? "Timeline"))
data InstanceGroupTimeline = InstanceGroupTimeline'
{ _igtReadyDateTime :: !(Maybe POSIX)
, _igtCreationDateTime :: !(Maybe POSIX)
, _igtEndDateTime :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceGroupTimeline
:: InstanceGroupTimeline
instanceGroupTimeline =
InstanceGroupTimeline'
{ _igtReadyDateTime = Nothing
, _igtCreationDateTime = Nothing
, _igtEndDateTime = Nothing
}
igtReadyDateTime :: Lens' InstanceGroupTimeline (Maybe UTCTime)
igtReadyDateTime = lens _igtReadyDateTime (\ s a -> s{_igtReadyDateTime = a}) . mapping _Time;
igtCreationDateTime :: Lens' InstanceGroupTimeline (Maybe UTCTime)
igtCreationDateTime = lens _igtCreationDateTime (\ s a -> s{_igtCreationDateTime = a}) . mapping _Time;
igtEndDateTime :: Lens' InstanceGroupTimeline (Maybe UTCTime)
igtEndDateTime = lens _igtEndDateTime (\ s a -> s{_igtEndDateTime = a}) . mapping _Time;
instance FromJSON InstanceGroupTimeline where
parseJSON
= withObject "InstanceGroupTimeline"
(\ x ->
InstanceGroupTimeline' <$>
(x .:? "ReadyDateTime") <*>
(x .:? "CreationDateTime")
<*> (x .:? "EndDateTime"))
data InstanceStateChangeReason = InstanceStateChangeReason'
{ _iscrCode :: !(Maybe InstanceStateChangeReasonCode)
, _iscrMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceStateChangeReason
:: InstanceStateChangeReason
instanceStateChangeReason =
InstanceStateChangeReason'
{ _iscrCode = Nothing
, _iscrMessage = Nothing
}
iscrCode :: Lens' InstanceStateChangeReason (Maybe InstanceStateChangeReasonCode)
iscrCode = lens _iscrCode (\ s a -> s{_iscrCode = a});
iscrMessage :: Lens' InstanceStateChangeReason (Maybe Text)
iscrMessage = lens _iscrMessage (\ s a -> s{_iscrMessage = a});
instance FromJSON InstanceStateChangeReason where
parseJSON
= withObject "InstanceStateChangeReason"
(\ x ->
InstanceStateChangeReason' <$>
(x .:? "Code") <*> (x .:? "Message"))
data InstanceStatus = InstanceStatus'
{ _isState :: !(Maybe InstanceState)
, _isStateChangeReason :: !(Maybe InstanceStateChangeReason)
, _isTimeline :: !(Maybe InstanceTimeline)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceStatus
:: InstanceStatus
instanceStatus =
InstanceStatus'
{ _isState = Nothing
, _isStateChangeReason = Nothing
, _isTimeline = Nothing
}
isState :: Lens' InstanceStatus (Maybe InstanceState)
isState = lens _isState (\ s a -> s{_isState = a});
isStateChangeReason :: Lens' InstanceStatus (Maybe InstanceStateChangeReason)
isStateChangeReason = lens _isStateChangeReason (\ s a -> s{_isStateChangeReason = a});
isTimeline :: Lens' InstanceStatus (Maybe InstanceTimeline)
isTimeline = lens _isTimeline (\ s a -> s{_isTimeline = a});
instance FromJSON InstanceStatus where
parseJSON
= withObject "InstanceStatus"
(\ x ->
InstanceStatus' <$>
(x .:? "State") <*> (x .:? "StateChangeReason") <*>
(x .:? "Timeline"))
data InstanceTimeline = InstanceTimeline'
{ _itReadyDateTime :: !(Maybe POSIX)
, _itCreationDateTime :: !(Maybe POSIX)
, _itEndDateTime :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
instanceTimeline
:: InstanceTimeline
instanceTimeline =
InstanceTimeline'
{ _itReadyDateTime = Nothing
, _itCreationDateTime = Nothing
, _itEndDateTime = Nothing
}
itReadyDateTime :: Lens' InstanceTimeline (Maybe UTCTime)
itReadyDateTime = lens _itReadyDateTime (\ s a -> s{_itReadyDateTime = a}) . mapping _Time;
itCreationDateTime :: Lens' InstanceTimeline (Maybe UTCTime)
itCreationDateTime = lens _itCreationDateTime (\ s a -> s{_itCreationDateTime = a}) . mapping _Time;
itEndDateTime :: Lens' InstanceTimeline (Maybe UTCTime)
itEndDateTime = lens _itEndDateTime (\ s a -> s{_itEndDateTime = a}) . mapping _Time;
instance FromJSON InstanceTimeline where
parseJSON
= withObject "InstanceTimeline"
(\ x ->
InstanceTimeline' <$>
(x .:? "ReadyDateTime") <*>
(x .:? "CreationDateTime")
<*> (x .:? "EndDateTime"))
data JobFlowInstancesConfig = JobFlowInstancesConfig'
{ _jficSlaveInstanceType :: !(Maybe Text)
, _jficEC2KeyName :: !(Maybe Text)
, _jficInstanceCount :: !(Maybe Int)
, _jficEmrManagedSlaveSecurityGroup :: !(Maybe Text)
, _jficAdditionalSlaveSecurityGroups :: !(Maybe [Text])
, _jficHadoopVersion :: !(Maybe Text)
, _jficAdditionalMasterSecurityGroups :: !(Maybe [Text])
, _jficEmrManagedMasterSecurityGroup :: !(Maybe Text)
, _jficEC2SubnetId :: !(Maybe Text)
, _jficMasterInstanceType :: !(Maybe Text)
, _jficInstanceGroups :: !(Maybe [InstanceGroupConfig])
, _jficKeepJobFlowAliveWhenNoSteps :: !(Maybe Bool)
, _jficTerminationProtected :: !(Maybe Bool)
, _jficPlacement :: !(Maybe PlacementType)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
jobFlowInstancesConfig
:: JobFlowInstancesConfig
jobFlowInstancesConfig =
JobFlowInstancesConfig'
{ _jficSlaveInstanceType = Nothing
, _jficEC2KeyName = Nothing
, _jficInstanceCount = Nothing
, _jficEmrManagedSlaveSecurityGroup = Nothing
, _jficAdditionalSlaveSecurityGroups = Nothing
, _jficHadoopVersion = Nothing
, _jficAdditionalMasterSecurityGroups = Nothing
, _jficEmrManagedMasterSecurityGroup = Nothing
, _jficEC2SubnetId = Nothing
, _jficMasterInstanceType = Nothing
, _jficInstanceGroups = Nothing
, _jficKeepJobFlowAliveWhenNoSteps = Nothing
, _jficTerminationProtected = Nothing
, _jficPlacement = Nothing
}
jficSlaveInstanceType :: Lens' JobFlowInstancesConfig (Maybe Text)
jficSlaveInstanceType = lens _jficSlaveInstanceType (\ s a -> s{_jficSlaveInstanceType = a});
jficEC2KeyName :: Lens' JobFlowInstancesConfig (Maybe Text)
jficEC2KeyName = lens _jficEC2KeyName (\ s a -> s{_jficEC2KeyName = a});
jficInstanceCount :: Lens' JobFlowInstancesConfig (Maybe Int)
jficInstanceCount = lens _jficInstanceCount (\ s a -> s{_jficInstanceCount = a});
jficEmrManagedSlaveSecurityGroup :: Lens' JobFlowInstancesConfig (Maybe Text)
jficEmrManagedSlaveSecurityGroup = lens _jficEmrManagedSlaveSecurityGroup (\ s a -> s{_jficEmrManagedSlaveSecurityGroup = a});
jficAdditionalSlaveSecurityGroups :: Lens' JobFlowInstancesConfig [Text]
jficAdditionalSlaveSecurityGroups = lens _jficAdditionalSlaveSecurityGroups (\ s a -> s{_jficAdditionalSlaveSecurityGroups = a}) . _Default . _Coerce;
jficHadoopVersion :: Lens' JobFlowInstancesConfig (Maybe Text)
jficHadoopVersion = lens _jficHadoopVersion (\ s a -> s{_jficHadoopVersion = a});
jficAdditionalMasterSecurityGroups :: Lens' JobFlowInstancesConfig [Text]
jficAdditionalMasterSecurityGroups = lens _jficAdditionalMasterSecurityGroups (\ s a -> s{_jficAdditionalMasterSecurityGroups = a}) . _Default . _Coerce;
jficEmrManagedMasterSecurityGroup :: Lens' JobFlowInstancesConfig (Maybe Text)
jficEmrManagedMasterSecurityGroup = lens _jficEmrManagedMasterSecurityGroup (\ s a -> s{_jficEmrManagedMasterSecurityGroup = a});
jficEC2SubnetId :: Lens' JobFlowInstancesConfig (Maybe Text)
jficEC2SubnetId = lens _jficEC2SubnetId (\ s a -> s{_jficEC2SubnetId = a});
jficMasterInstanceType :: Lens' JobFlowInstancesConfig (Maybe Text)
jficMasterInstanceType = lens _jficMasterInstanceType (\ s a -> s{_jficMasterInstanceType = a});
jficInstanceGroups :: Lens' JobFlowInstancesConfig [InstanceGroupConfig]
jficInstanceGroups = lens _jficInstanceGroups (\ s a -> s{_jficInstanceGroups = a}) . _Default . _Coerce;
jficKeepJobFlowAliveWhenNoSteps :: Lens' JobFlowInstancesConfig (Maybe Bool)
jficKeepJobFlowAliveWhenNoSteps = lens _jficKeepJobFlowAliveWhenNoSteps (\ s a -> s{_jficKeepJobFlowAliveWhenNoSteps = a});
jficTerminationProtected :: Lens' JobFlowInstancesConfig (Maybe Bool)
jficTerminationProtected = lens _jficTerminationProtected (\ s a -> s{_jficTerminationProtected = a});
jficPlacement :: Lens' JobFlowInstancesConfig (Maybe PlacementType)
jficPlacement = lens _jficPlacement (\ s a -> s{_jficPlacement = a});
instance ToJSON JobFlowInstancesConfig where
toJSON JobFlowInstancesConfig'{..}
= object
(catMaybes
[("SlaveInstanceType" .=) <$> _jficSlaveInstanceType,
("Ec2KeyName" .=) <$> _jficEC2KeyName,
("InstanceCount" .=) <$> _jficInstanceCount,
("EmrManagedSlaveSecurityGroup" .=) <$>
_jficEmrManagedSlaveSecurityGroup,
("AdditionalSlaveSecurityGroups" .=) <$>
_jficAdditionalSlaveSecurityGroups,
("HadoopVersion" .=) <$> _jficHadoopVersion,
("AdditionalMasterSecurityGroups" .=) <$>
_jficAdditionalMasterSecurityGroups,
("EmrManagedMasterSecurityGroup" .=) <$>
_jficEmrManagedMasterSecurityGroup,
("Ec2SubnetId" .=) <$> _jficEC2SubnetId,
("MasterInstanceType" .=) <$>
_jficMasterInstanceType,
("InstanceGroups" .=) <$> _jficInstanceGroups,
("KeepJobFlowAliveWhenNoSteps" .=) <$>
_jficKeepJobFlowAliveWhenNoSteps,
("TerminationProtected" .=) <$>
_jficTerminationProtected,
("Placement" .=) <$> _jficPlacement])
data KeyValue = KeyValue'
{ _kvValue :: !(Maybe Text)
, _kvKey :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
keyValue
:: KeyValue
keyValue =
KeyValue'
{ _kvValue = Nothing
, _kvKey = Nothing
}
kvValue :: Lens' KeyValue (Maybe Text)
kvValue = lens _kvValue (\ s a -> s{_kvValue = a});
kvKey :: Lens' KeyValue (Maybe Text)
kvKey = lens _kvKey (\ s a -> s{_kvKey = a});
instance ToJSON KeyValue where
toJSON KeyValue'{..}
= object
(catMaybes
[("Value" .=) <$> _kvValue, ("Key" .=) <$> _kvKey])
newtype PlacementType = PlacementType'
{ _ptAvailabilityZone :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
placementType
:: Text
-> PlacementType
placementType pAvailabilityZone_ =
PlacementType'
{ _ptAvailabilityZone = pAvailabilityZone_
}
ptAvailabilityZone :: Lens' PlacementType Text
ptAvailabilityZone = lens _ptAvailabilityZone (\ s a -> s{_ptAvailabilityZone = a});
instance ToJSON PlacementType where
toJSON PlacementType'{..}
= object
(catMaybes
[Just ("AvailabilityZone" .= _ptAvailabilityZone)])
data ScriptBootstrapActionConfig = ScriptBootstrapActionConfig'
{ _sbacArgs :: !(Maybe [Text])
, _sbacPath :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
scriptBootstrapActionConfig
:: Text
-> ScriptBootstrapActionConfig
scriptBootstrapActionConfig pPath_ =
ScriptBootstrapActionConfig'
{ _sbacArgs = Nothing
, _sbacPath = pPath_
}
sbacArgs :: Lens' ScriptBootstrapActionConfig [Text]
sbacArgs = lens _sbacArgs (\ s a -> s{_sbacArgs = a}) . _Default . _Coerce;
sbacPath :: Lens' ScriptBootstrapActionConfig Text
sbacPath = lens _sbacPath (\ s a -> s{_sbacPath = a});
instance ToJSON ScriptBootstrapActionConfig where
toJSON ScriptBootstrapActionConfig'{..}
= object
(catMaybes
[("Args" .=) <$> _sbacArgs,
Just ("Path" .= _sbacPath)])
data Step = Step'
{ _sStatus :: !(Maybe StepStatus)
, _sActionOnFailure :: !(Maybe ActionOnFailure)
, _sConfig :: !(Maybe HadoopStepConfig)
, _sName :: !(Maybe Text)
, _sId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
step
:: Step
step =
Step'
{ _sStatus = Nothing
, _sActionOnFailure = Nothing
, _sConfig = Nothing
, _sName = Nothing
, _sId = Nothing
}
sStatus :: Lens' Step (Maybe StepStatus)
sStatus = lens _sStatus (\ s a -> s{_sStatus = a});
sActionOnFailure :: Lens' Step (Maybe ActionOnFailure)
sActionOnFailure = lens _sActionOnFailure (\ s a -> s{_sActionOnFailure = a});
sConfig :: Lens' Step (Maybe HadoopStepConfig)
sConfig = lens _sConfig (\ s a -> s{_sConfig = a});
sName :: Lens' Step (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a});
sId :: Lens' Step (Maybe Text)
sId = lens _sId (\ s a -> s{_sId = a});
instance FromJSON Step where
parseJSON
= withObject "Step"
(\ x ->
Step' <$>
(x .:? "Status") <*> (x .:? "ActionOnFailure") <*>
(x .:? "Config")
<*> (x .:? "Name")
<*> (x .:? "Id"))
data StepConfig = StepConfig'
{ _scActionOnFailure :: !(Maybe ActionOnFailure)
, _scName :: !Text
, _scHadoopJARStep :: !HadoopJARStepConfig
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stepConfig
:: Text
-> HadoopJARStepConfig
-> StepConfig
stepConfig pName_ pHadoopJARStep_ =
StepConfig'
{ _scActionOnFailure = Nothing
, _scName = pName_
, _scHadoopJARStep = pHadoopJARStep_
}
scActionOnFailure :: Lens' StepConfig (Maybe ActionOnFailure)
scActionOnFailure = lens _scActionOnFailure (\ s a -> s{_scActionOnFailure = a});
scName :: Lens' StepConfig Text
scName = lens _scName (\ s a -> s{_scName = a});
scHadoopJARStep :: Lens' StepConfig HadoopJARStepConfig
scHadoopJARStep = lens _scHadoopJARStep (\ s a -> s{_scHadoopJARStep = a});
instance ToJSON StepConfig where
toJSON StepConfig'{..}
= object
(catMaybes
[("ActionOnFailure" .=) <$> _scActionOnFailure,
Just ("Name" .= _scName),
Just ("HadoopJarStep" .= _scHadoopJARStep)])
data StepStateChangeReason = StepStateChangeReason'
{ _sscrCode :: !(Maybe StepStateChangeReasonCode)
, _sscrMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stepStateChangeReason
:: StepStateChangeReason
stepStateChangeReason =
StepStateChangeReason'
{ _sscrCode = Nothing
, _sscrMessage = Nothing
}
sscrCode :: Lens' StepStateChangeReason (Maybe StepStateChangeReasonCode)
sscrCode = lens _sscrCode (\ s a -> s{_sscrCode = a});
sscrMessage :: Lens' StepStateChangeReason (Maybe Text)
sscrMessage = lens _sscrMessage (\ s a -> s{_sscrMessage = a});
instance FromJSON StepStateChangeReason where
parseJSON
= withObject "StepStateChangeReason"
(\ x ->
StepStateChangeReason' <$>
(x .:? "Code") <*> (x .:? "Message"))
data StepStatus = StepStatus'
{ _ssState :: !(Maybe StepState)
, _ssStateChangeReason :: !(Maybe StepStateChangeReason)
, _ssTimeline :: !(Maybe StepTimeline)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stepStatus
:: StepStatus
stepStatus =
StepStatus'
{ _ssState = Nothing
, _ssStateChangeReason = Nothing
, _ssTimeline = Nothing
}
ssState :: Lens' StepStatus (Maybe StepState)
ssState = lens _ssState (\ s a -> s{_ssState = a});
ssStateChangeReason :: Lens' StepStatus (Maybe StepStateChangeReason)
ssStateChangeReason = lens _ssStateChangeReason (\ s a -> s{_ssStateChangeReason = a});
ssTimeline :: Lens' StepStatus (Maybe StepTimeline)
ssTimeline = lens _ssTimeline (\ s a -> s{_ssTimeline = a});
instance FromJSON StepStatus where
parseJSON
= withObject "StepStatus"
(\ x ->
StepStatus' <$>
(x .:? "State") <*> (x .:? "StateChangeReason") <*>
(x .:? "Timeline"))
data StepSummary = StepSummary'
{ _ssStatus :: !(Maybe StepStatus)
, _ssActionOnFailure :: !(Maybe ActionOnFailure)
, _ssConfig :: !(Maybe HadoopStepConfig)
, _ssName :: !(Maybe Text)
, _ssId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stepSummary
:: StepSummary
stepSummary =
StepSummary'
{ _ssStatus = Nothing
, _ssActionOnFailure = Nothing
, _ssConfig = Nothing
, _ssName = Nothing
, _ssId = Nothing
}
ssStatus :: Lens' StepSummary (Maybe StepStatus)
ssStatus = lens _ssStatus (\ s a -> s{_ssStatus = a});
ssActionOnFailure :: Lens' StepSummary (Maybe ActionOnFailure)
ssActionOnFailure = lens _ssActionOnFailure (\ s a -> s{_ssActionOnFailure = a});
ssConfig :: Lens' StepSummary (Maybe HadoopStepConfig)
ssConfig = lens _ssConfig (\ s a -> s{_ssConfig = a});
ssName :: Lens' StepSummary (Maybe Text)
ssName = lens _ssName (\ s a -> s{_ssName = a});
ssId :: Lens' StepSummary (Maybe Text)
ssId = lens _ssId (\ s a -> s{_ssId = a});
instance FromJSON StepSummary where
parseJSON
= withObject "StepSummary"
(\ x ->
StepSummary' <$>
(x .:? "Status") <*> (x .:? "ActionOnFailure") <*>
(x .:? "Config")
<*> (x .:? "Name")
<*> (x .:? "Id"))
data StepTimeline = StepTimeline'
{ _stCreationDateTime :: !(Maybe POSIX)
, _stEndDateTime :: !(Maybe POSIX)
, _stStartDateTime :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stepTimeline
:: StepTimeline
stepTimeline =
StepTimeline'
{ _stCreationDateTime = Nothing
, _stEndDateTime = Nothing
, _stStartDateTime = Nothing
}
stCreationDateTime :: Lens' StepTimeline (Maybe UTCTime)
stCreationDateTime = lens _stCreationDateTime (\ s a -> s{_stCreationDateTime = a}) . mapping _Time;
stEndDateTime :: Lens' StepTimeline (Maybe UTCTime)
stEndDateTime = lens _stEndDateTime (\ s a -> s{_stEndDateTime = a}) . mapping _Time;
stStartDateTime :: Lens' StepTimeline (Maybe UTCTime)
stStartDateTime = lens _stStartDateTime (\ s a -> s{_stStartDateTime = a}) . mapping _Time;
instance FromJSON StepTimeline where
parseJSON
= withObject "StepTimeline"
(\ x ->
StepTimeline' <$>
(x .:? "CreationDateTime") <*> (x .:? "EndDateTime")
<*> (x .:? "StartDateTime"))
data SupportedProductConfig = SupportedProductConfig'
{ _spcArgs :: !(Maybe [Text])
, _spcName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
supportedProductConfig
:: SupportedProductConfig
supportedProductConfig =
SupportedProductConfig'
{ _spcArgs = Nothing
, _spcName = Nothing
}
spcArgs :: Lens' SupportedProductConfig [Text]
spcArgs = lens _spcArgs (\ s a -> s{_spcArgs = a}) . _Default . _Coerce;
spcName :: Lens' SupportedProductConfig (Maybe Text)
spcName = lens _spcName (\ s a -> s{_spcName = a});
instance ToJSON SupportedProductConfig where
toJSON SupportedProductConfig'{..}
= object
(catMaybes
[("Args" .=) <$> _spcArgs, ("Name" .=) <$> _spcName])
data Tag = Tag'
{ _tagValue :: !(Maybe Text)
, _tagKey :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
tag
:: Tag
tag =
Tag'
{ _tagValue = Nothing
, _tagKey = Nothing
}
tagValue :: Lens' Tag (Maybe Text)
tagValue = lens _tagValue (\ s a -> s{_tagValue = a});
tagKey :: Lens' Tag (Maybe Text)
tagKey = lens _tagKey (\ s a -> s{_tagKey = a});
instance FromJSON Tag where
parseJSON
= withObject "Tag"
(\ x -> Tag' <$> (x .:? "Value") <*> (x .:? "Key"))
instance ToJSON Tag where
toJSON Tag'{..}
= object
(catMaybes
[("Value" .=) <$> _tagValue, ("Key" .=) <$> _tagKey])