{-# 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.AuditManager.CreateAssessment
-- 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)
--
-- Creates an assessment in Audit Manager.
module Amazonka.AuditManager.CreateAssessment
  ( -- * Creating a Request
    CreateAssessment (..),
    newCreateAssessment,

    -- * Request Lenses
    createAssessment_description,
    createAssessment_tags,
    createAssessment_name,
    createAssessment_assessmentReportsDestination,
    createAssessment_scope,
    createAssessment_roles,
    createAssessment_frameworkId,

    -- * Destructuring the Response
    CreateAssessmentResponse (..),
    newCreateAssessmentResponse,

    -- * Response Lenses
    createAssessmentResponse_assessment,
    createAssessmentResponse_httpStatus,
  )
where

import Amazonka.AuditManager.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:/ 'newCreateAssessment' smart constructor.
data CreateAssessment = CreateAssessment'
  { -- | The optional description of the assessment to be created.
    CreateAssessment -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the assessment.
    CreateAssessment -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the assessment to be created.
    CreateAssessment -> Text
name :: Prelude.Text,
    -- | The assessment report storage destination for the specified assessment
    -- that is being created.
    CreateAssessment -> AssessmentReportsDestination
assessmentReportsDestination :: AssessmentReportsDestination,
    CreateAssessment -> Scope
scope :: Scope,
    -- | The list of roles for the specified assessment.
    CreateAssessment -> [Role]
roles :: [Role],
    -- | The identifier for the specified framework.
    CreateAssessment -> Text
frameworkId :: Prelude.Text
  }
  deriving (CreateAssessment -> CreateAssessment -> Bool
(CreateAssessment -> CreateAssessment -> Bool)
-> (CreateAssessment -> CreateAssessment -> Bool)
-> Eq CreateAssessment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssessment -> CreateAssessment -> Bool
$c/= :: CreateAssessment -> CreateAssessment -> Bool
== :: CreateAssessment -> CreateAssessment -> Bool
$c== :: CreateAssessment -> CreateAssessment -> Bool
Prelude.Eq, ReadPrec [CreateAssessment]
ReadPrec CreateAssessment
Int -> ReadS CreateAssessment
ReadS [CreateAssessment]
(Int -> ReadS CreateAssessment)
-> ReadS [CreateAssessment]
-> ReadPrec CreateAssessment
-> ReadPrec [CreateAssessment]
-> Read CreateAssessment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssessment]
$creadListPrec :: ReadPrec [CreateAssessment]
readPrec :: ReadPrec CreateAssessment
$creadPrec :: ReadPrec CreateAssessment
readList :: ReadS [CreateAssessment]
$creadList :: ReadS [CreateAssessment]
readsPrec :: Int -> ReadS CreateAssessment
$creadsPrec :: Int -> ReadS CreateAssessment
Prelude.Read, Int -> CreateAssessment -> ShowS
[CreateAssessment] -> ShowS
CreateAssessment -> String
(Int -> CreateAssessment -> ShowS)
-> (CreateAssessment -> String)
-> ([CreateAssessment] -> ShowS)
-> Show CreateAssessment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssessment] -> ShowS
$cshowList :: [CreateAssessment] -> ShowS
show :: CreateAssessment -> String
$cshow :: CreateAssessment -> String
showsPrec :: Int -> CreateAssessment -> ShowS
$cshowsPrec :: Int -> CreateAssessment -> ShowS
Prelude.Show, (forall x. CreateAssessment -> Rep CreateAssessment x)
-> (forall x. Rep CreateAssessment x -> CreateAssessment)
-> Generic CreateAssessment
forall x. Rep CreateAssessment x -> CreateAssessment
forall x. CreateAssessment -> Rep CreateAssessment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAssessment x -> CreateAssessment
$cfrom :: forall x. CreateAssessment -> Rep CreateAssessment x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssessment' 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:
--
-- 'description', 'createAssessment_description' - The optional description of the assessment to be created.
--
-- 'tags', 'createAssessment_tags' - The tags associated with the assessment.
--
-- 'name', 'createAssessment_name' - The name of the assessment to be created.
--
-- 'assessmentReportsDestination', 'createAssessment_assessmentReportsDestination' - The assessment report storage destination for the specified assessment
-- that is being created.
--
-- 'scope', 'createAssessment_scope' - Undocumented member.
--
-- 'roles', 'createAssessment_roles' - The list of roles for the specified assessment.
--
-- 'frameworkId', 'createAssessment_frameworkId' - The identifier for the specified framework.
newCreateAssessment ::
  -- | 'name'
  Prelude.Text ->
  -- | 'assessmentReportsDestination'
  AssessmentReportsDestination ->
  -- | 'scope'
  Scope ->
  -- | 'frameworkId'
  Prelude.Text ->
  CreateAssessment
newCreateAssessment :: Text
-> AssessmentReportsDestination
-> Scope
-> Text
-> CreateAssessment
newCreateAssessment
  Text
pName_
  AssessmentReportsDestination
pAssessmentReportsDestination_
  Scope
pScope_
  Text
pFrameworkId_ =
    CreateAssessment' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> AssessmentReportsDestination
-> Scope
-> [Role]
-> Text
-> CreateAssessment
CreateAssessment'
      { $sel:description:CreateAssessment' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAssessment' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateAssessment' :: Text
name = Text
pName_,
        $sel:assessmentReportsDestination:CreateAssessment' :: AssessmentReportsDestination
assessmentReportsDestination =
          AssessmentReportsDestination
pAssessmentReportsDestination_,
        $sel:scope:CreateAssessment' :: Scope
scope = Scope
pScope_,
        $sel:roles:CreateAssessment' :: [Role]
roles = [Role]
forall a. Monoid a => a
Prelude.mempty,
        $sel:frameworkId:CreateAssessment' :: Text
frameworkId = Text
pFrameworkId_
      }

-- | The optional description of the assessment to be created.
createAssessment_description :: Lens.Lens' CreateAssessment (Prelude.Maybe Prelude.Text)
createAssessment_description :: (Maybe Text -> f (Maybe Text))
-> CreateAssessment -> f CreateAssessment
createAssessment_description = (CreateAssessment -> Maybe Text)
-> (CreateAssessment -> Maybe Text -> CreateAssessment)
-> Lens CreateAssessment CreateAssessment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {Maybe Text
description :: Maybe Text
$sel:description:CreateAssessment' :: CreateAssessment -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateAssessment
s@CreateAssessment' {} Maybe Text
a -> CreateAssessment
s {$sel:description:CreateAssessment' :: Maybe Text
description = Maybe Text
a} :: CreateAssessment)

-- | The tags associated with the assessment.
createAssessment_tags :: Lens.Lens' CreateAssessment (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAssessment_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAssessment -> f CreateAssessment
createAssessment_tags = (CreateAssessment -> Maybe (HashMap Text Text))
-> (CreateAssessment
    -> Maybe (HashMap Text Text) -> CreateAssessment)
-> Lens
     CreateAssessment
     CreateAssessment
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateAssessment' :: CreateAssessment -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateAssessment
s@CreateAssessment' {} Maybe (HashMap Text Text)
a -> CreateAssessment
s {$sel:tags:CreateAssessment' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateAssessment) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateAssessment -> f CreateAssessment)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateAssessment
-> f CreateAssessment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the assessment to be created.
createAssessment_name :: Lens.Lens' CreateAssessment Prelude.Text
createAssessment_name :: (Text -> f Text) -> CreateAssessment -> f CreateAssessment
createAssessment_name = (CreateAssessment -> Text)
-> (CreateAssessment -> Text -> CreateAssessment)
-> Lens CreateAssessment CreateAssessment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {Text
name :: Text
$sel:name:CreateAssessment' :: CreateAssessment -> Text
name} -> Text
name) (\s :: CreateAssessment
s@CreateAssessment' {} Text
a -> CreateAssessment
s {$sel:name:CreateAssessment' :: Text
name = Text
a} :: CreateAssessment)

-- | The assessment report storage destination for the specified assessment
-- that is being created.
createAssessment_assessmentReportsDestination :: Lens.Lens' CreateAssessment AssessmentReportsDestination
createAssessment_assessmentReportsDestination :: (AssessmentReportsDestination -> f AssessmentReportsDestination)
-> CreateAssessment -> f CreateAssessment
createAssessment_assessmentReportsDestination = (CreateAssessment -> AssessmentReportsDestination)
-> (CreateAssessment
    -> AssessmentReportsDestination -> CreateAssessment)
-> Lens
     CreateAssessment
     CreateAssessment
     AssessmentReportsDestination
     AssessmentReportsDestination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {AssessmentReportsDestination
assessmentReportsDestination :: AssessmentReportsDestination
$sel:assessmentReportsDestination:CreateAssessment' :: CreateAssessment -> AssessmentReportsDestination
assessmentReportsDestination} -> AssessmentReportsDestination
assessmentReportsDestination) (\s :: CreateAssessment
s@CreateAssessment' {} AssessmentReportsDestination
a -> CreateAssessment
s {$sel:assessmentReportsDestination:CreateAssessment' :: AssessmentReportsDestination
assessmentReportsDestination = AssessmentReportsDestination
a} :: CreateAssessment)

-- | Undocumented member.
createAssessment_scope :: Lens.Lens' CreateAssessment Scope
createAssessment_scope :: (Scope -> f Scope) -> CreateAssessment -> f CreateAssessment
createAssessment_scope = (CreateAssessment -> Scope)
-> (CreateAssessment -> Scope -> CreateAssessment)
-> Lens CreateAssessment CreateAssessment Scope Scope
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {Scope
scope :: Scope
$sel:scope:CreateAssessment' :: CreateAssessment -> Scope
scope} -> Scope
scope) (\s :: CreateAssessment
s@CreateAssessment' {} Scope
a -> CreateAssessment
s {$sel:scope:CreateAssessment' :: Scope
scope = Scope
a} :: CreateAssessment)

-- | The list of roles for the specified assessment.
createAssessment_roles :: Lens.Lens' CreateAssessment [Role]
createAssessment_roles :: ([Role] -> f [Role]) -> CreateAssessment -> f CreateAssessment
createAssessment_roles = (CreateAssessment -> [Role])
-> (CreateAssessment -> [Role] -> CreateAssessment)
-> Lens CreateAssessment CreateAssessment [Role] [Role]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {[Role]
roles :: [Role]
$sel:roles:CreateAssessment' :: CreateAssessment -> [Role]
roles} -> [Role]
roles) (\s :: CreateAssessment
s@CreateAssessment' {} [Role]
a -> CreateAssessment
s {$sel:roles:CreateAssessment' :: [Role]
roles = [Role]
a} :: CreateAssessment) (([Role] -> f [Role]) -> CreateAssessment -> f CreateAssessment)
-> (([Role] -> f [Role]) -> [Role] -> f [Role])
-> ([Role] -> f [Role])
-> CreateAssessment
-> f CreateAssessment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Role] -> f [Role]) -> [Role] -> f [Role]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier for the specified framework.
createAssessment_frameworkId :: Lens.Lens' CreateAssessment Prelude.Text
createAssessment_frameworkId :: (Text -> f Text) -> CreateAssessment -> f CreateAssessment
createAssessment_frameworkId = (CreateAssessment -> Text)
-> (CreateAssessment -> Text -> CreateAssessment)
-> Lens CreateAssessment CreateAssessment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessment' {Text
frameworkId :: Text
$sel:frameworkId:CreateAssessment' :: CreateAssessment -> Text
frameworkId} -> Text
frameworkId) (\s :: CreateAssessment
s@CreateAssessment' {} Text
a -> CreateAssessment
s {$sel:frameworkId:CreateAssessment' :: Text
frameworkId = Text
a} :: CreateAssessment)

instance Core.AWSRequest CreateAssessment where
  type
    AWSResponse CreateAssessment =
      CreateAssessmentResponse
  request :: CreateAssessment -> Request CreateAssessment
request = Service -> CreateAssessment -> Request CreateAssessment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateAssessment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAssessment)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateAssessment))
-> Logger
-> Service
-> Proxy CreateAssessment
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAssessment)))
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 Assessment -> Int -> CreateAssessmentResponse
CreateAssessmentResponse'
            (Maybe Assessment -> Int -> CreateAssessmentResponse)
-> Either String (Maybe Assessment)
-> Either String (Int -> CreateAssessmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Assessment)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assessment")
            Either String (Int -> CreateAssessmentResponse)
-> Either String Int -> Either String CreateAssessmentResponse
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 CreateAssessment

instance Prelude.NFData CreateAssessment

instance Core.ToHeaders CreateAssessment where
  toHeaders :: CreateAssessment -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAssessment -> 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 CreateAssessment where
  toJSON :: CreateAssessment -> Value
toJSON CreateAssessment' {[Role]
Maybe Text
Maybe (HashMap Text Text)
Text
AssessmentReportsDestination
Scope
frameworkId :: Text
roles :: [Role]
scope :: Scope
assessmentReportsDestination :: AssessmentReportsDestination
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:frameworkId:CreateAssessment' :: CreateAssessment -> Text
$sel:roles:CreateAssessment' :: CreateAssessment -> [Role]
$sel:scope:CreateAssessment' :: CreateAssessment -> Scope
$sel:assessmentReportsDestination:CreateAssessment' :: CreateAssessment -> AssessmentReportsDestination
$sel:name:CreateAssessment' :: CreateAssessment -> Text
$sel:tags:CreateAssessment' :: CreateAssessment -> Maybe (HashMap Text Text)
$sel:description:CreateAssessment' :: CreateAssessment -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"description" 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
description,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            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
"assessmentReportsDestination"
                  Text -> AssessmentReportsDestination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AssessmentReportsDestination
assessmentReportsDestination
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"scope" Text -> Scope -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Scope
scope),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roles" Text -> [Role] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Role]
roles),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"frameworkId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
frameworkId)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateAssessmentResponse' 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:
--
-- 'assessment', 'createAssessmentResponse_assessment' - Undocumented member.
--
-- 'httpStatus', 'createAssessmentResponse_httpStatus' - The response's http status code.
newCreateAssessmentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAssessmentResponse
newCreateAssessmentResponse :: Int -> CreateAssessmentResponse
newCreateAssessmentResponse Int
pHttpStatus_ =
  CreateAssessmentResponse' :: Maybe Assessment -> Int -> CreateAssessmentResponse
CreateAssessmentResponse'
    { $sel:assessment:CreateAssessmentResponse' :: Maybe Assessment
assessment =
        Maybe Assessment
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAssessmentResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createAssessmentResponse_assessment :: Lens.Lens' CreateAssessmentResponse (Prelude.Maybe Assessment)
createAssessmentResponse_assessment :: (Maybe Assessment -> f (Maybe Assessment))
-> CreateAssessmentResponse -> f CreateAssessmentResponse
createAssessmentResponse_assessment = (CreateAssessmentResponse -> Maybe Assessment)
-> (CreateAssessmentResponse
    -> Maybe Assessment -> CreateAssessmentResponse)
-> Lens
     CreateAssessmentResponse
     CreateAssessmentResponse
     (Maybe Assessment)
     (Maybe Assessment)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentResponse' {Maybe Assessment
assessment :: Maybe Assessment
$sel:assessment:CreateAssessmentResponse' :: CreateAssessmentResponse -> Maybe Assessment
assessment} -> Maybe Assessment
assessment) (\s :: CreateAssessmentResponse
s@CreateAssessmentResponse' {} Maybe Assessment
a -> CreateAssessmentResponse
s {$sel:assessment:CreateAssessmentResponse' :: Maybe Assessment
assessment = Maybe Assessment
a} :: CreateAssessmentResponse)

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

instance Prelude.NFData CreateAssessmentResponse