module Network.AWS.Support.Types
(
Support
, JSONError
, TrustedAdvisorResourcesSummary
, trustedAdvisorResourcesSummary
, tarsResourcesFlagged
, tarsResourcesIgnored
, tarsResourcesProcessed
, tarsResourcesSuppressed
, TrustedAdvisorCategorySpecificSummary
, trustedAdvisorCategorySpecificSummary
, tacssCostOptimizing
, Communication
, communication
, cAttachmentSet
, cBody
, cCaseId
, cSubmittedBy
, cTimeCreated
, Category
, category
, cCode
, cName
, TrustedAdvisorCheckSummary
, trustedAdvisorCheckSummary
, tacsCategorySpecificSummary
, tacsCheckId
, tacsHasFlaggedResources
, tacsResourcesSummary
, tacsStatus
, tacsTimestamp
, AttachmentDetails
, attachmentDetails
, adAttachmentId
, adFileName
, TrustedAdvisorCheckResult
, trustedAdvisorCheckResult
, tacrCategorySpecificSummary
, tacrCheckId
, tacrFlaggedResources
, tacrResourcesSummary
, tacrStatus
, tacrTimestamp
, TrustedAdvisorCheckDescription
, trustedAdvisorCheckDescription
, tacdCategory
, tacdDescription
, tacdId
, tacdMetadata
, tacdName
, Attachment
, attachment
, aData
, aFileName
, RecentCaseCommunications
, recentCaseCommunications
, rccCommunications
, rccNextToken
, SupportService
, supportService
, ssCategories
, ssCode
, ssName
, TrustedAdvisorResourceDetail
, trustedAdvisorResourceDetail
, tardIsSuppressed
, tardMetadata
, tardRegion
, tardResourceId
, tardStatus
, TrustedAdvisorCostOptimizingSummary
, trustedAdvisorCostOptimizingSummary
, tacosEstimatedMonthlySavings
, tacosEstimatedPercentMonthlySavings
, SeverityLevel
, severityLevel
, slCode
, slName
, CaseDetails
, caseDetails
, cdCaseId
, cdCategoryCode
, cdCcEmailAddresses
, cdDisplayId
, cdLanguage
, cdRecentCommunications
, cdServiceCode
, cdSeverityCode
, cdStatus
, cdSubject
, cdSubmittedBy
, cdTimeCreated
, TrustedAdvisorCheckRefreshStatus
, trustedAdvisorCheckRefreshStatus
, tacrsCheckId
, tacrsMillisUntilNextRefreshable
, tacrsStatus
) where
import Network.AWS.Prelude
import Network.AWS.Signing
import qualified GHC.Exts
data Support
instance AWSService Support where
type Sg Support = V4
type Er Support = JSONError
service = service'
where
service' :: Service Support
service' = Service
{ _svcAbbrev = "Support"
, _svcPrefix = "support"
, _svcVersion = "2013-04-15"
, _svcTargetPrefix = Just "AWSSupport_20130415"
, _svcJSONVersion = Just "1.1"
, _svcHandle = handle
, _svcRetry = retry
}
handle :: Status
-> Maybe (LazyByteString -> ServiceError JSONError)
handle = jsonError statusSuccess service'
retry :: Retry Support
retry = Exponential
{ _retryBase = 0.05
, _retryGrowth = 2
, _retryAttempts = 5
, _retryCheck = check
}
check :: Status
-> JSONError
-> Bool
check (statusCode -> s) (awsErrorCode -> e)
| s == 500 = True
| s == 509 = True
| s == 503 = True
| otherwise = False
data TrustedAdvisorResourcesSummary = TrustedAdvisorResourcesSummary
{ _tarsResourcesFlagged :: Integer
, _tarsResourcesIgnored :: Integer
, _tarsResourcesProcessed :: Integer
, _tarsResourcesSuppressed :: Integer
} deriving (Eq, Ord, Show)
trustedAdvisorResourcesSummary :: Integer
-> Integer
-> Integer
-> Integer
-> TrustedAdvisorResourcesSummary
trustedAdvisorResourcesSummary p1 p2 p3 p4 = TrustedAdvisorResourcesSummary
{ _tarsResourcesProcessed = p1
, _tarsResourcesFlagged = p2
, _tarsResourcesIgnored = p3
, _tarsResourcesSuppressed = p4
}
tarsResourcesFlagged :: Lens' TrustedAdvisorResourcesSummary Integer
tarsResourcesFlagged =
lens _tarsResourcesFlagged (\s a -> s { _tarsResourcesFlagged = a })
tarsResourcesIgnored :: Lens' TrustedAdvisorResourcesSummary Integer
tarsResourcesIgnored =
lens _tarsResourcesIgnored (\s a -> s { _tarsResourcesIgnored = a })
tarsResourcesProcessed :: Lens' TrustedAdvisorResourcesSummary Integer
tarsResourcesProcessed =
lens _tarsResourcesProcessed (\s a -> s { _tarsResourcesProcessed = a })
tarsResourcesSuppressed :: Lens' TrustedAdvisorResourcesSummary Integer
tarsResourcesSuppressed =
lens _tarsResourcesSuppressed (\s a -> s { _tarsResourcesSuppressed = a })
instance FromJSON TrustedAdvisorResourcesSummary where
parseJSON = withObject "TrustedAdvisorResourcesSummary" $ \o -> TrustedAdvisorResourcesSummary
<$> o .: "resourcesFlagged"
<*> o .: "resourcesIgnored"
<*> o .: "resourcesProcessed"
<*> o .: "resourcesSuppressed"
instance ToJSON TrustedAdvisorResourcesSummary where
toJSON TrustedAdvisorResourcesSummary{..} = object
[ "resourcesProcessed" .= _tarsResourcesProcessed
, "resourcesFlagged" .= _tarsResourcesFlagged
, "resourcesIgnored" .= _tarsResourcesIgnored
, "resourcesSuppressed" .= _tarsResourcesSuppressed
]
newtype TrustedAdvisorCategorySpecificSummary = TrustedAdvisorCategorySpecificSummary
{ _tacssCostOptimizing :: Maybe TrustedAdvisorCostOptimizingSummary
} deriving (Eq, Show)
trustedAdvisorCategorySpecificSummary :: TrustedAdvisorCategorySpecificSummary
trustedAdvisorCategorySpecificSummary = TrustedAdvisorCategorySpecificSummary
{ _tacssCostOptimizing = Nothing
}
tacssCostOptimizing :: Lens' TrustedAdvisorCategorySpecificSummary (Maybe TrustedAdvisorCostOptimizingSummary)
tacssCostOptimizing =
lens _tacssCostOptimizing (\s a -> s { _tacssCostOptimizing = a })
instance FromJSON TrustedAdvisorCategorySpecificSummary where
parseJSON = withObject "TrustedAdvisorCategorySpecificSummary" $ \o -> TrustedAdvisorCategorySpecificSummary
<$> o .:? "costOptimizing"
instance ToJSON TrustedAdvisorCategorySpecificSummary where
toJSON TrustedAdvisorCategorySpecificSummary{..} = object
[ "costOptimizing" .= _tacssCostOptimizing
]
data Communication = Communication
{ _cAttachmentSet :: List "attachmentSet" AttachmentDetails
, _cBody :: Maybe Text
, _cCaseId :: Maybe Text
, _cSubmittedBy :: Maybe Text
, _cTimeCreated :: Maybe Text
} deriving (Eq, Show)
communication :: Communication
communication = Communication
{ _cCaseId = Nothing
, _cBody = Nothing
, _cSubmittedBy = Nothing
, _cTimeCreated = Nothing
, _cAttachmentSet = mempty
}
cAttachmentSet :: Lens' Communication [AttachmentDetails]
cAttachmentSet = lens _cAttachmentSet (\s a -> s { _cAttachmentSet = a }) . _List
cBody :: Lens' Communication (Maybe Text)
cBody = lens _cBody (\s a -> s { _cBody = a })
cCaseId :: Lens' Communication (Maybe Text)
cCaseId = lens _cCaseId (\s a -> s { _cCaseId = a })
cSubmittedBy :: Lens' Communication (Maybe Text)
cSubmittedBy = lens _cSubmittedBy (\s a -> s { _cSubmittedBy = a })
cTimeCreated :: Lens' Communication (Maybe Text)
cTimeCreated = lens _cTimeCreated (\s a -> s { _cTimeCreated = a })
instance FromJSON Communication where
parseJSON = withObject "Communication" $ \o -> Communication
<$> o .:? "attachmentSet" .!= mempty
<*> o .:? "body"
<*> o .:? "caseId"
<*> o .:? "submittedBy"
<*> o .:? "timeCreated"
instance ToJSON Communication where
toJSON Communication{..} = object
[ "caseId" .= _cCaseId
, "body" .= _cBody
, "submittedBy" .= _cSubmittedBy
, "timeCreated" .= _cTimeCreated
, "attachmentSet" .= _cAttachmentSet
]
data Category = Category
{ _cCode :: Maybe Text
, _cName :: Maybe Text
} deriving (Eq, Ord, Show)
category :: Category
category = Category
{ _cCode = Nothing
, _cName = Nothing
}
cCode :: Lens' Category (Maybe Text)
cCode = lens _cCode (\s a -> s { _cCode = a })
cName :: Lens' Category (Maybe Text)
cName = lens _cName (\s a -> s { _cName = a })
instance FromJSON Category where
parseJSON = withObject "Category" $ \o -> Category
<$> o .:? "code"
<*> o .:? "name"
instance ToJSON Category where
toJSON Category{..} = object
[ "code" .= _cCode
, "name" .= _cName
]
data TrustedAdvisorCheckSummary = TrustedAdvisorCheckSummary
{ _tacsCategorySpecificSummary :: TrustedAdvisorCategorySpecificSummary
, _tacsCheckId :: Text
, _tacsHasFlaggedResources :: Maybe Bool
, _tacsResourcesSummary :: TrustedAdvisorResourcesSummary
, _tacsStatus :: Text
, _tacsTimestamp :: Text
} deriving (Eq, Show)
trustedAdvisorCheckSummary :: Text
-> Text
-> Text
-> TrustedAdvisorResourcesSummary
-> TrustedAdvisorCategorySpecificSummary
-> TrustedAdvisorCheckSummary
trustedAdvisorCheckSummary p1 p2 p3 p4 p5 = TrustedAdvisorCheckSummary
{ _tacsCheckId = p1
, _tacsTimestamp = p2
, _tacsStatus = p3
, _tacsResourcesSummary = p4
, _tacsCategorySpecificSummary = p5
, _tacsHasFlaggedResources = Nothing
}
tacsCategorySpecificSummary :: Lens' TrustedAdvisorCheckSummary TrustedAdvisorCategorySpecificSummary
tacsCategorySpecificSummary =
lens _tacsCategorySpecificSummary
(\s a -> s { _tacsCategorySpecificSummary = a })
tacsCheckId :: Lens' TrustedAdvisorCheckSummary Text
tacsCheckId = lens _tacsCheckId (\s a -> s { _tacsCheckId = a })
tacsHasFlaggedResources :: Lens' TrustedAdvisorCheckSummary (Maybe Bool)
tacsHasFlaggedResources =
lens _tacsHasFlaggedResources (\s a -> s { _tacsHasFlaggedResources = a })
tacsResourcesSummary :: Lens' TrustedAdvisorCheckSummary TrustedAdvisorResourcesSummary
tacsResourcesSummary =
lens _tacsResourcesSummary (\s a -> s { _tacsResourcesSummary = a })
tacsStatus :: Lens' TrustedAdvisorCheckSummary Text
tacsStatus = lens _tacsStatus (\s a -> s { _tacsStatus = a })
tacsTimestamp :: Lens' TrustedAdvisorCheckSummary Text
tacsTimestamp = lens _tacsTimestamp (\s a -> s { _tacsTimestamp = a })
instance FromJSON TrustedAdvisorCheckSummary where
parseJSON = withObject "TrustedAdvisorCheckSummary" $ \o -> TrustedAdvisorCheckSummary
<$> o .: "categorySpecificSummary"
<*> o .: "checkId"
<*> o .:? "hasFlaggedResources"
<*> o .: "resourcesSummary"
<*> o .: "status"
<*> o .: "timestamp"
instance ToJSON TrustedAdvisorCheckSummary where
toJSON TrustedAdvisorCheckSummary{..} = object
[ "checkId" .= _tacsCheckId
, "timestamp" .= _tacsTimestamp
, "status" .= _tacsStatus
, "hasFlaggedResources" .= _tacsHasFlaggedResources
, "resourcesSummary" .= _tacsResourcesSummary
, "categorySpecificSummary" .= _tacsCategorySpecificSummary
]
data AttachmentDetails = AttachmentDetails
{ _adAttachmentId :: Maybe Text
, _adFileName :: Maybe Text
} deriving (Eq, Ord, Show)
attachmentDetails :: AttachmentDetails
attachmentDetails = AttachmentDetails
{ _adAttachmentId = Nothing
, _adFileName = Nothing
}
adAttachmentId :: Lens' AttachmentDetails (Maybe Text)
adAttachmentId = lens _adAttachmentId (\s a -> s { _adAttachmentId = a })
adFileName :: Lens' AttachmentDetails (Maybe Text)
adFileName = lens _adFileName (\s a -> s { _adFileName = a })
instance FromJSON AttachmentDetails where
parseJSON = withObject "AttachmentDetails" $ \o -> AttachmentDetails
<$> o .:? "attachmentId"
<*> o .:? "fileName"
instance ToJSON AttachmentDetails where
toJSON AttachmentDetails{..} = object
[ "attachmentId" .= _adAttachmentId
, "fileName" .= _adFileName
]
data TrustedAdvisorCheckResult = TrustedAdvisorCheckResult
{ _tacrCategorySpecificSummary :: TrustedAdvisorCategorySpecificSummary
, _tacrCheckId :: Text
, _tacrFlaggedResources :: List "flaggedResources" TrustedAdvisorResourceDetail
, _tacrResourcesSummary :: TrustedAdvisorResourcesSummary
, _tacrStatus :: Text
, _tacrTimestamp :: Text
} deriving (Eq, Show)
trustedAdvisorCheckResult :: Text
-> Text
-> Text
-> TrustedAdvisorResourcesSummary
-> TrustedAdvisorCategorySpecificSummary
-> TrustedAdvisorCheckResult
trustedAdvisorCheckResult p1 p2 p3 p4 p5 = TrustedAdvisorCheckResult
{ _tacrCheckId = p1
, _tacrTimestamp = p2
, _tacrStatus = p3
, _tacrResourcesSummary = p4
, _tacrCategorySpecificSummary = p5
, _tacrFlaggedResources = mempty
}
tacrCategorySpecificSummary :: Lens' TrustedAdvisorCheckResult TrustedAdvisorCategorySpecificSummary
tacrCategorySpecificSummary =
lens _tacrCategorySpecificSummary
(\s a -> s { _tacrCategorySpecificSummary = a })
tacrCheckId :: Lens' TrustedAdvisorCheckResult Text
tacrCheckId = lens _tacrCheckId (\s a -> s { _tacrCheckId = a })
tacrFlaggedResources :: Lens' TrustedAdvisorCheckResult [TrustedAdvisorResourceDetail]
tacrFlaggedResources =
lens _tacrFlaggedResources (\s a -> s { _tacrFlaggedResources = a })
. _List
tacrResourcesSummary :: Lens' TrustedAdvisorCheckResult TrustedAdvisorResourcesSummary
tacrResourcesSummary =
lens _tacrResourcesSummary (\s a -> s { _tacrResourcesSummary = a })
tacrStatus :: Lens' TrustedAdvisorCheckResult Text
tacrStatus = lens _tacrStatus (\s a -> s { _tacrStatus = a })
tacrTimestamp :: Lens' TrustedAdvisorCheckResult Text
tacrTimestamp = lens _tacrTimestamp (\s a -> s { _tacrTimestamp = a })
instance FromJSON TrustedAdvisorCheckResult where
parseJSON = withObject "TrustedAdvisorCheckResult" $ \o -> TrustedAdvisorCheckResult
<$> o .: "categorySpecificSummary"
<*> o .: "checkId"
<*> o .:? "flaggedResources" .!= mempty
<*> o .: "resourcesSummary"
<*> o .: "status"
<*> o .: "timestamp"
instance ToJSON TrustedAdvisorCheckResult where
toJSON TrustedAdvisorCheckResult{..} = object
[ "checkId" .= _tacrCheckId
, "timestamp" .= _tacrTimestamp
, "status" .= _tacrStatus
, "resourcesSummary" .= _tacrResourcesSummary
, "categorySpecificSummary" .= _tacrCategorySpecificSummary
, "flaggedResources" .= _tacrFlaggedResources
]
data TrustedAdvisorCheckDescription = TrustedAdvisorCheckDescription
{ _tacdCategory :: Text
, _tacdDescription :: Text
, _tacdId :: Text
, _tacdMetadata :: List "metadata" Text
, _tacdName :: Text
} deriving (Eq, Ord, Show)
trustedAdvisorCheckDescription :: Text
-> Text
-> Text
-> Text
-> TrustedAdvisorCheckDescription
trustedAdvisorCheckDescription p1 p2 p3 p4 = TrustedAdvisorCheckDescription
{ _tacdId = p1
, _tacdName = p2
, _tacdDescription = p3
, _tacdCategory = p4
, _tacdMetadata = mempty
}
tacdCategory :: Lens' TrustedAdvisorCheckDescription Text
tacdCategory = lens _tacdCategory (\s a -> s { _tacdCategory = a })
tacdDescription :: Lens' TrustedAdvisorCheckDescription Text
tacdDescription = lens _tacdDescription (\s a -> s { _tacdDescription = a })
tacdId :: Lens' TrustedAdvisorCheckDescription Text
tacdId = lens _tacdId (\s a -> s { _tacdId = a })
tacdMetadata :: Lens' TrustedAdvisorCheckDescription [Text]
tacdMetadata = lens _tacdMetadata (\s a -> s { _tacdMetadata = a }) . _List
tacdName :: Lens' TrustedAdvisorCheckDescription Text
tacdName = lens _tacdName (\s a -> s { _tacdName = a })
instance FromJSON TrustedAdvisorCheckDescription where
parseJSON = withObject "TrustedAdvisorCheckDescription" $ \o -> TrustedAdvisorCheckDescription
<$> o .: "category"
<*> o .: "description"
<*> o .: "id"
<*> o .:? "metadata" .!= mempty
<*> o .: "name"
instance ToJSON TrustedAdvisorCheckDescription where
toJSON TrustedAdvisorCheckDescription{..} = object
[ "id" .= _tacdId
, "name" .= _tacdName
, "description" .= _tacdDescription
, "category" .= _tacdCategory
, "metadata" .= _tacdMetadata
]
data Attachment = Attachment
{ _aData :: Maybe Base64
, _aFileName :: Maybe Text
} deriving (Eq, Show)
attachment :: Attachment
attachment = Attachment
{ _aFileName = Nothing
, _aData = Nothing
}
aData :: Lens' Attachment (Maybe Base64)
aData = lens _aData (\s a -> s { _aData = a })
aFileName :: Lens' Attachment (Maybe Text)
aFileName = lens _aFileName (\s a -> s { _aFileName = a })
instance FromJSON Attachment where
parseJSON = withObject "Attachment" $ \o -> Attachment
<$> o .:? "data"
<*> o .:? "fileName"
instance ToJSON Attachment where
toJSON Attachment{..} = object
[ "fileName" .= _aFileName
, "data" .= _aData
]
data RecentCaseCommunications = RecentCaseCommunications
{ _rccCommunications :: List "communications" Communication
, _rccNextToken :: Maybe Text
} deriving (Eq, Show)
recentCaseCommunications :: RecentCaseCommunications
recentCaseCommunications = RecentCaseCommunications
{ _rccCommunications = mempty
, _rccNextToken = Nothing
}
rccCommunications :: Lens' RecentCaseCommunications [Communication]
rccCommunications =
lens _rccCommunications (\s a -> s { _rccCommunications = a })
. _List
rccNextToken :: Lens' RecentCaseCommunications (Maybe Text)
rccNextToken = lens _rccNextToken (\s a -> s { _rccNextToken = a })
instance FromJSON RecentCaseCommunications where
parseJSON = withObject "RecentCaseCommunications" $ \o -> RecentCaseCommunications
<$> o .:? "communications" .!= mempty
<*> o .:? "nextToken"
instance ToJSON RecentCaseCommunications where
toJSON RecentCaseCommunications{..} = object
[ "communications" .= _rccCommunications
, "nextToken" .= _rccNextToken
]
data SupportService = SupportService
{ _ssCategories :: List "categories" Category
, _ssCode :: Maybe Text
, _ssName :: Maybe Text
} deriving (Eq, Show)
supportService :: SupportService
supportService = SupportService
{ _ssCode = Nothing
, _ssName = Nothing
, _ssCategories = mempty
}
ssCategories :: Lens' SupportService [Category]
ssCategories = lens _ssCategories (\s a -> s { _ssCategories = a }) . _List
ssCode :: Lens' SupportService (Maybe Text)
ssCode = lens _ssCode (\s a -> s { _ssCode = a })
ssName :: Lens' SupportService (Maybe Text)
ssName = lens _ssName (\s a -> s { _ssName = a })
instance FromJSON SupportService where
parseJSON = withObject "SupportService" $ \o -> SupportService
<$> o .:? "categories" .!= mempty
<*> o .:? "code"
<*> o .:? "name"
instance ToJSON SupportService where
toJSON SupportService{..} = object
[ "code" .= _ssCode
, "name" .= _ssName
, "categories" .= _ssCategories
]
data TrustedAdvisorResourceDetail = TrustedAdvisorResourceDetail
{ _tardIsSuppressed :: Maybe Bool
, _tardMetadata :: List "metadata" Text
, _tardRegion :: Text
, _tardResourceId :: Text
, _tardStatus :: Text
} deriving (Eq, Ord, Show)
trustedAdvisorResourceDetail :: Text
-> Text
-> Text
-> TrustedAdvisorResourceDetail
trustedAdvisorResourceDetail p1 p2 p3 = TrustedAdvisorResourceDetail
{ _tardStatus = p1
, _tardRegion = p2
, _tardResourceId = p3
, _tardIsSuppressed = Nothing
, _tardMetadata = mempty
}
tardIsSuppressed :: Lens' TrustedAdvisorResourceDetail (Maybe Bool)
tardIsSuppressed = lens _tardIsSuppressed (\s a -> s { _tardIsSuppressed = a })
tardMetadata :: Lens' TrustedAdvisorResourceDetail [Text]
tardMetadata = lens _tardMetadata (\s a -> s { _tardMetadata = a }) . _List
tardRegion :: Lens' TrustedAdvisorResourceDetail Text
tardRegion = lens _tardRegion (\s a -> s { _tardRegion = a })
tardResourceId :: Lens' TrustedAdvisorResourceDetail Text
tardResourceId = lens _tardResourceId (\s a -> s { _tardResourceId = a })
tardStatus :: Lens' TrustedAdvisorResourceDetail Text
tardStatus = lens _tardStatus (\s a -> s { _tardStatus = a })
instance FromJSON TrustedAdvisorResourceDetail where
parseJSON = withObject "TrustedAdvisorResourceDetail" $ \o -> TrustedAdvisorResourceDetail
<$> o .:? "isSuppressed"
<*> o .:? "metadata" .!= mempty
<*> o .: "region"
<*> o .: "resourceId"
<*> o .: "status"
instance ToJSON TrustedAdvisorResourceDetail where
toJSON TrustedAdvisorResourceDetail{..} = object
[ "status" .= _tardStatus
, "region" .= _tardRegion
, "resourceId" .= _tardResourceId
, "isSuppressed" .= _tardIsSuppressed
, "metadata" .= _tardMetadata
]
data TrustedAdvisorCostOptimizingSummary = TrustedAdvisorCostOptimizingSummary
{ _tacosEstimatedMonthlySavings :: Double
, _tacosEstimatedPercentMonthlySavings :: Double
} deriving (Eq, Ord, Show)
trustedAdvisorCostOptimizingSummary :: Double
-> Double
-> TrustedAdvisorCostOptimizingSummary
trustedAdvisorCostOptimizingSummary p1 p2 = TrustedAdvisorCostOptimizingSummary
{ _tacosEstimatedMonthlySavings = p1
, _tacosEstimatedPercentMonthlySavings = p2
}
tacosEstimatedMonthlySavings :: Lens' TrustedAdvisorCostOptimizingSummary Double
tacosEstimatedMonthlySavings =
lens _tacosEstimatedMonthlySavings
(\s a -> s { _tacosEstimatedMonthlySavings = a })
tacosEstimatedPercentMonthlySavings :: Lens' TrustedAdvisorCostOptimizingSummary Double
tacosEstimatedPercentMonthlySavings =
lens _tacosEstimatedPercentMonthlySavings
(\s a -> s { _tacosEstimatedPercentMonthlySavings = a })
instance FromJSON TrustedAdvisorCostOptimizingSummary where
parseJSON = withObject "TrustedAdvisorCostOptimizingSummary" $ \o -> TrustedAdvisorCostOptimizingSummary
<$> o .: "estimatedMonthlySavings"
<*> o .: "estimatedPercentMonthlySavings"
instance ToJSON TrustedAdvisorCostOptimizingSummary where
toJSON TrustedAdvisorCostOptimizingSummary{..} = object
[ "estimatedMonthlySavings" .= _tacosEstimatedMonthlySavings
, "estimatedPercentMonthlySavings" .= _tacosEstimatedPercentMonthlySavings
]
data SeverityLevel = SeverityLevel
{ _slCode :: Maybe Text
, _slName :: Maybe Text
} deriving (Eq, Ord, Show)
severityLevel :: SeverityLevel
severityLevel = SeverityLevel
{ _slCode = Nothing
, _slName = Nothing
}
slCode :: Lens' SeverityLevel (Maybe Text)
slCode = lens _slCode (\s a -> s { _slCode = a })
slName :: Lens' SeverityLevel (Maybe Text)
slName = lens _slName (\s a -> s { _slName = a })
instance FromJSON SeverityLevel where
parseJSON = withObject "SeverityLevel" $ \o -> SeverityLevel
<$> o .:? "code"
<*> o .:? "name"
instance ToJSON SeverityLevel where
toJSON SeverityLevel{..} = object
[ "code" .= _slCode
, "name" .= _slName
]
data CaseDetails = CaseDetails
{ _cdCaseId :: Maybe Text
, _cdCategoryCode :: Maybe Text
, _cdCcEmailAddresses :: List "ccEmailAddresses" Text
, _cdDisplayId :: Maybe Text
, _cdLanguage :: Maybe Text
, _cdRecentCommunications :: Maybe RecentCaseCommunications
, _cdServiceCode :: Maybe Text
, _cdSeverityCode :: Maybe Text
, _cdStatus :: Maybe Text
, _cdSubject :: Maybe Text
, _cdSubmittedBy :: Maybe Text
, _cdTimeCreated :: Maybe Text
} deriving (Eq, Show)
caseDetails :: CaseDetails
caseDetails = CaseDetails
{ _cdCaseId = Nothing
, _cdDisplayId = Nothing
, _cdSubject = Nothing
, _cdStatus = Nothing
, _cdServiceCode = Nothing
, _cdCategoryCode = Nothing
, _cdSeverityCode = Nothing
, _cdSubmittedBy = Nothing
, _cdTimeCreated = Nothing
, _cdRecentCommunications = Nothing
, _cdCcEmailAddresses = mempty
, _cdLanguage = Nothing
}
cdCaseId :: Lens' CaseDetails (Maybe Text)
cdCaseId = lens _cdCaseId (\s a -> s { _cdCaseId = a })
cdCategoryCode :: Lens' CaseDetails (Maybe Text)
cdCategoryCode = lens _cdCategoryCode (\s a -> s { _cdCategoryCode = a })
cdCcEmailAddresses :: Lens' CaseDetails [Text]
cdCcEmailAddresses =
lens _cdCcEmailAddresses (\s a -> s { _cdCcEmailAddresses = a })
. _List
cdDisplayId :: Lens' CaseDetails (Maybe Text)
cdDisplayId = lens _cdDisplayId (\s a -> s { _cdDisplayId = a })
cdLanguage :: Lens' CaseDetails (Maybe Text)
cdLanguage = lens _cdLanguage (\s a -> s { _cdLanguage = a })
cdRecentCommunications :: Lens' CaseDetails (Maybe RecentCaseCommunications)
cdRecentCommunications =
lens _cdRecentCommunications (\s a -> s { _cdRecentCommunications = a })
cdServiceCode :: Lens' CaseDetails (Maybe Text)
cdServiceCode = lens _cdServiceCode (\s a -> s { _cdServiceCode = a })
cdSeverityCode :: Lens' CaseDetails (Maybe Text)
cdSeverityCode = lens _cdSeverityCode (\s a -> s { _cdSeverityCode = a })
cdStatus :: Lens' CaseDetails (Maybe Text)
cdStatus = lens _cdStatus (\s a -> s { _cdStatus = a })
cdSubject :: Lens' CaseDetails (Maybe Text)
cdSubject = lens _cdSubject (\s a -> s { _cdSubject = a })
cdSubmittedBy :: Lens' CaseDetails (Maybe Text)
cdSubmittedBy = lens _cdSubmittedBy (\s a -> s { _cdSubmittedBy = a })
cdTimeCreated :: Lens' CaseDetails (Maybe Text)
cdTimeCreated = lens _cdTimeCreated (\s a -> s { _cdTimeCreated = a })
instance FromJSON CaseDetails where
parseJSON = withObject "CaseDetails" $ \o -> CaseDetails
<$> o .:? "caseId"
<*> o .:? "categoryCode"
<*> o .:? "ccEmailAddresses" .!= mempty
<*> o .:? "displayId"
<*> o .:? "language"
<*> o .:? "recentCommunications"
<*> o .:? "serviceCode"
<*> o .:? "severityCode"
<*> o .:? "status"
<*> o .:? "subject"
<*> o .:? "submittedBy"
<*> o .:? "timeCreated"
instance ToJSON CaseDetails where
toJSON CaseDetails{..} = object
[ "caseId" .= _cdCaseId
, "displayId" .= _cdDisplayId
, "subject" .= _cdSubject
, "status" .= _cdStatus
, "serviceCode" .= _cdServiceCode
, "categoryCode" .= _cdCategoryCode
, "severityCode" .= _cdSeverityCode
, "submittedBy" .= _cdSubmittedBy
, "timeCreated" .= _cdTimeCreated
, "recentCommunications" .= _cdRecentCommunications
, "ccEmailAddresses" .= _cdCcEmailAddresses
, "language" .= _cdLanguage
]
data TrustedAdvisorCheckRefreshStatus = TrustedAdvisorCheckRefreshStatus
{ _tacrsCheckId :: Text
, _tacrsMillisUntilNextRefreshable :: Integer
, _tacrsStatus :: Text
} deriving (Eq, Ord, Show)
trustedAdvisorCheckRefreshStatus :: Text
-> Text
-> Integer
-> TrustedAdvisorCheckRefreshStatus
trustedAdvisorCheckRefreshStatus p1 p2 p3 = TrustedAdvisorCheckRefreshStatus
{ _tacrsCheckId = p1
, _tacrsStatus = p2
, _tacrsMillisUntilNextRefreshable = p3
}
tacrsCheckId :: Lens' TrustedAdvisorCheckRefreshStatus Text
tacrsCheckId = lens _tacrsCheckId (\s a -> s { _tacrsCheckId = a })
tacrsMillisUntilNextRefreshable :: Lens' TrustedAdvisorCheckRefreshStatus Integer
tacrsMillisUntilNextRefreshable =
lens _tacrsMillisUntilNextRefreshable
(\s a -> s { _tacrsMillisUntilNextRefreshable = a })
tacrsStatus :: Lens' TrustedAdvisorCheckRefreshStatus Text
tacrsStatus = lens _tacrsStatus (\s a -> s { _tacrsStatus = a })
instance FromJSON TrustedAdvisorCheckRefreshStatus where
parseJSON = withObject "TrustedAdvisorCheckRefreshStatus" $ \o -> TrustedAdvisorCheckRefreshStatus
<$> o .: "checkId"
<*> o .: "millisUntilNextRefreshable"
<*> o .: "status"
instance ToJSON TrustedAdvisorCheckRefreshStatus where
toJSON TrustedAdvisorCheckRefreshStatus{..} = object
[ "checkId" .= _tacrsCheckId
, "status" .= _tacrsStatus
, "millisUntilNextRefreshable" .= _tacrsMillisUntilNextRefreshable
]