{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.AmplifyBackend.Types
(
defaultService,
_BadRequestException,
_GatewayTimeoutException,
_NotFoundException,
_TooManyRequestsException,
AdditionalConstraintsElement (..),
AuthResources (..),
AuthenticatedElement (..),
DeliveryMethod (..),
MFAMode (..),
MfaTypesElement (..),
Mode (..),
OAuthGrantType (..),
OAuthScopesElement (..),
RequiredSignUpAttributesElement (..),
ResolutionStrategy (..),
Service (..),
ServiceName (..),
SignInMethod (..),
Status (..),
UnAuthenticatedElement (..),
BackendAPIAppSyncAuthSettings (..),
newBackendAPIAppSyncAuthSettings,
backendAPIAppSyncAuthSettings_cognitoUserPoolId,
backendAPIAppSyncAuthSettings_description,
backendAPIAppSyncAuthSettings_expirationTime,
backendAPIAppSyncAuthSettings_openIDAuthTTL,
backendAPIAppSyncAuthSettings_openIDClientId,
backendAPIAppSyncAuthSettings_openIDIatTTL,
backendAPIAppSyncAuthSettings_openIDIssueURL,
backendAPIAppSyncAuthSettings_openIDProviderName,
BackendAPIAuthType (..),
newBackendAPIAuthType,
backendAPIAuthType_mode,
backendAPIAuthType_settings,
BackendAPIConflictResolution (..),
newBackendAPIConflictResolution,
backendAPIConflictResolution_resolutionStrategy,
BackendAPIResourceConfig (..),
newBackendAPIResourceConfig,
backendAPIResourceConfig_additionalAuthTypes,
backendAPIResourceConfig_apiName,
backendAPIResourceConfig_conflictResolution,
backendAPIResourceConfig_defaultAuthType,
backendAPIResourceConfig_service,
backendAPIResourceConfig_transformSchema,
BackendAuthAppleProviderConfig (..),
newBackendAuthAppleProviderConfig,
backendAuthAppleProviderConfig_clientId,
backendAuthAppleProviderConfig_keyId,
backendAuthAppleProviderConfig_privateKey,
backendAuthAppleProviderConfig_teamId,
BackendAuthSocialProviderConfig (..),
newBackendAuthSocialProviderConfig,
backendAuthSocialProviderConfig_clientId,
backendAuthSocialProviderConfig_clientSecret,
BackendJobRespObj (..),
newBackendJobRespObj,
backendJobRespObj_createTime,
backendJobRespObj_error,
backendJobRespObj_jobId,
backendJobRespObj_operation,
backendJobRespObj_status,
backendJobRespObj_updateTime,
backendJobRespObj_appId,
backendJobRespObj_backendEnvironmentName,
BackendStoragePermissions (..),
newBackendStoragePermissions,
backendStoragePermissions_unAuthenticated,
backendStoragePermissions_authenticated,
CreateBackendAuthForgotPasswordConfig (..),
newCreateBackendAuthForgotPasswordConfig,
createBackendAuthForgotPasswordConfig_emailSettings,
createBackendAuthForgotPasswordConfig_smsSettings,
createBackendAuthForgotPasswordConfig_deliveryMethod,
CreateBackendAuthIdentityPoolConfig (..),
newCreateBackendAuthIdentityPoolConfig,
createBackendAuthIdentityPoolConfig_unauthenticatedLogin,
createBackendAuthIdentityPoolConfig_identityPoolName,
CreateBackendAuthMFAConfig (..),
newCreateBackendAuthMFAConfig,
createBackendAuthMFAConfig_settings,
createBackendAuthMFAConfig_mfaMode,
CreateBackendAuthOAuthConfig (..),
newCreateBackendAuthOAuthConfig,
createBackendAuthOAuthConfig_domainPrefix,
createBackendAuthOAuthConfig_socialProviderSettings,
createBackendAuthOAuthConfig_redirectSignOutURIs,
createBackendAuthOAuthConfig_redirectSignInURIs,
createBackendAuthOAuthConfig_oAuthGrantType,
createBackendAuthOAuthConfig_oAuthScopes,
CreateBackendAuthPasswordPolicyConfig (..),
newCreateBackendAuthPasswordPolicyConfig,
createBackendAuthPasswordPolicyConfig_additionalConstraints,
createBackendAuthPasswordPolicyConfig_minimumLength,
CreateBackendAuthResourceConfig (..),
newCreateBackendAuthResourceConfig,
createBackendAuthResourceConfig_identityPoolConfigs,
createBackendAuthResourceConfig_authResources,
createBackendAuthResourceConfig_userPoolConfigs,
createBackendAuthResourceConfig_service,
CreateBackendAuthUserPoolConfig (..),
newCreateBackendAuthUserPoolConfig,
createBackendAuthUserPoolConfig_forgotPassword,
createBackendAuthUserPoolConfig_mfa,
createBackendAuthUserPoolConfig_oAuth,
createBackendAuthUserPoolConfig_passwordPolicy,
createBackendAuthUserPoolConfig_verificationMessage,
createBackendAuthUserPoolConfig_requiredSignUpAttributes,
createBackendAuthUserPoolConfig_signInMethod,
createBackendAuthUserPoolConfig_userPoolName,
CreateBackendAuthVerificationMessageConfig (..),
newCreateBackendAuthVerificationMessageConfig,
createBackendAuthVerificationMessageConfig_emailSettings,
createBackendAuthVerificationMessageConfig_smsSettings,
createBackendAuthVerificationMessageConfig_deliveryMethod,
CreateBackendStorageResourceConfig (..),
newCreateBackendStorageResourceConfig,
createBackendStorageResourceConfig_bucketName,
createBackendStorageResourceConfig_serviceName,
createBackendStorageResourceConfig_permissions,
EmailSettings (..),
newEmailSettings,
emailSettings_emailMessage,
emailSettings_emailSubject,
GetBackendStorageResourceConfig (..),
newGetBackendStorageResourceConfig,
getBackendStorageResourceConfig_bucketName,
getBackendStorageResourceConfig_permissions,
getBackendStorageResourceConfig_serviceName,
getBackendStorageResourceConfig_imported,
LoginAuthConfigReqObj (..),
newLoginAuthConfigReqObj,
loginAuthConfigReqObj_awsCognitoIdentityPoolId,
loginAuthConfigReqObj_awsCognitoRegion,
loginAuthConfigReqObj_awsUserPoolsId,
loginAuthConfigReqObj_awsUserPoolsWebClientId,
ResourceConfig (..),
newResourceConfig,
S3BucketInfo (..),
newS3BucketInfo,
s3BucketInfo_creationDate,
s3BucketInfo_name,
Settings (..),
newSettings,
settings_mfaTypes,
settings_smsMessage,
SmsSettings (..),
newSmsSettings,
smsSettings_smsMessage,
SocialProviderSettings (..),
newSocialProviderSettings,
socialProviderSettings_facebook,
socialProviderSettings_google,
socialProviderSettings_loginWithAmazon,
socialProviderSettings_signInWithApple,
UpdateBackendAuthForgotPasswordConfig (..),
newUpdateBackendAuthForgotPasswordConfig,
updateBackendAuthForgotPasswordConfig_deliveryMethod,
updateBackendAuthForgotPasswordConfig_emailSettings,
updateBackendAuthForgotPasswordConfig_smsSettings,
UpdateBackendAuthIdentityPoolConfig (..),
newUpdateBackendAuthIdentityPoolConfig,
updateBackendAuthIdentityPoolConfig_unauthenticatedLogin,
UpdateBackendAuthMFAConfig (..),
newUpdateBackendAuthMFAConfig,
updateBackendAuthMFAConfig_mfaMode,
updateBackendAuthMFAConfig_settings,
UpdateBackendAuthOAuthConfig (..),
newUpdateBackendAuthOAuthConfig,
updateBackendAuthOAuthConfig_domainPrefix,
updateBackendAuthOAuthConfig_oAuthGrantType,
updateBackendAuthOAuthConfig_oAuthScopes,
updateBackendAuthOAuthConfig_redirectSignInURIs,
updateBackendAuthOAuthConfig_redirectSignOutURIs,
updateBackendAuthOAuthConfig_socialProviderSettings,
UpdateBackendAuthPasswordPolicyConfig (..),
newUpdateBackendAuthPasswordPolicyConfig,
updateBackendAuthPasswordPolicyConfig_additionalConstraints,
updateBackendAuthPasswordPolicyConfig_minimumLength,
UpdateBackendAuthResourceConfig (..),
newUpdateBackendAuthResourceConfig,
updateBackendAuthResourceConfig_identityPoolConfigs,
updateBackendAuthResourceConfig_authResources,
updateBackendAuthResourceConfig_userPoolConfigs,
updateBackendAuthResourceConfig_service,
UpdateBackendAuthUserPoolConfig (..),
newUpdateBackendAuthUserPoolConfig,
updateBackendAuthUserPoolConfig_forgotPassword,
updateBackendAuthUserPoolConfig_mfa,
updateBackendAuthUserPoolConfig_oAuth,
updateBackendAuthUserPoolConfig_passwordPolicy,
updateBackendAuthUserPoolConfig_verificationMessage,
UpdateBackendAuthVerificationMessageConfig (..),
newUpdateBackendAuthVerificationMessageConfig,
updateBackendAuthVerificationMessageConfig_emailSettings,
updateBackendAuthVerificationMessageConfig_smsSettings,
updateBackendAuthVerificationMessageConfig_deliveryMethod,
UpdateBackendStorageResourceConfig (..),
newUpdateBackendStorageResourceConfig,
updateBackendStorageResourceConfig_serviceName,
updateBackendStorageResourceConfig_permissions,
)
where
import Amazonka.AmplifyBackend.Types.AdditionalConstraintsElement
import Amazonka.AmplifyBackend.Types.AuthResources
import Amazonka.AmplifyBackend.Types.AuthenticatedElement
import Amazonka.AmplifyBackend.Types.BackendAPIAppSyncAuthSettings
import Amazonka.AmplifyBackend.Types.BackendAPIAuthType
import Amazonka.AmplifyBackend.Types.BackendAPIConflictResolution
import Amazonka.AmplifyBackend.Types.BackendAPIResourceConfig
import Amazonka.AmplifyBackend.Types.BackendAuthAppleProviderConfig
import Amazonka.AmplifyBackend.Types.BackendAuthSocialProviderConfig
import Amazonka.AmplifyBackend.Types.BackendJobRespObj
import Amazonka.AmplifyBackend.Types.BackendStoragePermissions
import Amazonka.AmplifyBackend.Types.CreateBackendAuthForgotPasswordConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthIdentityPoolConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthMFAConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthOAuthConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthPasswordPolicyConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthResourceConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthUserPoolConfig
import Amazonka.AmplifyBackend.Types.CreateBackendAuthVerificationMessageConfig
import Amazonka.AmplifyBackend.Types.CreateBackendStorageResourceConfig
import Amazonka.AmplifyBackend.Types.DeliveryMethod
import Amazonka.AmplifyBackend.Types.EmailSettings
import Amazonka.AmplifyBackend.Types.GetBackendStorageResourceConfig
import Amazonka.AmplifyBackend.Types.LoginAuthConfigReqObj
import Amazonka.AmplifyBackend.Types.MFAMode
import Amazonka.AmplifyBackend.Types.MfaTypesElement
import Amazonka.AmplifyBackend.Types.Mode
import Amazonka.AmplifyBackend.Types.OAuthGrantType
import Amazonka.AmplifyBackend.Types.OAuthScopesElement
import Amazonka.AmplifyBackend.Types.RequiredSignUpAttributesElement
import Amazonka.AmplifyBackend.Types.ResolutionStrategy
import Amazonka.AmplifyBackend.Types.ResourceConfig
import Amazonka.AmplifyBackend.Types.S3BucketInfo
import Amazonka.AmplifyBackend.Types.Service
import Amazonka.AmplifyBackend.Types.ServiceName
import Amazonka.AmplifyBackend.Types.Settings
import Amazonka.AmplifyBackend.Types.SignInMethod
import Amazonka.AmplifyBackend.Types.SmsSettings
import Amazonka.AmplifyBackend.Types.SocialProviderSettings
import Amazonka.AmplifyBackend.Types.Status
import Amazonka.AmplifyBackend.Types.UnAuthenticatedElement
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthForgotPasswordConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthIdentityPoolConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthMFAConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthOAuthConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthPasswordPolicyConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthResourceConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthUserPoolConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendAuthVerificationMessageConfig
import Amazonka.AmplifyBackend.Types.UpdateBackendStorageResourceConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Sign.V4 as Sign
defaultService :: Core.Service
defaultService :: Service
defaultService =
Core.Service
{ $sel:abbrev:Service :: Abbrev
Core.abbrev = Abbrev
"AmplifyBackend",
$sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
$sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"amplifybackend",
$sel:signingName:Service :: ByteString
Core.signingName = ByteString
"amplifybackend",
$sel:version:Service :: ByteString
Core.version = ByteString
"2020-08-11",
$sel:s3AddressingStyle:Service :: S3AddressingStyle
Core.s3AddressingStyle = S3AddressingStyle
Core.S3AddressingStyleAuto,
$sel:endpoint:Service :: Region -> Endpoint
Core.endpoint = Service -> Region -> Endpoint
Core.defaultEndpoint Service
defaultService,
$sel:timeout:Service :: Maybe Seconds
Core.timeout = forall a. a -> Maybe a
Prelude.Just Seconds
70,
$sel:check:Service :: Status -> Bool
Core.check = Status -> Bool
Core.statusSuccess,
$sel:error:Service :: Status -> [Header] -> ByteStringLazy -> Error
Core.error = Abbrev -> Status -> [Header] -> ByteStringLazy -> Error
Core.parseJSONError Abbrev
"AmplifyBackend",
$sel:retry:Service :: Retry
Core.retry = Retry
retry
}
where
retry :: Retry
retry =
Core.Exponential
{ $sel:base:Exponential :: Double
Core.base = Double
5.0e-2,
$sel:growth:Exponential :: Int
Core.growth = Int
2,
$sel:attempts:Exponential :: Int
Core.attempts = Int
5,
$sel:check:Exponential :: ServiceError -> Maybe Text
Core.check = forall {a}. IsString a => ServiceError -> Maybe a
check
}
check :: ServiceError -> Maybe a
check ServiceError
e
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
502) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"bad_gateway"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"gateway_timeout"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
500) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"general_server_error"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
509) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"limit_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"RequestThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"request_throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
503) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"service_unavailable"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottledException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttled_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"Throttling"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode ErrorCode
"ThrottlingException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throttling_exception"
| forall s a. Getting Any s a -> s -> Bool
Lens.has
( forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
ErrorCode -> Optic' p f ServiceError ServiceError
Core.hasCode
ErrorCode
"ProvisionedThroughputExceededException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
)
ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"throughput_exceeded"
| forall s a. Getting Any s a -> s -> Bool
Lens.has (forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429) ServiceError
e =
forall a. a -> Maybe a
Prelude.Just a
"too_many_requests"
| Bool
Prelude.otherwise = forall a. Maybe a
Prelude.Nothing
_BadRequestException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_BadRequestException :: forall a. AsError a => Fold a ServiceError
_BadRequestException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"BadRequestException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
400
_GatewayTimeoutException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_GatewayTimeoutException :: forall a. AsError a => Fold a ServiceError
_GatewayTimeoutException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"GatewayTimeoutException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
504
_NotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_NotFoundException :: forall a. AsError a => Fold a ServiceError
_NotFoundException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"NotFoundException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
404
_TooManyRequestsException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_TooManyRequestsException :: forall a. AsError a => Fold a ServiceError
_TooManyRequestsException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"TooManyRequestsException"
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (p :: * -> * -> *).
(Applicative f, Choice p) =>
Int -> Optic' p f ServiceError ServiceError
Core.hasStatus Int
429