{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Personalize.Types
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Personalize.Types
  ( -- * Service Configuration
    defaultService,

    -- * Errors
    _ResourceAlreadyExistsException,
    _InvalidNextTokenException,
    _InvalidInputException,
    _ResourceNotFoundException,
    _LimitExceededException,
    _ResourceInUseException,

    -- * IngestionMode
    IngestionMode (..),

    -- * ObjectiveSensitivity
    ObjectiveSensitivity (..),

    -- * RecipeProvider
    RecipeProvider (..),

    -- * TrainingMode
    TrainingMode (..),

    -- * Algorithm
    Algorithm (..),
    newAlgorithm,
    algorithm_defaultHyperParameters,
    algorithm_algorithmArn,
    algorithm_trainingInputMode,
    algorithm_defaultHyperParameterRanges,
    algorithm_algorithmImage,
    algorithm_lastUpdatedDateTime,
    algorithm_name,
    algorithm_creationDateTime,
    algorithm_defaultResourceConfig,
    algorithm_roleArn,

    -- * AlgorithmImage
    AlgorithmImage (..),
    newAlgorithmImage,
    algorithmImage_name,
    algorithmImage_dockerURI,

    -- * AutoMLConfig
    AutoMLConfig (..),
    newAutoMLConfig,
    autoMLConfig_recipeList,
    autoMLConfig_metricName,

    -- * AutoMLResult
    AutoMLResult (..),
    newAutoMLResult,
    autoMLResult_bestRecipeArn,

    -- * BatchInferenceJob
    BatchInferenceJob (..),
    newBatchInferenceJob,
    batchInferenceJob_failureReason,
    batchInferenceJob_status,
    batchInferenceJob_jobOutput,
    batchInferenceJob_jobName,
    batchInferenceJob_lastUpdatedDateTime,
    batchInferenceJob_numResults,
    batchInferenceJob_batchInferenceJobConfig,
    batchInferenceJob_batchInferenceJobArn,
    batchInferenceJob_filterArn,
    batchInferenceJob_creationDateTime,
    batchInferenceJob_solutionVersionArn,
    batchInferenceJob_roleArn,
    batchInferenceJob_jobInput,

    -- * BatchInferenceJobConfig
    BatchInferenceJobConfig (..),
    newBatchInferenceJobConfig,
    batchInferenceJobConfig_itemExplorationConfig,

    -- * BatchInferenceJobInput
    BatchInferenceJobInput (..),
    newBatchInferenceJobInput,
    batchInferenceJobInput_s3DataSource,

    -- * BatchInferenceJobOutput
    BatchInferenceJobOutput (..),
    newBatchInferenceJobOutput,
    batchInferenceJobOutput_s3DataDestination,

    -- * BatchInferenceJobSummary
    BatchInferenceJobSummary (..),
    newBatchInferenceJobSummary,
    batchInferenceJobSummary_failureReason,
    batchInferenceJobSummary_status,
    batchInferenceJobSummary_jobName,
    batchInferenceJobSummary_lastUpdatedDateTime,
    batchInferenceJobSummary_batchInferenceJobArn,
    batchInferenceJobSummary_creationDateTime,
    batchInferenceJobSummary_solutionVersionArn,

    -- * Campaign
    Campaign (..),
    newCampaign,
    campaign_failureReason,
    campaign_status,
    campaign_lastUpdatedDateTime,
    campaign_campaignConfig,
    campaign_latestCampaignUpdate,
    campaign_name,
    campaign_minProvisionedTPS,
    campaign_creationDateTime,
    campaign_campaignArn,
    campaign_solutionVersionArn,

    -- * CampaignConfig
    CampaignConfig (..),
    newCampaignConfig,
    campaignConfig_itemExplorationConfig,

    -- * CampaignSummary
    CampaignSummary (..),
    newCampaignSummary,
    campaignSummary_failureReason,
    campaignSummary_status,
    campaignSummary_lastUpdatedDateTime,
    campaignSummary_name,
    campaignSummary_creationDateTime,
    campaignSummary_campaignArn,

    -- * CampaignUpdateSummary
    CampaignUpdateSummary (..),
    newCampaignUpdateSummary,
    campaignUpdateSummary_failureReason,
    campaignUpdateSummary_status,
    campaignUpdateSummary_lastUpdatedDateTime,
    campaignUpdateSummary_campaignConfig,
    campaignUpdateSummary_minProvisionedTPS,
    campaignUpdateSummary_creationDateTime,
    campaignUpdateSummary_solutionVersionArn,

    -- * CategoricalHyperParameterRange
    CategoricalHyperParameterRange (..),
    newCategoricalHyperParameterRange,
    categoricalHyperParameterRange_values,
    categoricalHyperParameterRange_name,

    -- * ContinuousHyperParameterRange
    ContinuousHyperParameterRange (..),
    newContinuousHyperParameterRange,
    continuousHyperParameterRange_maxValue,
    continuousHyperParameterRange_name,
    continuousHyperParameterRange_minValue,

    -- * DataSource
    DataSource (..),
    newDataSource,
    dataSource_dataLocation,

    -- * Dataset
    Dataset (..),
    newDataset,
    dataset_status,
    dataset_datasetArn,
    dataset_lastUpdatedDateTime,
    dataset_schemaArn,
    dataset_name,
    dataset_datasetType,
    dataset_creationDateTime,
    dataset_datasetGroupArn,

    -- * DatasetExportJob
    DatasetExportJob (..),
    newDatasetExportJob,
    datasetExportJob_failureReason,
    datasetExportJob_status,
    datasetExportJob_datasetExportJobArn,
    datasetExportJob_datasetArn,
    datasetExportJob_jobOutput,
    datasetExportJob_jobName,
    datasetExportJob_lastUpdatedDateTime,
    datasetExportJob_ingestionMode,
    datasetExportJob_creationDateTime,
    datasetExportJob_roleArn,

    -- * DatasetExportJobOutput
    DatasetExportJobOutput (..),
    newDatasetExportJobOutput,
    datasetExportJobOutput_s3DataDestination,

    -- * DatasetExportJobSummary
    DatasetExportJobSummary (..),
    newDatasetExportJobSummary,
    datasetExportJobSummary_failureReason,
    datasetExportJobSummary_status,
    datasetExportJobSummary_datasetExportJobArn,
    datasetExportJobSummary_jobName,
    datasetExportJobSummary_lastUpdatedDateTime,
    datasetExportJobSummary_creationDateTime,

    -- * DatasetGroup
    DatasetGroup (..),
    newDatasetGroup,
    datasetGroup_failureReason,
    datasetGroup_status,
    datasetGroup_kmsKeyArn,
    datasetGroup_lastUpdatedDateTime,
    datasetGroup_name,
    datasetGroup_creationDateTime,
    datasetGroup_datasetGroupArn,
    datasetGroup_roleArn,

    -- * DatasetGroupSummary
    DatasetGroupSummary (..),
    newDatasetGroupSummary,
    datasetGroupSummary_failureReason,
    datasetGroupSummary_status,
    datasetGroupSummary_lastUpdatedDateTime,
    datasetGroupSummary_name,
    datasetGroupSummary_creationDateTime,
    datasetGroupSummary_datasetGroupArn,

    -- * DatasetImportJob
    DatasetImportJob (..),
    newDatasetImportJob,
    datasetImportJob_failureReason,
    datasetImportJob_status,
    datasetImportJob_datasetArn,
    datasetImportJob_jobName,
    datasetImportJob_lastUpdatedDateTime,
    datasetImportJob_datasetImportJobArn,
    datasetImportJob_dataSource,
    datasetImportJob_creationDateTime,
    datasetImportJob_roleArn,

    -- * DatasetImportJobSummary
    DatasetImportJobSummary (..),
    newDatasetImportJobSummary,
    datasetImportJobSummary_failureReason,
    datasetImportJobSummary_status,
    datasetImportJobSummary_jobName,
    datasetImportJobSummary_lastUpdatedDateTime,
    datasetImportJobSummary_datasetImportJobArn,
    datasetImportJobSummary_creationDateTime,

    -- * DatasetSchema
    DatasetSchema (..),
    newDatasetSchema,
    datasetSchema_lastUpdatedDateTime,
    datasetSchema_schema,
    datasetSchema_schemaArn,
    datasetSchema_name,
    datasetSchema_creationDateTime,

    -- * DatasetSchemaSummary
    DatasetSchemaSummary (..),
    newDatasetSchemaSummary,
    datasetSchemaSummary_lastUpdatedDateTime,
    datasetSchemaSummary_schemaArn,
    datasetSchemaSummary_name,
    datasetSchemaSummary_creationDateTime,

    -- * DatasetSummary
    DatasetSummary (..),
    newDatasetSummary,
    datasetSummary_status,
    datasetSummary_datasetArn,
    datasetSummary_lastUpdatedDateTime,
    datasetSummary_name,
    datasetSummary_datasetType,
    datasetSummary_creationDateTime,

    -- * DefaultCategoricalHyperParameterRange
    DefaultCategoricalHyperParameterRange (..),
    newDefaultCategoricalHyperParameterRange,
    defaultCategoricalHyperParameterRange_isTunable,
    defaultCategoricalHyperParameterRange_values,
    defaultCategoricalHyperParameterRange_name,

    -- * DefaultContinuousHyperParameterRange
    DefaultContinuousHyperParameterRange (..),
    newDefaultContinuousHyperParameterRange,
    defaultContinuousHyperParameterRange_maxValue,
    defaultContinuousHyperParameterRange_isTunable,
    defaultContinuousHyperParameterRange_name,
    defaultContinuousHyperParameterRange_minValue,

    -- * DefaultHyperParameterRanges
    DefaultHyperParameterRanges (..),
    newDefaultHyperParameterRanges,
    defaultHyperParameterRanges_integerHyperParameterRanges,
    defaultHyperParameterRanges_categoricalHyperParameterRanges,
    defaultHyperParameterRanges_continuousHyperParameterRanges,

    -- * DefaultIntegerHyperParameterRange
    DefaultIntegerHyperParameterRange (..),
    newDefaultIntegerHyperParameterRange,
    defaultIntegerHyperParameterRange_maxValue,
    defaultIntegerHyperParameterRange_isTunable,
    defaultIntegerHyperParameterRange_name,
    defaultIntegerHyperParameterRange_minValue,

    -- * EventTracker
    EventTracker (..),
    newEventTracker,
    eventTracker_status,
    eventTracker_trackingId,
    eventTracker_lastUpdatedDateTime,
    eventTracker_accountId,
    eventTracker_name,
    eventTracker_creationDateTime,
    eventTracker_datasetGroupArn,
    eventTracker_eventTrackerArn,

    -- * EventTrackerSummary
    EventTrackerSummary (..),
    newEventTrackerSummary,
    eventTrackerSummary_status,
    eventTrackerSummary_lastUpdatedDateTime,
    eventTrackerSummary_name,
    eventTrackerSummary_creationDateTime,
    eventTrackerSummary_eventTrackerArn,

    -- * FeatureTransformation
    FeatureTransformation (..),
    newFeatureTransformation,
    featureTransformation_status,
    featureTransformation_featureTransformationArn,
    featureTransformation_lastUpdatedDateTime,
    featureTransformation_name,
    featureTransformation_creationDateTime,
    featureTransformation_defaultParameters,

    -- * Filter
    Filter (..),
    newFilter,
    filter_failureReason,
    filter_status,
    filter_filterExpression,
    filter_lastUpdatedDateTime,
    filter_name,
    filter_filterArn,
    filter_creationDateTime,
    filter_datasetGroupArn,

    -- * FilterSummary
    FilterSummary (..),
    newFilterSummary,
    filterSummary_failureReason,
    filterSummary_status,
    filterSummary_lastUpdatedDateTime,
    filterSummary_name,
    filterSummary_filterArn,
    filterSummary_creationDateTime,
    filterSummary_datasetGroupArn,

    -- * HPOConfig
    HPOConfig (..),
    newHPOConfig,
    hPOConfig_algorithmHyperParameterRanges,
    hPOConfig_hpoResourceConfig,
    hPOConfig_hpoObjective,

    -- * HPOObjective
    HPOObjective (..),
    newHPOObjective,
    hPOObjective_metricName,
    hPOObjective_type,
    hPOObjective_metricRegex,

    -- * HPOResourceConfig
    HPOResourceConfig (..),
    newHPOResourceConfig,
    hPOResourceConfig_maxNumberOfTrainingJobs,
    hPOResourceConfig_maxParallelTrainingJobs,

    -- * HyperParameterRanges
    HyperParameterRanges (..),
    newHyperParameterRanges,
    hyperParameterRanges_integerHyperParameterRanges,
    hyperParameterRanges_categoricalHyperParameterRanges,
    hyperParameterRanges_continuousHyperParameterRanges,

    -- * IntegerHyperParameterRange
    IntegerHyperParameterRange (..),
    newIntegerHyperParameterRange,
    integerHyperParameterRange_maxValue,
    integerHyperParameterRange_name,
    integerHyperParameterRange_minValue,

    -- * OptimizationObjective
    OptimizationObjective (..),
    newOptimizationObjective,
    optimizationObjective_itemAttribute,
    optimizationObjective_objectiveSensitivity,

    -- * Recipe
    Recipe (..),
    newRecipe,
    recipe_status,
    recipe_algorithmArn,
    recipe_recipeArn,
    recipe_featureTransformationArn,
    recipe_lastUpdatedDateTime,
    recipe_name,
    recipe_creationDateTime,
    recipe_recipeType,
    recipe_description,

    -- * RecipeSummary
    RecipeSummary (..),
    newRecipeSummary,
    recipeSummary_status,
    recipeSummary_recipeArn,
    recipeSummary_lastUpdatedDateTime,
    recipeSummary_name,
    recipeSummary_creationDateTime,

    -- * S3DataConfig
    S3DataConfig (..),
    newS3DataConfig,
    s3DataConfig_kmsKeyArn,
    s3DataConfig_path,

    -- * Solution
    Solution (..),
    newSolution,
    solution_solutionArn,
    solution_status,
    solution_performAutoML,
    solution_recipeArn,
    solution_lastUpdatedDateTime,
    solution_eventType,
    solution_name,
    solution_autoMLResult,
    solution_creationDateTime,
    solution_datasetGroupArn,
    solution_latestSolutionVersion,
    solution_solutionConfig,
    solution_performHPO,

    -- * SolutionConfig
    SolutionConfig (..),
    newSolutionConfig,
    solutionConfig_featureTransformationParameters,
    solutionConfig_hpoConfig,
    solutionConfig_eventValueThreshold,
    solutionConfig_autoMLConfig,
    solutionConfig_algorithmHyperParameters,
    solutionConfig_optimizationObjective,

    -- * SolutionSummary
    SolutionSummary (..),
    newSolutionSummary,
    solutionSummary_solutionArn,
    solutionSummary_status,
    solutionSummary_lastUpdatedDateTime,
    solutionSummary_name,
    solutionSummary_creationDateTime,

    -- * SolutionVersion
    SolutionVersion (..),
    newSolutionVersion,
    solutionVersion_failureReason,
    solutionVersion_solutionArn,
    solutionVersion_status,
    solutionVersion_performAutoML,
    solutionVersion_tunedHPOParams,
    solutionVersion_recipeArn,
    solutionVersion_lastUpdatedDateTime,
    solutionVersion_eventType,
    solutionVersion_creationDateTime,
    solutionVersion_datasetGroupArn,
    solutionVersion_trainingMode,
    solutionVersion_trainingHours,
    solutionVersion_solutionConfig,
    solutionVersion_performHPO,
    solutionVersion_solutionVersionArn,

    -- * SolutionVersionSummary
    SolutionVersionSummary (..),
    newSolutionVersionSummary,
    solutionVersionSummary_failureReason,
    solutionVersionSummary_status,
    solutionVersionSummary_lastUpdatedDateTime,
    solutionVersionSummary_creationDateTime,
    solutionVersionSummary_solutionVersionArn,

    -- * TunedHPOParams
    TunedHPOParams (..),
    newTunedHPOParams,
    tunedHPOParams_algorithmHyperParameters,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types.Algorithm
import Amazonka.Personalize.Types.AlgorithmImage
import Amazonka.Personalize.Types.AutoMLConfig
import Amazonka.Personalize.Types.AutoMLResult
import Amazonka.Personalize.Types.BatchInferenceJob
import Amazonka.Personalize.Types.BatchInferenceJobConfig
import Amazonka.Personalize.Types.BatchInferenceJobInput
import Amazonka.Personalize.Types.BatchInferenceJobOutput
import Amazonka.Personalize.Types.BatchInferenceJobSummary
import Amazonka.Personalize.Types.Campaign
import Amazonka.Personalize.Types.CampaignConfig
import Amazonka.Personalize.Types.CampaignSummary
import Amazonka.Personalize.Types.CampaignUpdateSummary
import Amazonka.Personalize.Types.CategoricalHyperParameterRange
import Amazonka.Personalize.Types.ContinuousHyperParameterRange
import Amazonka.Personalize.Types.DataSource
import Amazonka.Personalize.Types.Dataset
import Amazonka.Personalize.Types.DatasetExportJob
import Amazonka.Personalize.Types.DatasetExportJobOutput
import Amazonka.Personalize.Types.DatasetExportJobSummary
import Amazonka.Personalize.Types.DatasetGroup
import Amazonka.Personalize.Types.DatasetGroupSummary
import Amazonka.Personalize.Types.DatasetImportJob
import Amazonka.Personalize.Types.DatasetImportJobSummary
import Amazonka.Personalize.Types.DatasetSchema
import Amazonka.Personalize.Types.DatasetSchemaSummary
import Amazonka.Personalize.Types.DatasetSummary
import Amazonka.Personalize.Types.DefaultCategoricalHyperParameterRange
import Amazonka.Personalize.Types.DefaultContinuousHyperParameterRange
import Amazonka.Personalize.Types.DefaultHyperParameterRanges
import Amazonka.Personalize.Types.DefaultIntegerHyperParameterRange
import Amazonka.Personalize.Types.EventTracker
import Amazonka.Personalize.Types.EventTrackerSummary
import Amazonka.Personalize.Types.FeatureTransformation
import Amazonka.Personalize.Types.Filter
import Amazonka.Personalize.Types.FilterSummary
import Amazonka.Personalize.Types.HPOConfig
import Amazonka.Personalize.Types.HPOObjective
import Amazonka.Personalize.Types.HPOResourceConfig
import Amazonka.Personalize.Types.HyperParameterRanges
import Amazonka.Personalize.Types.IngestionMode
import Amazonka.Personalize.Types.IntegerHyperParameterRange
import Amazonka.Personalize.Types.ObjectiveSensitivity
import Amazonka.Personalize.Types.OptimizationObjective
import Amazonka.Personalize.Types.Recipe
import Amazonka.Personalize.Types.RecipeProvider
import Amazonka.Personalize.Types.RecipeSummary
import Amazonka.Personalize.Types.S3DataConfig
import Amazonka.Personalize.Types.Solution
import Amazonka.Personalize.Types.SolutionConfig
import Amazonka.Personalize.Types.SolutionSummary
import Amazonka.Personalize.Types.SolutionVersion
import Amazonka.Personalize.Types.SolutionVersionSummary
import Amazonka.Personalize.Types.TrainingMode
import Amazonka.Personalize.Types.TunedHPOParams
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign

-- | API version @2018-05-22@ of the Amazon Personalize SDK configuration.
defaultService :: Core.Service
defaultService :: Service
defaultService =
  Service :: Abbrev
-> Signer
-> ByteString
-> ByteString
-> ByteString
-> (Region -> Endpoint)
-> Maybe Seconds
-> (Status -> Bool)
-> (Status -> [Header] -> ByteStringLazy -> Error)
-> Retry
-> Service
Core.Service
    { $sel:_serviceAbbrev:Service :: Abbrev
Core._serviceAbbrev = Abbrev
"Personalize",
      $sel:_serviceSigner:Service :: Signer
Core._serviceSigner = Signer
Sign.v4,
      $sel:_serviceEndpointPrefix:Service :: ByteString
Core._serviceEndpointPrefix = ByteString
"personalize",
      $sel:_serviceSigningName:Service :: ByteString
Core._serviceSigningName = ByteString
"personalize",
      $sel:_serviceVersion:Service :: ByteString
Core._serviceVersion = ByteString
"2018-05-22",
      $sel:_serviceEndpoint:Service :: Region -> Endpoint
Core._serviceEndpoint =
        Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
      $sel:_serviceTimeout:Service :: Maybe Seconds
Core._serviceTimeout = Seconds -> Maybe Seconds
forall a. a -> Maybe a
Prelude.Just Seconds
70,
      $sel:_serviceCheck:Service :: Status -> Bool
Core._serviceCheck = Status -> Bool
Core.statusSuccess,
      $sel:_serviceError:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core._serviceError =
        Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"Personalize",
      $sel:_serviceRetry:Service :: Retry
Core._serviceRetry = Retry
retry
    }
  where
    retry :: Retry
retry =
      Exponential :: Double -> Int -> Int -> (ServiceError -> Maybe Text) -> Retry
Core.Exponential
        { $sel:_retryBase:Exponential :: Double
Core._retryBase = Double
5.0e-2,
          $sel:_retryGrowth:Exponential :: Int
Core._retryGrowth = Int
2,
          $sel:_retryAttempts:Exponential :: Int
Core._retryAttempts = Int
5,
          $sel:_retryCheck:Exponential :: ServiceError -> Maybe Text
Core._retryCheck = ServiceError -> Maybe Text
forall a. IsString a => ServiceError -> Maybe a
check
        }
    check :: ServiceError -> Maybe a
check ServiceError
e
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
              Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
              Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
              Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throttling"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
              ErrorCode
"ProvisionedThroughputExceededException"
              Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has
          ( ErrorCode -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
              Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
-> Getting Any ServiceError ServiceError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
          )
          ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
      | Getting Any ServiceError ServiceError -> ServiceError -> Bool
forall s a. Getting Any s a -> s -> Bool
Lens.has (Int -> Getting Any ServiceError ServiceError
forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
        a -> Maybe a
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
      | Bool
Prelude.otherwise = Maybe a
forall a. Maybe a
Prelude.Nothing

-- | The specified resource already exists.
_ResourceAlreadyExistsException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ResourceAlreadyExistsException :: Getting (First ServiceError) a ServiceError
_ResourceAlreadyExistsException =
  Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ResourceAlreadyExistsException"

-- | The token is not valid.
_InvalidNextTokenException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidNextTokenException :: Getting (First ServiceError) a ServiceError
_InvalidNextTokenException =
  Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"InvalidNextTokenException"

-- | Provide a valid value for the field or parameter.
_InvalidInputException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_InvalidInputException :: Getting (First ServiceError) a ServiceError
_InvalidInputException =
  Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"InvalidInputException"

-- | Could not find the specified resource.
_ResourceNotFoundException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ResourceNotFoundException :: Getting (First ServiceError) a ServiceError
_ResourceNotFoundException =
  Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ResourceNotFoundException"

-- | The limit on the number of requests per second has been exceeded.
_LimitExceededException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_LimitExceededException :: Getting (First ServiceError) a ServiceError
_LimitExceededException =
  Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"LimitExceededException"

-- | The specified resource is in use.
_ResourceInUseException :: Core.AsError a => Lens.Getting (Prelude.First Core.ServiceError) a Core.ServiceError
_ResourceInUseException :: Getting (First ServiceError) a ServiceError
_ResourceInUseException =
  Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
forall a.
AsError a =>
Service -> ErrorCode -> Getting (First ServiceError) a ServiceError
Core._MatchServiceError
    Service
defaultService
    ErrorCode
"ResourceInUseException"