{-# LANGUAGE DisambiguateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeGuruReviewer.Types
(
defaultService,
_AccessDeniedException,
_ConflictException,
_InternalServerException,
_NotFoundException,
_ResourceNotFoundException,
_ThrottlingException,
_ValidationException,
AnalysisType (..),
ConfigFileState (..),
EncryptionOption (..),
JobState (..),
ProviderType (..),
Reaction (..),
RecommendationCategory (..),
RepositoryAssociationState (..),
Severity (..),
Type (..),
VendorName (..),
BranchDiffSourceCodeType (..),
newBranchDiffSourceCodeType,
branchDiffSourceCodeType_sourceBranchName,
branchDiffSourceCodeType_destinationBranchName,
CodeArtifacts (..),
newCodeArtifacts,
codeArtifacts_buildArtifactsObjectKey,
codeArtifacts_sourceCodeArtifactsObjectKey,
CodeCommitRepository (..),
newCodeCommitRepository,
codeCommitRepository_name,
CodeReview (..),
newCodeReview,
codeReview_analysisTypes,
codeReview_associationArn,
codeReview_codeReviewArn,
codeReview_configFileState,
codeReview_createdTimeStamp,
codeReview_lastUpdatedTimeStamp,
codeReview_metrics,
codeReview_name,
codeReview_owner,
codeReview_providerType,
codeReview_pullRequestId,
codeReview_repositoryName,
codeReview_sourceCodeType,
codeReview_state,
codeReview_stateReason,
codeReview_type,
CodeReviewSummary (..),
newCodeReviewSummary,
codeReviewSummary_codeReviewArn,
codeReviewSummary_createdTimeStamp,
codeReviewSummary_lastUpdatedTimeStamp,
codeReviewSummary_metricsSummary,
codeReviewSummary_name,
codeReviewSummary_owner,
codeReviewSummary_providerType,
codeReviewSummary_pullRequestId,
codeReviewSummary_repositoryName,
codeReviewSummary_sourceCodeType,
codeReviewSummary_state,
codeReviewSummary_type,
CodeReviewType (..),
newCodeReviewType,
codeReviewType_analysisTypes,
codeReviewType_repositoryAnalysis,
CommitDiffSourceCodeType (..),
newCommitDiffSourceCodeType,
commitDiffSourceCodeType_destinationCommit,
commitDiffSourceCodeType_mergeBaseCommit,
commitDiffSourceCodeType_sourceCommit,
EventInfo (..),
newEventInfo,
eventInfo_name,
eventInfo_state,
KMSKeyDetails (..),
newKMSKeyDetails,
kmsKeyDetails_encryptionOption,
kmsKeyDetails_kmsKeyId,
Metrics (..),
newMetrics,
metrics_findingsCount,
metrics_meteredLinesOfCodeCount,
metrics_suppressedLinesOfCodeCount,
MetricsSummary (..),
newMetricsSummary,
metricsSummary_findingsCount,
metricsSummary_meteredLinesOfCodeCount,
metricsSummary_suppressedLinesOfCodeCount,
RecommendationFeedback (..),
newRecommendationFeedback,
recommendationFeedback_codeReviewArn,
recommendationFeedback_createdTimeStamp,
recommendationFeedback_lastUpdatedTimeStamp,
recommendationFeedback_reactions,
recommendationFeedback_recommendationId,
recommendationFeedback_userId,
RecommendationFeedbackSummary (..),
newRecommendationFeedbackSummary,
recommendationFeedbackSummary_reactions,
recommendationFeedbackSummary_recommendationId,
recommendationFeedbackSummary_userId,
RecommendationSummary (..),
newRecommendationSummary,
recommendationSummary_description,
recommendationSummary_endLine,
recommendationSummary_filePath,
recommendationSummary_recommendationCategory,
recommendationSummary_recommendationId,
recommendationSummary_ruleMetadata,
recommendationSummary_severity,
recommendationSummary_startLine,
Repository (..),
newRepository,
repository_bitbucket,
repository_codeCommit,
repository_gitHubEnterpriseServer,
repository_s3Bucket,
RepositoryAnalysis (..),
newRepositoryAnalysis,
repositoryAnalysis_repositoryHead,
repositoryAnalysis_sourceCodeType,
RepositoryAssociation (..),
newRepositoryAssociation,
repositoryAssociation_associationArn,
repositoryAssociation_associationId,
repositoryAssociation_connectionArn,
repositoryAssociation_createdTimeStamp,
repositoryAssociation_kmsKeyDetails,
repositoryAssociation_lastUpdatedTimeStamp,
repositoryAssociation_name,
repositoryAssociation_owner,
repositoryAssociation_providerType,
repositoryAssociation_s3RepositoryDetails,
repositoryAssociation_state,
repositoryAssociation_stateReason,
RepositoryAssociationSummary (..),
newRepositoryAssociationSummary,
repositoryAssociationSummary_associationArn,
repositoryAssociationSummary_associationId,
repositoryAssociationSummary_connectionArn,
repositoryAssociationSummary_lastUpdatedTimeStamp,
repositoryAssociationSummary_name,
repositoryAssociationSummary_owner,
repositoryAssociationSummary_providerType,
repositoryAssociationSummary_state,
RepositoryHeadSourceCodeType (..),
newRepositoryHeadSourceCodeType,
repositoryHeadSourceCodeType_branchName,
RequestMetadata (..),
newRequestMetadata,
requestMetadata_eventInfo,
requestMetadata_requestId,
requestMetadata_requester,
requestMetadata_vendorName,
RuleMetadata (..),
newRuleMetadata,
ruleMetadata_longDescription,
ruleMetadata_ruleId,
ruleMetadata_ruleName,
ruleMetadata_ruleTags,
ruleMetadata_shortDescription,
S3BucketRepository (..),
newS3BucketRepository,
s3BucketRepository_details,
s3BucketRepository_name,
S3Repository (..),
newS3Repository,
s3Repository_name,
s3Repository_bucketName,
S3RepositoryDetails (..),
newS3RepositoryDetails,
s3RepositoryDetails_bucketName,
s3RepositoryDetails_codeArtifacts,
SourceCodeType (..),
newSourceCodeType,
sourceCodeType_branchDiff,
sourceCodeType_commitDiff,
sourceCodeType_repositoryHead,
sourceCodeType_requestMetadata,
sourceCodeType_s3BucketRepository,
ThirdPartySourceRepository (..),
newThirdPartySourceRepository,
thirdPartySourceRepository_name,
thirdPartySourceRepository_connectionArn,
thirdPartySourceRepository_owner,
)
where
import Amazonka.CodeGuruReviewer.Types.AnalysisType
import Amazonka.CodeGuruReviewer.Types.BranchDiffSourceCodeType
import Amazonka.CodeGuruReviewer.Types.CodeArtifacts
import Amazonka.CodeGuruReviewer.Types.CodeCommitRepository
import Amazonka.CodeGuruReviewer.Types.CodeReview
import Amazonka.CodeGuruReviewer.Types.CodeReviewSummary
import Amazonka.CodeGuruReviewer.Types.CodeReviewType
import Amazonka.CodeGuruReviewer.Types.CommitDiffSourceCodeType
import Amazonka.CodeGuruReviewer.Types.ConfigFileState
import Amazonka.CodeGuruReviewer.Types.EncryptionOption
import Amazonka.CodeGuruReviewer.Types.EventInfo
import Amazonka.CodeGuruReviewer.Types.JobState
import Amazonka.CodeGuruReviewer.Types.KMSKeyDetails
import Amazonka.CodeGuruReviewer.Types.Metrics
import Amazonka.CodeGuruReviewer.Types.MetricsSummary
import Amazonka.CodeGuruReviewer.Types.ProviderType
import Amazonka.CodeGuruReviewer.Types.Reaction
import Amazonka.CodeGuruReviewer.Types.RecommendationCategory
import Amazonka.CodeGuruReviewer.Types.RecommendationFeedback
import Amazonka.CodeGuruReviewer.Types.RecommendationFeedbackSummary
import Amazonka.CodeGuruReviewer.Types.RecommendationSummary
import Amazonka.CodeGuruReviewer.Types.Repository
import Amazonka.CodeGuruReviewer.Types.RepositoryAnalysis
import Amazonka.CodeGuruReviewer.Types.RepositoryAssociation
import Amazonka.CodeGuruReviewer.Types.RepositoryAssociationState
import Amazonka.CodeGuruReviewer.Types.RepositoryAssociationSummary
import Amazonka.CodeGuruReviewer.Types.RepositoryHeadSourceCodeType
import Amazonka.CodeGuruReviewer.Types.RequestMetadata
import Amazonka.CodeGuruReviewer.Types.RuleMetadata
import Amazonka.CodeGuruReviewer.Types.S3BucketRepository
import Amazonka.CodeGuruReviewer.Types.S3Repository
import Amazonka.CodeGuruReviewer.Types.S3RepositoryDetails
import Amazonka.CodeGuruReviewer.Types.Severity
import Amazonka.CodeGuruReviewer.Types.SourceCodeType
import Amazonka.CodeGuruReviewer.Types.ThirdPartySourceRepository
import Amazonka.CodeGuruReviewer.Types.Type
import Amazonka.CodeGuruReviewer.Types.VendorName
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
"CodeGuruReviewer",
$sel:signer:Service :: Signer
Core.signer = Signer
Sign.v4,
$sel:endpointPrefix:Service :: ByteString
Core.endpointPrefix = ByteString
"codeguru-reviewer",
$sel:signingName:Service :: ByteString
Core.signingName = ByteString
"codeguru-reviewer",
$sel:version:Service :: ByteString
Core.version = ByteString
"2019-09-19",
$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
"CodeGuruReviewer",
$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
_AccessDeniedException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_AccessDeniedException :: forall a. AsError a => Fold a ServiceError
_AccessDeniedException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"AccessDeniedException"
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
403
_ConflictException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ConflictException :: forall a. AsError a => Fold a ServiceError
_ConflictException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ConflictException"
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
409
_InternalServerException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_InternalServerException :: forall a. AsError a => Fold a ServiceError
_InternalServerException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"InternalServerException"
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
500
_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
_ResourceNotFoundException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ResourceNotFoundException :: forall a. AsError a => Fold a ServiceError
_ResourceNotFoundException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ResourceNotFoundException"
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
_ThrottlingException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ThrottlingException :: forall a. AsError a => Fold a ServiceError
_ThrottlingException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
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
429
_ValidationException :: (Core.AsError a) => Lens.Fold a Core.ServiceError
_ValidationException :: forall a. AsError a => Fold a ServiceError
_ValidationException =
forall a. AsError a => Service -> ErrorCode -> Fold a ServiceError
Core._MatchServiceError
Service
defaultService
ErrorCode
"ValidationException"
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