{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.IoT.Types.Product where
import Network.AWS.IoT.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
data Action = Action'
{ _aCloudwatchMetric :: !(Maybe CloudwatchMetricAction)
, _aCloudwatchAlarm :: !(Maybe CloudwatchAlarmAction)
, _aSns :: !(Maybe SNSAction)
, _aDynamoDB :: !(Maybe DynamoDBAction)
, _aFirehose :: !(Maybe FirehoseAction)
, _aLambda :: !(Maybe LambdaAction)
, _aKinesis :: !(Maybe KinesisAction)
, _aS3 :: !(Maybe S3Action)
, _aElasticsearch :: !(Maybe ElasticsearchAction)
, _aRepublish :: !(Maybe RepublishAction)
, _aSqs :: !(Maybe SqsAction)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
action
:: Action
action =
Action'
{ _aCloudwatchMetric = Nothing
, _aCloudwatchAlarm = Nothing
, _aSns = Nothing
, _aDynamoDB = Nothing
, _aFirehose = Nothing
, _aLambda = Nothing
, _aKinesis = Nothing
, _aS3 = Nothing
, _aElasticsearch = Nothing
, _aRepublish = Nothing
, _aSqs = Nothing
}
aCloudwatchMetric :: Lens' Action (Maybe CloudwatchMetricAction)
aCloudwatchMetric = lens _aCloudwatchMetric (\ s a -> s{_aCloudwatchMetric = a});
aCloudwatchAlarm :: Lens' Action (Maybe CloudwatchAlarmAction)
aCloudwatchAlarm = lens _aCloudwatchAlarm (\ s a -> s{_aCloudwatchAlarm = a});
aSns :: Lens' Action (Maybe SNSAction)
aSns = lens _aSns (\ s a -> s{_aSns = a});
aDynamoDB :: Lens' Action (Maybe DynamoDBAction)
aDynamoDB = lens _aDynamoDB (\ s a -> s{_aDynamoDB = a});
aFirehose :: Lens' Action (Maybe FirehoseAction)
aFirehose = lens _aFirehose (\ s a -> s{_aFirehose = a});
aLambda :: Lens' Action (Maybe LambdaAction)
aLambda = lens _aLambda (\ s a -> s{_aLambda = a});
aKinesis :: Lens' Action (Maybe KinesisAction)
aKinesis = lens _aKinesis (\ s a -> s{_aKinesis = a});
aS3 :: Lens' Action (Maybe S3Action)
aS3 = lens _aS3 (\ s a -> s{_aS3 = a});
aElasticsearch :: Lens' Action (Maybe ElasticsearchAction)
aElasticsearch = lens _aElasticsearch (\ s a -> s{_aElasticsearch = a});
aRepublish :: Lens' Action (Maybe RepublishAction)
aRepublish = lens _aRepublish (\ s a -> s{_aRepublish = a});
aSqs :: Lens' Action (Maybe SqsAction)
aSqs = lens _aSqs (\ s a -> s{_aSqs = a});
instance FromJSON Action where
parseJSON
= withObject "Action"
(\ x ->
Action' <$>
(x .:? "cloudwatchMetric") <*>
(x .:? "cloudwatchAlarm")
<*> (x .:? "sns")
<*> (x .:? "dynamoDB")
<*> (x .:? "firehose")
<*> (x .:? "lambda")
<*> (x .:? "kinesis")
<*> (x .:? "s3")
<*> (x .:? "elasticsearch")
<*> (x .:? "republish")
<*> (x .:? "sqs"))
instance Hashable Action
instance NFData Action
instance ToJSON Action where
toJSON Action'{..}
= object
(catMaybes
[("cloudwatchMetric" .=) <$> _aCloudwatchMetric,
("cloudwatchAlarm" .=) <$> _aCloudwatchAlarm,
("sns" .=) <$> _aSns, ("dynamoDB" .=) <$> _aDynamoDB,
("firehose" .=) <$> _aFirehose,
("lambda" .=) <$> _aLambda,
("kinesis" .=) <$> _aKinesis, ("s3" .=) <$> _aS3,
("elasticsearch" .=) <$> _aElasticsearch,
("republish" .=) <$> _aRepublish,
("sqs" .=) <$> _aSqs])
data AttributePayload = AttributePayload'
{ _apAttributes :: !(Maybe (Map Text Text))
, _apMerge :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attributePayload
:: AttributePayload
attributePayload =
AttributePayload'
{ _apAttributes = Nothing
, _apMerge = Nothing
}
apAttributes :: Lens' AttributePayload (HashMap Text Text)
apAttributes = lens _apAttributes (\ s a -> s{_apAttributes = a}) . _Default . _Map;
apMerge :: Lens' AttributePayload (Maybe Bool)
apMerge = lens _apMerge (\ s a -> s{_apMerge = a});
instance Hashable AttributePayload
instance NFData AttributePayload
instance ToJSON AttributePayload where
toJSON AttributePayload'{..}
= object
(catMaybes
[("attributes" .=) <$> _apAttributes,
("merge" .=) <$> _apMerge])
data CACertificate = CACertificate'
{ _cacStatus :: !(Maybe CACertificateStatus)
, _cacCertificateARN :: !(Maybe Text)
, _cacCertificateId :: !(Maybe Text)
, _cacCreationDate :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cACertificate
:: CACertificate
cACertificate =
CACertificate'
{ _cacStatus = Nothing
, _cacCertificateARN = Nothing
, _cacCertificateId = Nothing
, _cacCreationDate = Nothing
}
cacStatus :: Lens' CACertificate (Maybe CACertificateStatus)
cacStatus = lens _cacStatus (\ s a -> s{_cacStatus = a});
cacCertificateARN :: Lens' CACertificate (Maybe Text)
cacCertificateARN = lens _cacCertificateARN (\ s a -> s{_cacCertificateARN = a});
cacCertificateId :: Lens' CACertificate (Maybe Text)
cacCertificateId = lens _cacCertificateId (\ s a -> s{_cacCertificateId = a});
cacCreationDate :: Lens' CACertificate (Maybe UTCTime)
cacCreationDate = lens _cacCreationDate (\ s a -> s{_cacCreationDate = a}) . mapping _Time;
instance FromJSON CACertificate where
parseJSON
= withObject "CACertificate"
(\ x ->
CACertificate' <$>
(x .:? "status") <*> (x .:? "certificateArn") <*>
(x .:? "certificateId")
<*> (x .:? "creationDate"))
instance Hashable CACertificate
instance NFData CACertificate
data CACertificateDescription = CACertificateDescription'
{ _cacdStatus :: !(Maybe CACertificateStatus)
, _cacdOwnedBy :: !(Maybe Text)
, _cacdCertificatePem :: !(Maybe Text)
, _cacdCertificateARN :: !(Maybe Text)
, _cacdCertificateId :: !(Maybe Text)
, _cacdAutoRegistrationStatus :: !(Maybe AutoRegistrationStatus)
, _cacdCreationDate :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cACertificateDescription
:: CACertificateDescription
cACertificateDescription =
CACertificateDescription'
{ _cacdStatus = Nothing
, _cacdOwnedBy = Nothing
, _cacdCertificatePem = Nothing
, _cacdCertificateARN = Nothing
, _cacdCertificateId = Nothing
, _cacdAutoRegistrationStatus = Nothing
, _cacdCreationDate = Nothing
}
cacdStatus :: Lens' CACertificateDescription (Maybe CACertificateStatus)
cacdStatus = lens _cacdStatus (\ s a -> s{_cacdStatus = a});
cacdOwnedBy :: Lens' CACertificateDescription (Maybe Text)
cacdOwnedBy = lens _cacdOwnedBy (\ s a -> s{_cacdOwnedBy = a});
cacdCertificatePem :: Lens' CACertificateDescription (Maybe Text)
cacdCertificatePem = lens _cacdCertificatePem (\ s a -> s{_cacdCertificatePem = a});
cacdCertificateARN :: Lens' CACertificateDescription (Maybe Text)
cacdCertificateARN = lens _cacdCertificateARN (\ s a -> s{_cacdCertificateARN = a});
cacdCertificateId :: Lens' CACertificateDescription (Maybe Text)
cacdCertificateId = lens _cacdCertificateId (\ s a -> s{_cacdCertificateId = a});
cacdAutoRegistrationStatus :: Lens' CACertificateDescription (Maybe AutoRegistrationStatus)
cacdAutoRegistrationStatus = lens _cacdAutoRegistrationStatus (\ s a -> s{_cacdAutoRegistrationStatus = a});
cacdCreationDate :: Lens' CACertificateDescription (Maybe UTCTime)
cacdCreationDate = lens _cacdCreationDate (\ s a -> s{_cacdCreationDate = a}) . mapping _Time;
instance FromJSON CACertificateDescription where
parseJSON
= withObject "CACertificateDescription"
(\ x ->
CACertificateDescription' <$>
(x .:? "status") <*> (x .:? "ownedBy") <*>
(x .:? "certificatePem")
<*> (x .:? "certificateArn")
<*> (x .:? "certificateId")
<*> (x .:? "autoRegistrationStatus")
<*> (x .:? "creationDate"))
instance Hashable CACertificateDescription
instance NFData CACertificateDescription
data Certificate = Certificate'
{ _cStatus :: !(Maybe CertificateStatus)
, _cCertificateARN :: !(Maybe Text)
, _cCertificateId :: !(Maybe Text)
, _cCreationDate :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
certificate
:: Certificate
certificate =
Certificate'
{ _cStatus = Nothing
, _cCertificateARN = Nothing
, _cCertificateId = Nothing
, _cCreationDate = Nothing
}
cStatus :: Lens' Certificate (Maybe CertificateStatus)
cStatus = lens _cStatus (\ s a -> s{_cStatus = a});
cCertificateARN :: Lens' Certificate (Maybe Text)
cCertificateARN = lens _cCertificateARN (\ s a -> s{_cCertificateARN = a});
cCertificateId :: Lens' Certificate (Maybe Text)
cCertificateId = lens _cCertificateId (\ s a -> s{_cCertificateId = a});
cCreationDate :: Lens' Certificate (Maybe UTCTime)
cCreationDate = lens _cCreationDate (\ s a -> s{_cCreationDate = a}) . mapping _Time;
instance FromJSON Certificate where
parseJSON
= withObject "Certificate"
(\ x ->
Certificate' <$>
(x .:? "status") <*> (x .:? "certificateArn") <*>
(x .:? "certificateId")
<*> (x .:? "creationDate"))
instance Hashable Certificate
instance NFData Certificate
data CertificateDescription = CertificateDescription'
{ _cdStatus :: !(Maybe CertificateStatus)
, _cdOwnedBy :: !(Maybe Text)
, _cdLastModifiedDate :: !(Maybe POSIX)
, _cdCaCertificateId :: !(Maybe Text)
, _cdPreviousOwnedBy :: !(Maybe Text)
, _cdCertificatePem :: !(Maybe Text)
, _cdCertificateARN :: !(Maybe Text)
, _cdCertificateId :: !(Maybe Text)
, _cdCreationDate :: !(Maybe POSIX)
, _cdTransferData :: !(Maybe TransferData)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
certificateDescription
:: CertificateDescription
certificateDescription =
CertificateDescription'
{ _cdStatus = Nothing
, _cdOwnedBy = Nothing
, _cdLastModifiedDate = Nothing
, _cdCaCertificateId = Nothing
, _cdPreviousOwnedBy = Nothing
, _cdCertificatePem = Nothing
, _cdCertificateARN = Nothing
, _cdCertificateId = Nothing
, _cdCreationDate = Nothing
, _cdTransferData = Nothing
}
cdStatus :: Lens' CertificateDescription (Maybe CertificateStatus)
cdStatus = lens _cdStatus (\ s a -> s{_cdStatus = a});
cdOwnedBy :: Lens' CertificateDescription (Maybe Text)
cdOwnedBy = lens _cdOwnedBy (\ s a -> s{_cdOwnedBy = a});
cdLastModifiedDate :: Lens' CertificateDescription (Maybe UTCTime)
cdLastModifiedDate = lens _cdLastModifiedDate (\ s a -> s{_cdLastModifiedDate = a}) . mapping _Time;
cdCaCertificateId :: Lens' CertificateDescription (Maybe Text)
cdCaCertificateId = lens _cdCaCertificateId (\ s a -> s{_cdCaCertificateId = a});
cdPreviousOwnedBy :: Lens' CertificateDescription (Maybe Text)
cdPreviousOwnedBy = lens _cdPreviousOwnedBy (\ s a -> s{_cdPreviousOwnedBy = a});
cdCertificatePem :: Lens' CertificateDescription (Maybe Text)
cdCertificatePem = lens _cdCertificatePem (\ s a -> s{_cdCertificatePem = a});
cdCertificateARN :: Lens' CertificateDescription (Maybe Text)
cdCertificateARN = lens _cdCertificateARN (\ s a -> s{_cdCertificateARN = a});
cdCertificateId :: Lens' CertificateDescription (Maybe Text)
cdCertificateId = lens _cdCertificateId (\ s a -> s{_cdCertificateId = a});
cdCreationDate :: Lens' CertificateDescription (Maybe UTCTime)
cdCreationDate = lens _cdCreationDate (\ s a -> s{_cdCreationDate = a}) . mapping _Time;
cdTransferData :: Lens' CertificateDescription (Maybe TransferData)
cdTransferData = lens _cdTransferData (\ s a -> s{_cdTransferData = a});
instance FromJSON CertificateDescription where
parseJSON
= withObject "CertificateDescription"
(\ x ->
CertificateDescription' <$>
(x .:? "status") <*> (x .:? "ownedBy") <*>
(x .:? "lastModifiedDate")
<*> (x .:? "caCertificateId")
<*> (x .:? "previousOwnedBy")
<*> (x .:? "certificatePem")
<*> (x .:? "certificateArn")
<*> (x .:? "certificateId")
<*> (x .:? "creationDate")
<*> (x .:? "transferData"))
instance Hashable CertificateDescription
instance NFData CertificateDescription
data CloudwatchAlarmAction = CloudwatchAlarmAction'
{ _caaRoleARN :: !Text
, _caaAlarmName :: !Text
, _caaStateReason :: !Text
, _caaStateValue :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cloudwatchAlarmAction
:: Text
-> Text
-> Text
-> Text
-> CloudwatchAlarmAction
cloudwatchAlarmAction pRoleARN_ pAlarmName_ pStateReason_ pStateValue_ =
CloudwatchAlarmAction'
{ _caaRoleARN = pRoleARN_
, _caaAlarmName = pAlarmName_
, _caaStateReason = pStateReason_
, _caaStateValue = pStateValue_
}
caaRoleARN :: Lens' CloudwatchAlarmAction Text
caaRoleARN = lens _caaRoleARN (\ s a -> s{_caaRoleARN = a});
caaAlarmName :: Lens' CloudwatchAlarmAction Text
caaAlarmName = lens _caaAlarmName (\ s a -> s{_caaAlarmName = a});
caaStateReason :: Lens' CloudwatchAlarmAction Text
caaStateReason = lens _caaStateReason (\ s a -> s{_caaStateReason = a});
caaStateValue :: Lens' CloudwatchAlarmAction Text
caaStateValue = lens _caaStateValue (\ s a -> s{_caaStateValue = a});
instance FromJSON CloudwatchAlarmAction where
parseJSON
= withObject "CloudwatchAlarmAction"
(\ x ->
CloudwatchAlarmAction' <$>
(x .: "roleArn") <*> (x .: "alarmName") <*>
(x .: "stateReason")
<*> (x .: "stateValue"))
instance Hashable CloudwatchAlarmAction
instance NFData CloudwatchAlarmAction
instance ToJSON CloudwatchAlarmAction where
toJSON CloudwatchAlarmAction'{..}
= object
(catMaybes
[Just ("roleArn" .= _caaRoleARN),
Just ("alarmName" .= _caaAlarmName),
Just ("stateReason" .= _caaStateReason),
Just ("stateValue" .= _caaStateValue)])
data CloudwatchMetricAction = CloudwatchMetricAction'
{ _cmaMetricTimestamp :: !(Maybe Text)
, _cmaRoleARN :: !Text
, _cmaMetricNamespace :: !Text
, _cmaMetricName :: !Text
, _cmaMetricValue :: !Text
, _cmaMetricUnit :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
cloudwatchMetricAction
:: Text
-> Text
-> Text
-> Text
-> Text
-> CloudwatchMetricAction
cloudwatchMetricAction pRoleARN_ pMetricNamespace_ pMetricName_ pMetricValue_ pMetricUnit_ =
CloudwatchMetricAction'
{ _cmaMetricTimestamp = Nothing
, _cmaRoleARN = pRoleARN_
, _cmaMetricNamespace = pMetricNamespace_
, _cmaMetricName = pMetricName_
, _cmaMetricValue = pMetricValue_
, _cmaMetricUnit = pMetricUnit_
}
cmaMetricTimestamp :: Lens' CloudwatchMetricAction (Maybe Text)
cmaMetricTimestamp = lens _cmaMetricTimestamp (\ s a -> s{_cmaMetricTimestamp = a});
cmaRoleARN :: Lens' CloudwatchMetricAction Text
cmaRoleARN = lens _cmaRoleARN (\ s a -> s{_cmaRoleARN = a});
cmaMetricNamespace :: Lens' CloudwatchMetricAction Text
cmaMetricNamespace = lens _cmaMetricNamespace (\ s a -> s{_cmaMetricNamespace = a});
cmaMetricName :: Lens' CloudwatchMetricAction Text
cmaMetricName = lens _cmaMetricName (\ s a -> s{_cmaMetricName = a});
cmaMetricValue :: Lens' CloudwatchMetricAction Text
cmaMetricValue = lens _cmaMetricValue (\ s a -> s{_cmaMetricValue = a});
cmaMetricUnit :: Lens' CloudwatchMetricAction Text
cmaMetricUnit = lens _cmaMetricUnit (\ s a -> s{_cmaMetricUnit = a});
instance FromJSON CloudwatchMetricAction where
parseJSON
= withObject "CloudwatchMetricAction"
(\ x ->
CloudwatchMetricAction' <$>
(x .:? "metricTimestamp") <*> (x .: "roleArn") <*>
(x .: "metricNamespace")
<*> (x .: "metricName")
<*> (x .: "metricValue")
<*> (x .: "metricUnit"))
instance Hashable CloudwatchMetricAction
instance NFData CloudwatchMetricAction
instance ToJSON CloudwatchMetricAction where
toJSON CloudwatchMetricAction'{..}
= object
(catMaybes
[("metricTimestamp" .=) <$> _cmaMetricTimestamp,
Just ("roleArn" .= _cmaRoleARN),
Just ("metricNamespace" .= _cmaMetricNamespace),
Just ("metricName" .= _cmaMetricName),
Just ("metricValue" .= _cmaMetricValue),
Just ("metricUnit" .= _cmaMetricUnit)])
data DynamoDBAction = DynamoDBAction'
{ _ddaHashKeyType :: !(Maybe DynamoKeyType)
, _ddaOperation :: !(Maybe Text)
, _ddaRangeKeyType :: !(Maybe DynamoKeyType)
, _ddaPayloadField :: !(Maybe Text)
, _ddaRangeKeyField :: !(Maybe Text)
, _ddaRangeKeyValue :: !(Maybe Text)
, _ddaTableName :: !Text
, _ddaRoleARN :: !Text
, _ddaHashKeyField :: !Text
, _ddaHashKeyValue :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
dynamoDBAction
:: Text
-> Text
-> Text
-> Text
-> DynamoDBAction
dynamoDBAction pTableName_ pRoleARN_ pHashKeyField_ pHashKeyValue_ =
DynamoDBAction'
{ _ddaHashKeyType = Nothing
, _ddaOperation = Nothing
, _ddaRangeKeyType = Nothing
, _ddaPayloadField = Nothing
, _ddaRangeKeyField = Nothing
, _ddaRangeKeyValue = Nothing
, _ddaTableName = pTableName_
, _ddaRoleARN = pRoleARN_
, _ddaHashKeyField = pHashKeyField_
, _ddaHashKeyValue = pHashKeyValue_
}
ddaHashKeyType :: Lens' DynamoDBAction (Maybe DynamoKeyType)
ddaHashKeyType = lens _ddaHashKeyType (\ s a -> s{_ddaHashKeyType = a});
ddaOperation :: Lens' DynamoDBAction (Maybe Text)
ddaOperation = lens _ddaOperation (\ s a -> s{_ddaOperation = a});
ddaRangeKeyType :: Lens' DynamoDBAction (Maybe DynamoKeyType)
ddaRangeKeyType = lens _ddaRangeKeyType (\ s a -> s{_ddaRangeKeyType = a});
ddaPayloadField :: Lens' DynamoDBAction (Maybe Text)
ddaPayloadField = lens _ddaPayloadField (\ s a -> s{_ddaPayloadField = a});
ddaRangeKeyField :: Lens' DynamoDBAction (Maybe Text)
ddaRangeKeyField = lens _ddaRangeKeyField (\ s a -> s{_ddaRangeKeyField = a});
ddaRangeKeyValue :: Lens' DynamoDBAction (Maybe Text)
ddaRangeKeyValue = lens _ddaRangeKeyValue (\ s a -> s{_ddaRangeKeyValue = a});
ddaTableName :: Lens' DynamoDBAction Text
ddaTableName = lens _ddaTableName (\ s a -> s{_ddaTableName = a});
ddaRoleARN :: Lens' DynamoDBAction Text
ddaRoleARN = lens _ddaRoleARN (\ s a -> s{_ddaRoleARN = a});
ddaHashKeyField :: Lens' DynamoDBAction Text
ddaHashKeyField = lens _ddaHashKeyField (\ s a -> s{_ddaHashKeyField = a});
ddaHashKeyValue :: Lens' DynamoDBAction Text
ddaHashKeyValue = lens _ddaHashKeyValue (\ s a -> s{_ddaHashKeyValue = a});
instance FromJSON DynamoDBAction where
parseJSON
= withObject "DynamoDBAction"
(\ x ->
DynamoDBAction' <$>
(x .:? "hashKeyType") <*> (x .:? "operation") <*>
(x .:? "rangeKeyType")
<*> (x .:? "payloadField")
<*> (x .:? "rangeKeyField")
<*> (x .:? "rangeKeyValue")
<*> (x .: "tableName")
<*> (x .: "roleArn")
<*> (x .: "hashKeyField")
<*> (x .: "hashKeyValue"))
instance Hashable DynamoDBAction
instance NFData DynamoDBAction
instance ToJSON DynamoDBAction where
toJSON DynamoDBAction'{..}
= object
(catMaybes
[("hashKeyType" .=) <$> _ddaHashKeyType,
("operation" .=) <$> _ddaOperation,
("rangeKeyType" .=) <$> _ddaRangeKeyType,
("payloadField" .=) <$> _ddaPayloadField,
("rangeKeyField" .=) <$> _ddaRangeKeyField,
("rangeKeyValue" .=) <$> _ddaRangeKeyValue,
Just ("tableName" .= _ddaTableName),
Just ("roleArn" .= _ddaRoleARN),
Just ("hashKeyField" .= _ddaHashKeyField),
Just ("hashKeyValue" .= _ddaHashKeyValue)])
data ElasticsearchAction = ElasticsearchAction'
{ _eaRoleARN :: !Text
, _eaEndpoint :: !Text
, _eaIndex :: !Text
, _eaType :: !Text
, _eaId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
elasticsearchAction
:: Text
-> Text
-> Text
-> Text
-> Text
-> ElasticsearchAction
elasticsearchAction pRoleARN_ pEndpoint_ pIndex_ pType_ pId_ =
ElasticsearchAction'
{ _eaRoleARN = pRoleARN_
, _eaEndpoint = pEndpoint_
, _eaIndex = pIndex_
, _eaType = pType_
, _eaId = pId_
}
eaRoleARN :: Lens' ElasticsearchAction Text
eaRoleARN = lens _eaRoleARN (\ s a -> s{_eaRoleARN = a});
eaEndpoint :: Lens' ElasticsearchAction Text
eaEndpoint = lens _eaEndpoint (\ s a -> s{_eaEndpoint = a});
eaIndex :: Lens' ElasticsearchAction Text
eaIndex = lens _eaIndex (\ s a -> s{_eaIndex = a});
eaType :: Lens' ElasticsearchAction Text
eaType = lens _eaType (\ s a -> s{_eaType = a});
eaId :: Lens' ElasticsearchAction Text
eaId = lens _eaId (\ s a -> s{_eaId = a});
instance FromJSON ElasticsearchAction where
parseJSON
= withObject "ElasticsearchAction"
(\ x ->
ElasticsearchAction' <$>
(x .: "roleArn") <*> (x .: "endpoint") <*>
(x .: "index")
<*> (x .: "type")
<*> (x .: "id"))
instance Hashable ElasticsearchAction
instance NFData ElasticsearchAction
instance ToJSON ElasticsearchAction where
toJSON ElasticsearchAction'{..}
= object
(catMaybes
[Just ("roleArn" .= _eaRoleARN),
Just ("endpoint" .= _eaEndpoint),
Just ("index" .= _eaIndex), Just ("type" .= _eaType),
Just ("id" .= _eaId)])
data FirehoseAction = FirehoseAction'
{ _faSeparator :: !(Maybe Text)
, _faRoleARN :: !Text
, _faDeliveryStreamName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
firehoseAction
:: Text
-> Text
-> FirehoseAction
firehoseAction pRoleARN_ pDeliveryStreamName_ =
FirehoseAction'
{ _faSeparator = Nothing
, _faRoleARN = pRoleARN_
, _faDeliveryStreamName = pDeliveryStreamName_
}
faSeparator :: Lens' FirehoseAction (Maybe Text)
faSeparator = lens _faSeparator (\ s a -> s{_faSeparator = a});
faRoleARN :: Lens' FirehoseAction Text
faRoleARN = lens _faRoleARN (\ s a -> s{_faRoleARN = a});
faDeliveryStreamName :: Lens' FirehoseAction Text
faDeliveryStreamName = lens _faDeliveryStreamName (\ s a -> s{_faDeliveryStreamName = a});
instance FromJSON FirehoseAction where
parseJSON
= withObject "FirehoseAction"
(\ x ->
FirehoseAction' <$>
(x .:? "separator") <*> (x .: "roleArn") <*>
(x .: "deliveryStreamName"))
instance Hashable FirehoseAction
instance NFData FirehoseAction
instance ToJSON FirehoseAction where
toJSON FirehoseAction'{..}
= object
(catMaybes
[("separator" .=) <$> _faSeparator,
Just ("roleArn" .= _faRoleARN),
Just
("deliveryStreamName" .= _faDeliveryStreamName)])
data KeyPair = KeyPair'
{ _kpPrivateKey :: !(Maybe (Sensitive Text))
, _kpPublicKey :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
keyPair
:: KeyPair
keyPair =
KeyPair'
{ _kpPrivateKey = Nothing
, _kpPublicKey = Nothing
}
kpPrivateKey :: Lens' KeyPair (Maybe Text)
kpPrivateKey = lens _kpPrivateKey (\ s a -> s{_kpPrivateKey = a}) . mapping _Sensitive;
kpPublicKey :: Lens' KeyPair (Maybe Text)
kpPublicKey = lens _kpPublicKey (\ s a -> s{_kpPublicKey = a});
instance FromJSON KeyPair where
parseJSON
= withObject "KeyPair"
(\ x ->
KeyPair' <$>
(x .:? "PrivateKey") <*> (x .:? "PublicKey"))
instance Hashable KeyPair
instance NFData KeyPair
data KinesisAction = KinesisAction'
{ _kaPartitionKey :: !(Maybe Text)
, _kaRoleARN :: !Text
, _kaStreamName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
kinesisAction
:: Text
-> Text
-> KinesisAction
kinesisAction pRoleARN_ pStreamName_ =
KinesisAction'
{ _kaPartitionKey = Nothing
, _kaRoleARN = pRoleARN_
, _kaStreamName = pStreamName_
}
kaPartitionKey :: Lens' KinesisAction (Maybe Text)
kaPartitionKey = lens _kaPartitionKey (\ s a -> s{_kaPartitionKey = a});
kaRoleARN :: Lens' KinesisAction Text
kaRoleARN = lens _kaRoleARN (\ s a -> s{_kaRoleARN = a});
kaStreamName :: Lens' KinesisAction Text
kaStreamName = lens _kaStreamName (\ s a -> s{_kaStreamName = a});
instance FromJSON KinesisAction where
parseJSON
= withObject "KinesisAction"
(\ x ->
KinesisAction' <$>
(x .:? "partitionKey") <*> (x .: "roleArn") <*>
(x .: "streamName"))
instance Hashable KinesisAction
instance NFData KinesisAction
instance ToJSON KinesisAction where
toJSON KinesisAction'{..}
= object
(catMaybes
[("partitionKey" .=) <$> _kaPartitionKey,
Just ("roleArn" .= _kaRoleARN),
Just ("streamName" .= _kaStreamName)])
newtype LambdaAction = LambdaAction'
{ _laFunctionARN :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
lambdaAction
:: Text
-> LambdaAction
lambdaAction pFunctionARN_ =
LambdaAction'
{ _laFunctionARN = pFunctionARN_
}
laFunctionARN :: Lens' LambdaAction Text
laFunctionARN = lens _laFunctionARN (\ s a -> s{_laFunctionARN = a});
instance FromJSON LambdaAction where
parseJSON
= withObject "LambdaAction"
(\ x -> LambdaAction' <$> (x .: "functionArn"))
instance Hashable LambdaAction
instance NFData LambdaAction
instance ToJSON LambdaAction where
toJSON LambdaAction'{..}
= object
(catMaybes [Just ("functionArn" .= _laFunctionARN)])
data LoggingOptionsPayload = LoggingOptionsPayload'
{ _lopLogLevel :: !(Maybe LogLevel)
, _lopRoleARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
loggingOptionsPayload
:: Text
-> LoggingOptionsPayload
loggingOptionsPayload pRoleARN_ =
LoggingOptionsPayload'
{ _lopLogLevel = Nothing
, _lopRoleARN = pRoleARN_
}
lopLogLevel :: Lens' LoggingOptionsPayload (Maybe LogLevel)
lopLogLevel = lens _lopLogLevel (\ s a -> s{_lopLogLevel = a});
lopRoleARN :: Lens' LoggingOptionsPayload Text
lopRoleARN = lens _lopRoleARN (\ s a -> s{_lopRoleARN = a});
instance Hashable LoggingOptionsPayload
instance NFData LoggingOptionsPayload
instance ToJSON LoggingOptionsPayload where
toJSON LoggingOptionsPayload'{..}
= object
(catMaybes
[("logLevel" .=) <$> _lopLogLevel,
Just ("roleArn" .= _lopRoleARN)])
data OutgoingCertificate = OutgoingCertificate'
{ _ocTransferDate :: !(Maybe POSIX)
, _ocCertificateARN :: !(Maybe Text)
, _ocCertificateId :: !(Maybe Text)
, _ocTransferredTo :: !(Maybe Text)
, _ocCreationDate :: !(Maybe POSIX)
, _ocTransferMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
outgoingCertificate
:: OutgoingCertificate
outgoingCertificate =
OutgoingCertificate'
{ _ocTransferDate = Nothing
, _ocCertificateARN = Nothing
, _ocCertificateId = Nothing
, _ocTransferredTo = Nothing
, _ocCreationDate = Nothing
, _ocTransferMessage = Nothing
}
ocTransferDate :: Lens' OutgoingCertificate (Maybe UTCTime)
ocTransferDate = lens _ocTransferDate (\ s a -> s{_ocTransferDate = a}) . mapping _Time;
ocCertificateARN :: Lens' OutgoingCertificate (Maybe Text)
ocCertificateARN = lens _ocCertificateARN (\ s a -> s{_ocCertificateARN = a});
ocCertificateId :: Lens' OutgoingCertificate (Maybe Text)
ocCertificateId = lens _ocCertificateId (\ s a -> s{_ocCertificateId = a});
ocTransferredTo :: Lens' OutgoingCertificate (Maybe Text)
ocTransferredTo = lens _ocTransferredTo (\ s a -> s{_ocTransferredTo = a});
ocCreationDate :: Lens' OutgoingCertificate (Maybe UTCTime)
ocCreationDate = lens _ocCreationDate (\ s a -> s{_ocCreationDate = a}) . mapping _Time;
ocTransferMessage :: Lens' OutgoingCertificate (Maybe Text)
ocTransferMessage = lens _ocTransferMessage (\ s a -> s{_ocTransferMessage = a});
instance FromJSON OutgoingCertificate where
parseJSON
= withObject "OutgoingCertificate"
(\ x ->
OutgoingCertificate' <$>
(x .:? "transferDate") <*> (x .:? "certificateArn")
<*> (x .:? "certificateId")
<*> (x .:? "transferredTo")
<*> (x .:? "creationDate")
<*> (x .:? "transferMessage"))
instance Hashable OutgoingCertificate
instance NFData OutgoingCertificate
data Policy = Policy'
{ _pPolicyName :: !(Maybe Text)
, _pPolicyARN :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
policy
:: Policy
policy =
Policy'
{ _pPolicyName = Nothing
, _pPolicyARN = Nothing
}
pPolicyName :: Lens' Policy (Maybe Text)
pPolicyName = lens _pPolicyName (\ s a -> s{_pPolicyName = a});
pPolicyARN :: Lens' Policy (Maybe Text)
pPolicyARN = lens _pPolicyARN (\ s a -> s{_pPolicyARN = a});
instance FromJSON Policy where
parseJSON
= withObject "Policy"
(\ x ->
Policy' <$>
(x .:? "policyName") <*> (x .:? "policyArn"))
instance Hashable Policy
instance NFData Policy
data PolicyVersion = PolicyVersion'
{ _pvVersionId :: !(Maybe Text)
, _pvCreateDate :: !(Maybe POSIX)
, _pvIsDefaultVersion :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
policyVersion
:: PolicyVersion
policyVersion =
PolicyVersion'
{ _pvVersionId = Nothing
, _pvCreateDate = Nothing
, _pvIsDefaultVersion = Nothing
}
pvVersionId :: Lens' PolicyVersion (Maybe Text)
pvVersionId = lens _pvVersionId (\ s a -> s{_pvVersionId = a});
pvCreateDate :: Lens' PolicyVersion (Maybe UTCTime)
pvCreateDate = lens _pvCreateDate (\ s a -> s{_pvCreateDate = a}) . mapping _Time;
pvIsDefaultVersion :: Lens' PolicyVersion (Maybe Bool)
pvIsDefaultVersion = lens _pvIsDefaultVersion (\ s a -> s{_pvIsDefaultVersion = a});
instance FromJSON PolicyVersion where
parseJSON
= withObject "PolicyVersion"
(\ x ->
PolicyVersion' <$>
(x .:? "versionId") <*> (x .:? "createDate") <*>
(x .:? "isDefaultVersion"))
instance Hashable PolicyVersion
instance NFData PolicyVersion
data RepublishAction = RepublishAction'
{ _raRoleARN :: !Text
, _raTopic :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
republishAction
:: Text
-> Text
-> RepublishAction
republishAction pRoleARN_ pTopic_ =
RepublishAction'
{ _raRoleARN = pRoleARN_
, _raTopic = pTopic_
}
raRoleARN :: Lens' RepublishAction Text
raRoleARN = lens _raRoleARN (\ s a -> s{_raRoleARN = a});
raTopic :: Lens' RepublishAction Text
raTopic = lens _raTopic (\ s a -> s{_raTopic = a});
instance FromJSON RepublishAction where
parseJSON
= withObject "RepublishAction"
(\ x ->
RepublishAction' <$>
(x .: "roleArn") <*> (x .: "topic"))
instance Hashable RepublishAction
instance NFData RepublishAction
instance ToJSON RepublishAction where
toJSON RepublishAction'{..}
= object
(catMaybes
[Just ("roleArn" .= _raRoleARN),
Just ("topic" .= _raTopic)])
data S3Action = S3Action'
{ _sRoleARN :: !Text
, _sBucketName :: !Text
, _sKey :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
s3Action
:: Text
-> Text
-> Text
-> S3Action
s3Action pRoleARN_ pBucketName_ pKey_ =
S3Action'
{ _sRoleARN = pRoleARN_
, _sBucketName = pBucketName_
, _sKey = pKey_
}
sRoleARN :: Lens' S3Action Text
sRoleARN = lens _sRoleARN (\ s a -> s{_sRoleARN = a});
sBucketName :: Lens' S3Action Text
sBucketName = lens _sBucketName (\ s a -> s{_sBucketName = a});
sKey :: Lens' S3Action Text
sKey = lens _sKey (\ s a -> s{_sKey = a});
instance FromJSON S3Action where
parseJSON
= withObject "S3Action"
(\ x ->
S3Action' <$>
(x .: "roleArn") <*> (x .: "bucketName") <*>
(x .: "key"))
instance Hashable S3Action
instance NFData S3Action
instance ToJSON S3Action where
toJSON S3Action'{..}
= object
(catMaybes
[Just ("roleArn" .= _sRoleARN),
Just ("bucketName" .= _sBucketName),
Just ("key" .= _sKey)])
data SNSAction = SNSAction'
{ _snsaMessageFormat :: !(Maybe MessageFormat)
, _snsaTargetARN :: !Text
, _snsaRoleARN :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
snsAction
:: Text
-> Text
-> SNSAction
snsAction pTargetARN_ pRoleARN_ =
SNSAction'
{ _snsaMessageFormat = Nothing
, _snsaTargetARN = pTargetARN_
, _snsaRoleARN = pRoleARN_
}
snsaMessageFormat :: Lens' SNSAction (Maybe MessageFormat)
snsaMessageFormat = lens _snsaMessageFormat (\ s a -> s{_snsaMessageFormat = a});
snsaTargetARN :: Lens' SNSAction Text
snsaTargetARN = lens _snsaTargetARN (\ s a -> s{_snsaTargetARN = a});
snsaRoleARN :: Lens' SNSAction Text
snsaRoleARN = lens _snsaRoleARN (\ s a -> s{_snsaRoleARN = a});
instance FromJSON SNSAction where
parseJSON
= withObject "SNSAction"
(\ x ->
SNSAction' <$>
(x .:? "messageFormat") <*> (x .: "targetArn") <*>
(x .: "roleArn"))
instance Hashable SNSAction
instance NFData SNSAction
instance ToJSON SNSAction where
toJSON SNSAction'{..}
= object
(catMaybes
[("messageFormat" .=) <$> _snsaMessageFormat,
Just ("targetArn" .= _snsaTargetARN),
Just ("roleArn" .= _snsaRoleARN)])
data SqsAction = SqsAction'
{ _saUseBase64 :: !(Maybe Bool)
, _saRoleARN :: !Text
, _saQueueURL :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
sqsAction
:: Text
-> Text
-> SqsAction
sqsAction pRoleARN_ pQueueURL_ =
SqsAction'
{ _saUseBase64 = Nothing
, _saRoleARN = pRoleARN_
, _saQueueURL = pQueueURL_
}
saUseBase64 :: Lens' SqsAction (Maybe Bool)
saUseBase64 = lens _saUseBase64 (\ s a -> s{_saUseBase64 = a});
saRoleARN :: Lens' SqsAction Text
saRoleARN = lens _saRoleARN (\ s a -> s{_saRoleARN = a});
saQueueURL :: Lens' SqsAction Text
saQueueURL = lens _saQueueURL (\ s a -> s{_saQueueURL = a});
instance FromJSON SqsAction where
parseJSON
= withObject "SqsAction"
(\ x ->
SqsAction' <$>
(x .:? "useBase64") <*> (x .: "roleArn") <*>
(x .: "queueUrl"))
instance Hashable SqsAction
instance NFData SqsAction
instance ToJSON SqsAction where
toJSON SqsAction'{..}
= object
(catMaybes
[("useBase64" .=) <$> _saUseBase64,
Just ("roleArn" .= _saRoleARN),
Just ("queueUrl" .= _saQueueURL)])
data ThingAttribute = ThingAttribute'
{ _taThingTypeName :: !(Maybe Text)
, _taAttributes :: !(Maybe (Map Text Text))
, _taVersion :: !(Maybe Integer)
, _taThingName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
thingAttribute
:: ThingAttribute
thingAttribute =
ThingAttribute'
{ _taThingTypeName = Nothing
, _taAttributes = Nothing
, _taVersion = Nothing
, _taThingName = Nothing
}
taThingTypeName :: Lens' ThingAttribute (Maybe Text)
taThingTypeName = lens _taThingTypeName (\ s a -> s{_taThingTypeName = a});
taAttributes :: Lens' ThingAttribute (HashMap Text Text)
taAttributes = lens _taAttributes (\ s a -> s{_taAttributes = a}) . _Default . _Map;
taVersion :: Lens' ThingAttribute (Maybe Integer)
taVersion = lens _taVersion (\ s a -> s{_taVersion = a});
taThingName :: Lens' ThingAttribute (Maybe Text)
taThingName = lens _taThingName (\ s a -> s{_taThingName = a});
instance FromJSON ThingAttribute where
parseJSON
= withObject "ThingAttribute"
(\ x ->
ThingAttribute' <$>
(x .:? "thingTypeName") <*>
(x .:? "attributes" .!= mempty)
<*> (x .:? "version")
<*> (x .:? "thingName"))
instance Hashable ThingAttribute
instance NFData ThingAttribute
data ThingTypeDefinition = ThingTypeDefinition'
{ _ttdThingTypeProperties :: !(Maybe ThingTypeProperties)
, _ttdThingTypeName :: !(Maybe Text)
, _ttdThingTypeMetadata :: !(Maybe ThingTypeMetadata)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
thingTypeDefinition
:: ThingTypeDefinition
thingTypeDefinition =
ThingTypeDefinition'
{ _ttdThingTypeProperties = Nothing
, _ttdThingTypeName = Nothing
, _ttdThingTypeMetadata = Nothing
}
ttdThingTypeProperties :: Lens' ThingTypeDefinition (Maybe ThingTypeProperties)
ttdThingTypeProperties = lens _ttdThingTypeProperties (\ s a -> s{_ttdThingTypeProperties = a});
ttdThingTypeName :: Lens' ThingTypeDefinition (Maybe Text)
ttdThingTypeName = lens _ttdThingTypeName (\ s a -> s{_ttdThingTypeName = a});
ttdThingTypeMetadata :: Lens' ThingTypeDefinition (Maybe ThingTypeMetadata)
ttdThingTypeMetadata = lens _ttdThingTypeMetadata (\ s a -> s{_ttdThingTypeMetadata = a});
instance FromJSON ThingTypeDefinition where
parseJSON
= withObject "ThingTypeDefinition"
(\ x ->
ThingTypeDefinition' <$>
(x .:? "thingTypeProperties") <*>
(x .:? "thingTypeName")
<*> (x .:? "thingTypeMetadata"))
instance Hashable ThingTypeDefinition
instance NFData ThingTypeDefinition
data ThingTypeMetadata = ThingTypeMetadata'
{ _ttmDeprecationDate :: !(Maybe POSIX)
, _ttmCreationDate :: !(Maybe POSIX)
, _ttmDeprecated :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
thingTypeMetadata
:: ThingTypeMetadata
thingTypeMetadata =
ThingTypeMetadata'
{ _ttmDeprecationDate = Nothing
, _ttmCreationDate = Nothing
, _ttmDeprecated = Nothing
}
ttmDeprecationDate :: Lens' ThingTypeMetadata (Maybe UTCTime)
ttmDeprecationDate = lens _ttmDeprecationDate (\ s a -> s{_ttmDeprecationDate = a}) . mapping _Time;
ttmCreationDate :: Lens' ThingTypeMetadata (Maybe UTCTime)
ttmCreationDate = lens _ttmCreationDate (\ s a -> s{_ttmCreationDate = a}) . mapping _Time;
ttmDeprecated :: Lens' ThingTypeMetadata (Maybe Bool)
ttmDeprecated = lens _ttmDeprecated (\ s a -> s{_ttmDeprecated = a});
instance FromJSON ThingTypeMetadata where
parseJSON
= withObject "ThingTypeMetadata"
(\ x ->
ThingTypeMetadata' <$>
(x .:? "deprecationDate") <*> (x .:? "creationDate")
<*> (x .:? "deprecated"))
instance Hashable ThingTypeMetadata
instance NFData ThingTypeMetadata
data ThingTypeProperties = ThingTypeProperties'
{ _ttpSearchableAttributes :: !(Maybe [Text])
, _ttpThingTypeDescription :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
thingTypeProperties
:: ThingTypeProperties
thingTypeProperties =
ThingTypeProperties'
{ _ttpSearchableAttributes = Nothing
, _ttpThingTypeDescription = Nothing
}
ttpSearchableAttributes :: Lens' ThingTypeProperties [Text]
ttpSearchableAttributes = lens _ttpSearchableAttributes (\ s a -> s{_ttpSearchableAttributes = a}) . _Default . _Coerce;
ttpThingTypeDescription :: Lens' ThingTypeProperties (Maybe Text)
ttpThingTypeDescription = lens _ttpThingTypeDescription (\ s a -> s{_ttpThingTypeDescription = a});
instance FromJSON ThingTypeProperties where
parseJSON
= withObject "ThingTypeProperties"
(\ x ->
ThingTypeProperties' <$>
(x .:? "searchableAttributes" .!= mempty) <*>
(x .:? "thingTypeDescription"))
instance Hashable ThingTypeProperties
instance NFData ThingTypeProperties
instance ToJSON ThingTypeProperties where
toJSON ThingTypeProperties'{..}
= object
(catMaybes
[("searchableAttributes" .=) <$>
_ttpSearchableAttributes,
("thingTypeDescription" .=) <$>
_ttpThingTypeDescription])
data TopicRule = TopicRule'
{ _trCreatedAt :: !(Maybe POSIX)
, _trActions :: !(Maybe [Action])
, _trAwsIotSqlVersion :: !(Maybe Text)
, _trRuleDisabled :: !(Maybe Bool)
, _trRuleName :: !(Maybe Text)
, _trSql :: !(Maybe Text)
, _trDescription :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
topicRule
:: TopicRule
topicRule =
TopicRule'
{ _trCreatedAt = Nothing
, _trActions = Nothing
, _trAwsIotSqlVersion = Nothing
, _trRuleDisabled = Nothing
, _trRuleName = Nothing
, _trSql = Nothing
, _trDescription = Nothing
}
trCreatedAt :: Lens' TopicRule (Maybe UTCTime)
trCreatedAt = lens _trCreatedAt (\ s a -> s{_trCreatedAt = a}) . mapping _Time;
trActions :: Lens' TopicRule [Action]
trActions = lens _trActions (\ s a -> s{_trActions = a}) . _Default . _Coerce;
trAwsIotSqlVersion :: Lens' TopicRule (Maybe Text)
trAwsIotSqlVersion = lens _trAwsIotSqlVersion (\ s a -> s{_trAwsIotSqlVersion = a});
trRuleDisabled :: Lens' TopicRule (Maybe Bool)
trRuleDisabled = lens _trRuleDisabled (\ s a -> s{_trRuleDisabled = a});
trRuleName :: Lens' TopicRule (Maybe Text)
trRuleName = lens _trRuleName (\ s a -> s{_trRuleName = a});
trSql :: Lens' TopicRule (Maybe Text)
trSql = lens _trSql (\ s a -> s{_trSql = a});
trDescription :: Lens' TopicRule (Maybe Text)
trDescription = lens _trDescription (\ s a -> s{_trDescription = a});
instance FromJSON TopicRule where
parseJSON
= withObject "TopicRule"
(\ x ->
TopicRule' <$>
(x .:? "createdAt") <*> (x .:? "actions" .!= mempty)
<*> (x .:? "awsIotSqlVersion")
<*> (x .:? "ruleDisabled")
<*> (x .:? "ruleName")
<*> (x .:? "sql")
<*> (x .:? "description"))
instance Hashable TopicRule
instance NFData TopicRule
data TopicRuleListItem = TopicRuleListItem'
{ _trliCreatedAt :: !(Maybe POSIX)
, _trliRuleDisabled :: !(Maybe Bool)
, _trliRuleName :: !(Maybe Text)
, _trliRuleARN :: !(Maybe Text)
, _trliTopicPattern :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
topicRuleListItem
:: TopicRuleListItem
topicRuleListItem =
TopicRuleListItem'
{ _trliCreatedAt = Nothing
, _trliRuleDisabled = Nothing
, _trliRuleName = Nothing
, _trliRuleARN = Nothing
, _trliTopicPattern = Nothing
}
trliCreatedAt :: Lens' TopicRuleListItem (Maybe UTCTime)
trliCreatedAt = lens _trliCreatedAt (\ s a -> s{_trliCreatedAt = a}) . mapping _Time;
trliRuleDisabled :: Lens' TopicRuleListItem (Maybe Bool)
trliRuleDisabled = lens _trliRuleDisabled (\ s a -> s{_trliRuleDisabled = a});
trliRuleName :: Lens' TopicRuleListItem (Maybe Text)
trliRuleName = lens _trliRuleName (\ s a -> s{_trliRuleName = a});
trliRuleARN :: Lens' TopicRuleListItem (Maybe Text)
trliRuleARN = lens _trliRuleARN (\ s a -> s{_trliRuleARN = a});
trliTopicPattern :: Lens' TopicRuleListItem (Maybe Text)
trliTopicPattern = lens _trliTopicPattern (\ s a -> s{_trliTopicPattern = a});
instance FromJSON TopicRuleListItem where
parseJSON
= withObject "TopicRuleListItem"
(\ x ->
TopicRuleListItem' <$>
(x .:? "createdAt") <*> (x .:? "ruleDisabled") <*>
(x .:? "ruleName")
<*> (x .:? "ruleArn")
<*> (x .:? "topicPattern"))
instance Hashable TopicRuleListItem
instance NFData TopicRuleListItem
data TopicRulePayload = TopicRulePayload'
{ _trpAwsIotSqlVersion :: !(Maybe Text)
, _trpRuleDisabled :: !(Maybe Bool)
, _trpDescription :: !(Maybe Text)
, _trpSql :: !Text
, _trpActions :: ![Action]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
topicRulePayload
:: Text
-> TopicRulePayload
topicRulePayload pSql_ =
TopicRulePayload'
{ _trpAwsIotSqlVersion = Nothing
, _trpRuleDisabled = Nothing
, _trpDescription = Nothing
, _trpSql = pSql_
, _trpActions = mempty
}
trpAwsIotSqlVersion :: Lens' TopicRulePayload (Maybe Text)
trpAwsIotSqlVersion = lens _trpAwsIotSqlVersion (\ s a -> s{_trpAwsIotSqlVersion = a});
trpRuleDisabled :: Lens' TopicRulePayload (Maybe Bool)
trpRuleDisabled = lens _trpRuleDisabled (\ s a -> s{_trpRuleDisabled = a});
trpDescription :: Lens' TopicRulePayload (Maybe Text)
trpDescription = lens _trpDescription (\ s a -> s{_trpDescription = a});
trpSql :: Lens' TopicRulePayload Text
trpSql = lens _trpSql (\ s a -> s{_trpSql = a});
trpActions :: Lens' TopicRulePayload [Action]
trpActions = lens _trpActions (\ s a -> s{_trpActions = a}) . _Coerce;
instance Hashable TopicRulePayload
instance NFData TopicRulePayload
instance ToJSON TopicRulePayload where
toJSON TopicRulePayload'{..}
= object
(catMaybes
[("awsIotSqlVersion" .=) <$> _trpAwsIotSqlVersion,
("ruleDisabled" .=) <$> _trpRuleDisabled,
("description" .=) <$> _trpDescription,
Just ("sql" .= _trpSql),
Just ("actions" .= _trpActions)])
data TransferData = TransferData'
{ _tdTransferDate :: !(Maybe POSIX)
, _tdAcceptDate :: !(Maybe POSIX)
, _tdTransferMessage :: !(Maybe Text)
, _tdRejectDate :: !(Maybe POSIX)
, _tdRejectReason :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
transferData
:: TransferData
transferData =
TransferData'
{ _tdTransferDate = Nothing
, _tdAcceptDate = Nothing
, _tdTransferMessage = Nothing
, _tdRejectDate = Nothing
, _tdRejectReason = Nothing
}
tdTransferDate :: Lens' TransferData (Maybe UTCTime)
tdTransferDate = lens _tdTransferDate (\ s a -> s{_tdTransferDate = a}) . mapping _Time;
tdAcceptDate :: Lens' TransferData (Maybe UTCTime)
tdAcceptDate = lens _tdAcceptDate (\ s a -> s{_tdAcceptDate = a}) . mapping _Time;
tdTransferMessage :: Lens' TransferData (Maybe Text)
tdTransferMessage = lens _tdTransferMessage (\ s a -> s{_tdTransferMessage = a});
tdRejectDate :: Lens' TransferData (Maybe UTCTime)
tdRejectDate = lens _tdRejectDate (\ s a -> s{_tdRejectDate = a}) . mapping _Time;
tdRejectReason :: Lens' TransferData (Maybe Text)
tdRejectReason = lens _tdRejectReason (\ s a -> s{_tdRejectReason = a});
instance FromJSON TransferData where
parseJSON
= withObject "TransferData"
(\ x ->
TransferData' <$>
(x .:? "transferDate") <*> (x .:? "acceptDate") <*>
(x .:? "transferMessage")
<*> (x .:? "rejectDate")
<*> (x .:? "rejectReason"))
instance Hashable TransferData
instance NFData TransferData