{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.CodeGuruReviewer.CreateCodeReview
-- 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)
--
-- Use to create a code review with a
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html CodeReviewType>
-- of @RepositoryAnalysis@. This type of code review analyzes all code
-- under a specified branch in an associated repository. @PullRequest@ code
-- reviews are automatically triggered by a pull request.
module Amazonka.CodeGuruReviewer.CreateCodeReview
  ( -- * Creating a Request
    CreateCodeReview (..),
    newCreateCodeReview,

    -- * Request Lenses
    createCodeReview_clientRequestToken,
    createCodeReview_name,
    createCodeReview_repositoryAssociationArn,
    createCodeReview_type,

    -- * Destructuring the Response
    CreateCodeReviewResponse (..),
    newCreateCodeReviewResponse,

    -- * Response Lenses
    createCodeReviewResponse_codeReview,
    createCodeReviewResponse_httpStatus,
  )
where

import Amazonka.CodeGuruReviewer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateCodeReview' smart constructor.
data CreateCodeReview = CreateCodeReview'
  { -- | Amazon CodeGuru Reviewer uses this value to prevent the accidental
    -- creation of duplicate code reviews if there are failures and retries.
    CreateCodeReview -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the code review. The name of each code review in your Amazon
    -- Web Services account must be unique.
    CreateCodeReview -> Text
name :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the
    -- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html RepositoryAssociation>
    -- object. You can retrieve this ARN by calling
    -- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html ListRepositoryAssociations>
    -- .
    --
    -- A code review can only be created on an associated repository. This is
    -- the ARN of the associated repository.
    CreateCodeReview -> Text
repositoryAssociationArn :: Prelude.Text,
    -- | The type of code review to create. This is specified using a
    -- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html CodeReviewType>
    -- object. You can create a code review only of type @RepositoryAnalysis@.
    CreateCodeReview -> CodeReviewType
type' :: CodeReviewType
  }
  deriving (CreateCodeReview -> CreateCodeReview -> Bool
(CreateCodeReview -> CreateCodeReview -> Bool)
-> (CreateCodeReview -> CreateCodeReview -> Bool)
-> Eq CreateCodeReview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCodeReview -> CreateCodeReview -> Bool
$c/= :: CreateCodeReview -> CreateCodeReview -> Bool
== :: CreateCodeReview -> CreateCodeReview -> Bool
$c== :: CreateCodeReview -> CreateCodeReview -> Bool
Prelude.Eq, ReadPrec [CreateCodeReview]
ReadPrec CreateCodeReview
Int -> ReadS CreateCodeReview
ReadS [CreateCodeReview]
(Int -> ReadS CreateCodeReview)
-> ReadS [CreateCodeReview]
-> ReadPrec CreateCodeReview
-> ReadPrec [CreateCodeReview]
-> Read CreateCodeReview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCodeReview]
$creadListPrec :: ReadPrec [CreateCodeReview]
readPrec :: ReadPrec CreateCodeReview
$creadPrec :: ReadPrec CreateCodeReview
readList :: ReadS [CreateCodeReview]
$creadList :: ReadS [CreateCodeReview]
readsPrec :: Int -> ReadS CreateCodeReview
$creadsPrec :: Int -> ReadS CreateCodeReview
Prelude.Read, Int -> CreateCodeReview -> ShowS
[CreateCodeReview] -> ShowS
CreateCodeReview -> String
(Int -> CreateCodeReview -> ShowS)
-> (CreateCodeReview -> String)
-> ([CreateCodeReview] -> ShowS)
-> Show CreateCodeReview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCodeReview] -> ShowS
$cshowList :: [CreateCodeReview] -> ShowS
show :: CreateCodeReview -> String
$cshow :: CreateCodeReview -> String
showsPrec :: Int -> CreateCodeReview -> ShowS
$cshowsPrec :: Int -> CreateCodeReview -> ShowS
Prelude.Show, (forall x. CreateCodeReview -> Rep CreateCodeReview x)
-> (forall x. Rep CreateCodeReview x -> CreateCodeReview)
-> Generic CreateCodeReview
forall x. Rep CreateCodeReview x -> CreateCodeReview
forall x. CreateCodeReview -> Rep CreateCodeReview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCodeReview x -> CreateCodeReview
$cfrom :: forall x. CreateCodeReview -> Rep CreateCodeReview x
Prelude.Generic)

-- |
-- Create a value of 'CreateCodeReview' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientRequestToken', 'createCodeReview_clientRequestToken' - Amazon CodeGuru Reviewer uses this value to prevent the accidental
-- creation of duplicate code reviews if there are failures and retries.
--
-- 'name', 'createCodeReview_name' - The name of the code review. The name of each code review in your Amazon
-- Web Services account must be unique.
--
-- 'repositoryAssociationArn', 'createCodeReview_repositoryAssociationArn' - The Amazon Resource Name (ARN) of the
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html RepositoryAssociation>
-- object. You can retrieve this ARN by calling
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html ListRepositoryAssociations>
-- .
--
-- A code review can only be created on an associated repository. This is
-- the ARN of the associated repository.
--
-- 'type'', 'createCodeReview_type' - The type of code review to create. This is specified using a
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html CodeReviewType>
-- object. You can create a code review only of type @RepositoryAnalysis@.
newCreateCodeReview ::
  -- | 'name'
  Prelude.Text ->
  -- | 'repositoryAssociationArn'
  Prelude.Text ->
  -- | 'type''
  CodeReviewType ->
  CreateCodeReview
newCreateCodeReview :: Text -> Text -> CodeReviewType -> CreateCodeReview
newCreateCodeReview
  Text
pName_
  Text
pRepositoryAssociationArn_
  CodeReviewType
pType_ =
    CreateCodeReview' :: Maybe Text -> Text -> Text -> CodeReviewType -> CreateCodeReview
CreateCodeReview'
      { $sel:clientRequestToken:CreateCodeReview' :: Maybe Text
clientRequestToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateCodeReview' :: Text
name = Text
pName_,
        $sel:repositoryAssociationArn:CreateCodeReview' :: Text
repositoryAssociationArn =
          Text
pRepositoryAssociationArn_,
        $sel:type':CreateCodeReview' :: CodeReviewType
type' = CodeReviewType
pType_
      }

-- | Amazon CodeGuru Reviewer uses this value to prevent the accidental
-- creation of duplicate code reviews if there are failures and retries.
createCodeReview_clientRequestToken :: Lens.Lens' CreateCodeReview (Prelude.Maybe Prelude.Text)
createCodeReview_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateCodeReview -> f CreateCodeReview
createCodeReview_clientRequestToken = (CreateCodeReview -> Maybe Text)
-> (CreateCodeReview -> Maybe Text -> CreateCodeReview)
-> Lens CreateCodeReview CreateCodeReview (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCodeReview' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateCodeReview' :: CreateCodeReview -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateCodeReview
s@CreateCodeReview' {} Maybe Text
a -> CreateCodeReview
s {$sel:clientRequestToken:CreateCodeReview' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateCodeReview)

-- | The name of the code review. The name of each code review in your Amazon
-- Web Services account must be unique.
createCodeReview_name :: Lens.Lens' CreateCodeReview Prelude.Text
createCodeReview_name :: (Text -> f Text) -> CreateCodeReview -> f CreateCodeReview
createCodeReview_name = (CreateCodeReview -> Text)
-> (CreateCodeReview -> Text -> CreateCodeReview)
-> Lens CreateCodeReview CreateCodeReview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCodeReview' {Text
name :: Text
$sel:name:CreateCodeReview' :: CreateCodeReview -> Text
name} -> Text
name) (\s :: CreateCodeReview
s@CreateCodeReview' {} Text
a -> CreateCodeReview
s {$sel:name:CreateCodeReview' :: Text
name = Text
a} :: CreateCodeReview)

-- | The Amazon Resource Name (ARN) of the
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html RepositoryAssociation>
-- object. You can retrieve this ARN by calling
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html ListRepositoryAssociations>
-- .
--
-- A code review can only be created on an associated repository. This is
-- the ARN of the associated repository.
createCodeReview_repositoryAssociationArn :: Lens.Lens' CreateCodeReview Prelude.Text
createCodeReview_repositoryAssociationArn :: (Text -> f Text) -> CreateCodeReview -> f CreateCodeReview
createCodeReview_repositoryAssociationArn = (CreateCodeReview -> Text)
-> (CreateCodeReview -> Text -> CreateCodeReview)
-> Lens CreateCodeReview CreateCodeReview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCodeReview' {Text
repositoryAssociationArn :: Text
$sel:repositoryAssociationArn:CreateCodeReview' :: CreateCodeReview -> Text
repositoryAssociationArn} -> Text
repositoryAssociationArn) (\s :: CreateCodeReview
s@CreateCodeReview' {} Text
a -> CreateCodeReview
s {$sel:repositoryAssociationArn:CreateCodeReview' :: Text
repositoryAssociationArn = Text
a} :: CreateCodeReview)

-- | The type of code review to create. This is specified using a
-- <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html CodeReviewType>
-- object. You can create a code review only of type @RepositoryAnalysis@.
createCodeReview_type :: Lens.Lens' CreateCodeReview CodeReviewType
createCodeReview_type :: (CodeReviewType -> f CodeReviewType)
-> CreateCodeReview -> f CreateCodeReview
createCodeReview_type = (CreateCodeReview -> CodeReviewType)
-> (CreateCodeReview -> CodeReviewType -> CreateCodeReview)
-> Lens
     CreateCodeReview CreateCodeReview CodeReviewType CodeReviewType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCodeReview' {CodeReviewType
type' :: CodeReviewType
$sel:type':CreateCodeReview' :: CreateCodeReview -> CodeReviewType
type'} -> CodeReviewType
type') (\s :: CreateCodeReview
s@CreateCodeReview' {} CodeReviewType
a -> CreateCodeReview
s {$sel:type':CreateCodeReview' :: CodeReviewType
type' = CodeReviewType
a} :: CreateCodeReview)

instance Core.AWSRequest CreateCodeReview where
  type
    AWSResponse CreateCodeReview =
      CreateCodeReviewResponse
  request :: CreateCodeReview -> Request CreateCodeReview
request = Service -> CreateCodeReview -> Request CreateCodeReview
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateCodeReview
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCodeReview)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateCodeReview))
-> Logger
-> Service
-> Proxy CreateCodeReview
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateCodeReview)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CodeReview -> Int -> CreateCodeReviewResponse
CreateCodeReviewResponse'
            (Maybe CodeReview -> Int -> CreateCodeReviewResponse)
-> Either String (Maybe CodeReview)
-> Either String (Int -> CreateCodeReviewResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CodeReview)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CodeReview")
            Either String (Int -> CreateCodeReviewResponse)
-> Either String Int -> Either String CreateCodeReviewResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateCodeReview

instance Prelude.NFData CreateCodeReview

instance Core.ToHeaders CreateCodeReview where
  toHeaders :: CreateCodeReview -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateCodeReview -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateCodeReview where
  toJSON :: CreateCodeReview -> Value
toJSON CreateCodeReview' {Maybe Text
Text
CodeReviewType
type' :: CodeReviewType
repositoryAssociationArn :: Text
name :: Text
clientRequestToken :: Maybe Text
$sel:type':CreateCodeReview' :: CreateCodeReview -> CodeReviewType
$sel:repositoryAssociationArn:CreateCodeReview' :: CreateCodeReview -> Text
$sel:name:CreateCodeReview' :: CreateCodeReview -> Text
$sel:clientRequestToken:CreateCodeReview' :: CreateCodeReview -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"RepositoryAssociationArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryAssociationArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> CodeReviewType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CodeReviewType
type')
          ]
      )

instance Core.ToPath CreateCodeReview where
  toPath :: CreateCodeReview -> ByteString
toPath = ByteString -> CreateCodeReview -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/codereviews"

instance Core.ToQuery CreateCodeReview where
  toQuery :: CreateCodeReview -> QueryString
toQuery = QueryString -> CreateCodeReview -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateCodeReviewResponse' smart constructor.
data CreateCodeReviewResponse = CreateCodeReviewResponse'
  { CreateCodeReviewResponse -> Maybe CodeReview
codeReview :: Prelude.Maybe CodeReview,
    -- | The response's http status code.
    CreateCodeReviewResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool
(CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool)
-> (CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool)
-> Eq CreateCodeReviewResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool
$c/= :: CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool
== :: CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool
$c== :: CreateCodeReviewResponse -> CreateCodeReviewResponse -> Bool
Prelude.Eq, ReadPrec [CreateCodeReviewResponse]
ReadPrec CreateCodeReviewResponse
Int -> ReadS CreateCodeReviewResponse
ReadS [CreateCodeReviewResponse]
(Int -> ReadS CreateCodeReviewResponse)
-> ReadS [CreateCodeReviewResponse]
-> ReadPrec CreateCodeReviewResponse
-> ReadPrec [CreateCodeReviewResponse]
-> Read CreateCodeReviewResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCodeReviewResponse]
$creadListPrec :: ReadPrec [CreateCodeReviewResponse]
readPrec :: ReadPrec CreateCodeReviewResponse
$creadPrec :: ReadPrec CreateCodeReviewResponse
readList :: ReadS [CreateCodeReviewResponse]
$creadList :: ReadS [CreateCodeReviewResponse]
readsPrec :: Int -> ReadS CreateCodeReviewResponse
$creadsPrec :: Int -> ReadS CreateCodeReviewResponse
Prelude.Read, Int -> CreateCodeReviewResponse -> ShowS
[CreateCodeReviewResponse] -> ShowS
CreateCodeReviewResponse -> String
(Int -> CreateCodeReviewResponse -> ShowS)
-> (CreateCodeReviewResponse -> String)
-> ([CreateCodeReviewResponse] -> ShowS)
-> Show CreateCodeReviewResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCodeReviewResponse] -> ShowS
$cshowList :: [CreateCodeReviewResponse] -> ShowS
show :: CreateCodeReviewResponse -> String
$cshow :: CreateCodeReviewResponse -> String
showsPrec :: Int -> CreateCodeReviewResponse -> ShowS
$cshowsPrec :: Int -> CreateCodeReviewResponse -> ShowS
Prelude.Show, (forall x.
 CreateCodeReviewResponse -> Rep CreateCodeReviewResponse x)
-> (forall x.
    Rep CreateCodeReviewResponse x -> CreateCodeReviewResponse)
-> Generic CreateCodeReviewResponse
forall x.
Rep CreateCodeReviewResponse x -> CreateCodeReviewResponse
forall x.
CreateCodeReviewResponse -> Rep CreateCodeReviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCodeReviewResponse x -> CreateCodeReviewResponse
$cfrom :: forall x.
CreateCodeReviewResponse -> Rep CreateCodeReviewResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCodeReviewResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'codeReview', 'createCodeReviewResponse_codeReview' - Undocumented member.
--
-- 'httpStatus', 'createCodeReviewResponse_httpStatus' - The response's http status code.
newCreateCodeReviewResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCodeReviewResponse
newCreateCodeReviewResponse :: Int -> CreateCodeReviewResponse
newCreateCodeReviewResponse Int
pHttpStatus_ =
  CreateCodeReviewResponse' :: Maybe CodeReview -> Int -> CreateCodeReviewResponse
CreateCodeReviewResponse'
    { $sel:codeReview:CreateCodeReviewResponse' :: Maybe CodeReview
codeReview =
        Maybe CodeReview
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCodeReviewResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createCodeReviewResponse_codeReview :: Lens.Lens' CreateCodeReviewResponse (Prelude.Maybe CodeReview)
createCodeReviewResponse_codeReview :: (Maybe CodeReview -> f (Maybe CodeReview))
-> CreateCodeReviewResponse -> f CreateCodeReviewResponse
createCodeReviewResponse_codeReview = (CreateCodeReviewResponse -> Maybe CodeReview)
-> (CreateCodeReviewResponse
    -> Maybe CodeReview -> CreateCodeReviewResponse)
-> Lens
     CreateCodeReviewResponse
     CreateCodeReviewResponse
     (Maybe CodeReview)
     (Maybe CodeReview)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCodeReviewResponse' {Maybe CodeReview
codeReview :: Maybe CodeReview
$sel:codeReview:CreateCodeReviewResponse' :: CreateCodeReviewResponse -> Maybe CodeReview
codeReview} -> Maybe CodeReview
codeReview) (\s :: CreateCodeReviewResponse
s@CreateCodeReviewResponse' {} Maybe CodeReview
a -> CreateCodeReviewResponse
s {$sel:codeReview:CreateCodeReviewResponse' :: Maybe CodeReview
codeReview = Maybe CodeReview
a} :: CreateCodeReviewResponse)

-- | The response's http status code.
createCodeReviewResponse_httpStatus :: Lens.Lens' CreateCodeReviewResponse Prelude.Int
createCodeReviewResponse_httpStatus :: (Int -> f Int)
-> CreateCodeReviewResponse -> f CreateCodeReviewResponse
createCodeReviewResponse_httpStatus = (CreateCodeReviewResponse -> Int)
-> (CreateCodeReviewResponse -> Int -> CreateCodeReviewResponse)
-> Lens CreateCodeReviewResponse CreateCodeReviewResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCodeReviewResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateCodeReviewResponse' :: CreateCodeReviewResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateCodeReviewResponse
s@CreateCodeReviewResponse' {} Int
a -> CreateCodeReviewResponse
s {$sel:httpStatus:CreateCodeReviewResponse' :: Int
httpStatus = Int
a} :: CreateCodeReviewResponse)

instance Prelude.NFData CreateCodeReviewResponse