{-# 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.Inspector.CreateAssessmentTemplate
-- 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 template for the assessment target that is
-- specified by the ARN of the assessment target. If the
-- <https://docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html service-linked role>
-- isn’t already registered, this action also creates and registers a
-- service-linked role to grant Amazon Inspector access to AWS Services
-- needed to perform security assessments.
module Amazonka.Inspector.CreateAssessmentTemplate
  ( -- * Creating a Request
    CreateAssessmentTemplate (..),
    newCreateAssessmentTemplate,

    -- * Request Lenses
    createAssessmentTemplate_userAttributesForFindings,
    createAssessmentTemplate_assessmentTargetArn,
    createAssessmentTemplate_assessmentTemplateName,
    createAssessmentTemplate_durationInSeconds,
    createAssessmentTemplate_rulesPackageArns,

    -- * Destructuring the Response
    CreateAssessmentTemplateResponse (..),
    newCreateAssessmentTemplateResponse,

    -- * Response Lenses
    createAssessmentTemplateResponse_httpStatus,
    createAssessmentTemplateResponse_assessmentTemplateArn,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types
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:/ 'newCreateAssessmentTemplate' smart constructor.
data CreateAssessmentTemplate = CreateAssessmentTemplate'
  { -- | The user-defined attributes that are assigned to every finding that is
    -- generated by the assessment run that uses this assessment template. An
    -- attribute is a key and value pair (an Attribute object). Within an
    -- assessment template, each key must be unique.
    CreateAssessmentTemplate -> Maybe [Attribute]
userAttributesForFindings :: Prelude.Maybe [Attribute],
    -- | The ARN that specifies the assessment target for which you want to
    -- create the assessment template.
    CreateAssessmentTemplate -> Text
assessmentTargetArn :: Prelude.Text,
    -- | The user-defined name that identifies the assessment template that you
    -- want to create. You can create several assessment templates for an
    -- assessment target. The names of the assessment templates that correspond
    -- to a particular assessment target must be unique.
    CreateAssessmentTemplate -> Text
assessmentTemplateName :: Prelude.Text,
    -- | The duration of the assessment run in seconds.
    CreateAssessmentTemplate -> Natural
durationInSeconds :: Prelude.Natural,
    -- | The ARNs that specify the rules packages that you want to attach to the
    -- assessment template.
    CreateAssessmentTemplate -> [Text]
rulesPackageArns :: [Prelude.Text]
  }
  deriving (CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool
(CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool)
-> (CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool)
-> Eq CreateAssessmentTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool
$c/= :: CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool
== :: CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool
$c== :: CreateAssessmentTemplate -> CreateAssessmentTemplate -> Bool
Prelude.Eq, ReadPrec [CreateAssessmentTemplate]
ReadPrec CreateAssessmentTemplate
Int -> ReadS CreateAssessmentTemplate
ReadS [CreateAssessmentTemplate]
(Int -> ReadS CreateAssessmentTemplate)
-> ReadS [CreateAssessmentTemplate]
-> ReadPrec CreateAssessmentTemplate
-> ReadPrec [CreateAssessmentTemplate]
-> Read CreateAssessmentTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAssessmentTemplate]
$creadListPrec :: ReadPrec [CreateAssessmentTemplate]
readPrec :: ReadPrec CreateAssessmentTemplate
$creadPrec :: ReadPrec CreateAssessmentTemplate
readList :: ReadS [CreateAssessmentTemplate]
$creadList :: ReadS [CreateAssessmentTemplate]
readsPrec :: Int -> ReadS CreateAssessmentTemplate
$creadsPrec :: Int -> ReadS CreateAssessmentTemplate
Prelude.Read, Int -> CreateAssessmentTemplate -> ShowS
[CreateAssessmentTemplate] -> ShowS
CreateAssessmentTemplate -> String
(Int -> CreateAssessmentTemplate -> ShowS)
-> (CreateAssessmentTemplate -> String)
-> ([CreateAssessmentTemplate] -> ShowS)
-> Show CreateAssessmentTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAssessmentTemplate] -> ShowS
$cshowList :: [CreateAssessmentTemplate] -> ShowS
show :: CreateAssessmentTemplate -> String
$cshow :: CreateAssessmentTemplate -> String
showsPrec :: Int -> CreateAssessmentTemplate -> ShowS
$cshowsPrec :: Int -> CreateAssessmentTemplate -> ShowS
Prelude.Show, (forall x.
 CreateAssessmentTemplate -> Rep CreateAssessmentTemplate x)
-> (forall x.
    Rep CreateAssessmentTemplate x -> CreateAssessmentTemplate)
-> Generic CreateAssessmentTemplate
forall x.
Rep CreateAssessmentTemplate x -> CreateAssessmentTemplate
forall x.
CreateAssessmentTemplate -> Rep CreateAssessmentTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAssessmentTemplate x -> CreateAssessmentTemplate
$cfrom :: forall x.
CreateAssessmentTemplate -> Rep CreateAssessmentTemplate x
Prelude.Generic)

-- |
-- Create a value of 'CreateAssessmentTemplate' 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:
--
-- 'userAttributesForFindings', 'createAssessmentTemplate_userAttributesForFindings' - The user-defined attributes that are assigned to every finding that is
-- generated by the assessment run that uses this assessment template. An
-- attribute is a key and value pair (an Attribute object). Within an
-- assessment template, each key must be unique.
--
-- 'assessmentTargetArn', 'createAssessmentTemplate_assessmentTargetArn' - The ARN that specifies the assessment target for which you want to
-- create the assessment template.
--
-- 'assessmentTemplateName', 'createAssessmentTemplate_assessmentTemplateName' - The user-defined name that identifies the assessment template that you
-- want to create. You can create several assessment templates for an
-- assessment target. The names of the assessment templates that correspond
-- to a particular assessment target must be unique.
--
-- 'durationInSeconds', 'createAssessmentTemplate_durationInSeconds' - The duration of the assessment run in seconds.
--
-- 'rulesPackageArns', 'createAssessmentTemplate_rulesPackageArns' - The ARNs that specify the rules packages that you want to attach to the
-- assessment template.
newCreateAssessmentTemplate ::
  -- | 'assessmentTargetArn'
  Prelude.Text ->
  -- | 'assessmentTemplateName'
  Prelude.Text ->
  -- | 'durationInSeconds'
  Prelude.Natural ->
  CreateAssessmentTemplate
newCreateAssessmentTemplate :: Text -> Text -> Natural -> CreateAssessmentTemplate
newCreateAssessmentTemplate
  Text
pAssessmentTargetArn_
  Text
pAssessmentTemplateName_
  Natural
pDurationInSeconds_ =
    CreateAssessmentTemplate' :: Maybe [Attribute]
-> Text -> Text -> Natural -> [Text] -> CreateAssessmentTemplate
CreateAssessmentTemplate'
      { $sel:userAttributesForFindings:CreateAssessmentTemplate' :: Maybe [Attribute]
userAttributesForFindings =
          Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
        $sel:assessmentTargetArn:CreateAssessmentTemplate' :: Text
assessmentTargetArn = Text
pAssessmentTargetArn_,
        $sel:assessmentTemplateName:CreateAssessmentTemplate' :: Text
assessmentTemplateName = Text
pAssessmentTemplateName_,
        $sel:durationInSeconds:CreateAssessmentTemplate' :: Natural
durationInSeconds = Natural
pDurationInSeconds_,
        $sel:rulesPackageArns:CreateAssessmentTemplate' :: [Text]
rulesPackageArns = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The user-defined attributes that are assigned to every finding that is
-- generated by the assessment run that uses this assessment template. An
-- attribute is a key and value pair (an Attribute object). Within an
-- assessment template, each key must be unique.
createAssessmentTemplate_userAttributesForFindings :: Lens.Lens' CreateAssessmentTemplate (Prelude.Maybe [Attribute])
createAssessmentTemplate_userAttributesForFindings :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> CreateAssessmentTemplate -> f CreateAssessmentTemplate
createAssessmentTemplate_userAttributesForFindings = (CreateAssessmentTemplate -> Maybe [Attribute])
-> (CreateAssessmentTemplate
    -> Maybe [Attribute] -> CreateAssessmentTemplate)
-> Lens
     CreateAssessmentTemplate
     CreateAssessmentTemplate
     (Maybe [Attribute])
     (Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentTemplate' {Maybe [Attribute]
userAttributesForFindings :: Maybe [Attribute]
$sel:userAttributesForFindings:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Maybe [Attribute]
userAttributesForFindings} -> Maybe [Attribute]
userAttributesForFindings) (\s :: CreateAssessmentTemplate
s@CreateAssessmentTemplate' {} Maybe [Attribute]
a -> CreateAssessmentTemplate
s {$sel:userAttributesForFindings:CreateAssessmentTemplate' :: Maybe [Attribute]
userAttributesForFindings = Maybe [Attribute]
a} :: CreateAssessmentTemplate) ((Maybe [Attribute] -> f (Maybe [Attribute]))
 -> CreateAssessmentTemplate -> f CreateAssessmentTemplate)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
    -> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> CreateAssessmentTemplate
-> f CreateAssessmentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
     (Maybe [Attribute])
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 [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN that specifies the assessment target for which you want to
-- create the assessment template.
createAssessmentTemplate_assessmentTargetArn :: Lens.Lens' CreateAssessmentTemplate Prelude.Text
createAssessmentTemplate_assessmentTargetArn :: (Text -> f Text)
-> CreateAssessmentTemplate -> f CreateAssessmentTemplate
createAssessmentTemplate_assessmentTargetArn = (CreateAssessmentTemplate -> Text)
-> (CreateAssessmentTemplate -> Text -> CreateAssessmentTemplate)
-> Lens CreateAssessmentTemplate CreateAssessmentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentTemplate' {Text
assessmentTargetArn :: Text
$sel:assessmentTargetArn:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Text
assessmentTargetArn} -> Text
assessmentTargetArn) (\s :: CreateAssessmentTemplate
s@CreateAssessmentTemplate' {} Text
a -> CreateAssessmentTemplate
s {$sel:assessmentTargetArn:CreateAssessmentTemplate' :: Text
assessmentTargetArn = Text
a} :: CreateAssessmentTemplate)

-- | The user-defined name that identifies the assessment template that you
-- want to create. You can create several assessment templates for an
-- assessment target. The names of the assessment templates that correspond
-- to a particular assessment target must be unique.
createAssessmentTemplate_assessmentTemplateName :: Lens.Lens' CreateAssessmentTemplate Prelude.Text
createAssessmentTemplate_assessmentTemplateName :: (Text -> f Text)
-> CreateAssessmentTemplate -> f CreateAssessmentTemplate
createAssessmentTemplate_assessmentTemplateName = (CreateAssessmentTemplate -> Text)
-> (CreateAssessmentTemplate -> Text -> CreateAssessmentTemplate)
-> Lens CreateAssessmentTemplate CreateAssessmentTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentTemplate' {Text
assessmentTemplateName :: Text
$sel:assessmentTemplateName:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Text
assessmentTemplateName} -> Text
assessmentTemplateName) (\s :: CreateAssessmentTemplate
s@CreateAssessmentTemplate' {} Text
a -> CreateAssessmentTemplate
s {$sel:assessmentTemplateName:CreateAssessmentTemplate' :: Text
assessmentTemplateName = Text
a} :: CreateAssessmentTemplate)

-- | The duration of the assessment run in seconds.
createAssessmentTemplate_durationInSeconds :: Lens.Lens' CreateAssessmentTemplate Prelude.Natural
createAssessmentTemplate_durationInSeconds :: (Natural -> f Natural)
-> CreateAssessmentTemplate -> f CreateAssessmentTemplate
createAssessmentTemplate_durationInSeconds = (CreateAssessmentTemplate -> Natural)
-> (CreateAssessmentTemplate
    -> Natural -> CreateAssessmentTemplate)
-> Lens
     CreateAssessmentTemplate CreateAssessmentTemplate Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentTemplate' {Natural
durationInSeconds :: Natural
$sel:durationInSeconds:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Natural
durationInSeconds} -> Natural
durationInSeconds) (\s :: CreateAssessmentTemplate
s@CreateAssessmentTemplate' {} Natural
a -> CreateAssessmentTemplate
s {$sel:durationInSeconds:CreateAssessmentTemplate' :: Natural
durationInSeconds = Natural
a} :: CreateAssessmentTemplate)

-- | The ARNs that specify the rules packages that you want to attach to the
-- assessment template.
createAssessmentTemplate_rulesPackageArns :: Lens.Lens' CreateAssessmentTemplate [Prelude.Text]
createAssessmentTemplate_rulesPackageArns :: ([Text] -> f [Text])
-> CreateAssessmentTemplate -> f CreateAssessmentTemplate
createAssessmentTemplate_rulesPackageArns = (CreateAssessmentTemplate -> [Text])
-> (CreateAssessmentTemplate -> [Text] -> CreateAssessmentTemplate)
-> Lens
     CreateAssessmentTemplate CreateAssessmentTemplate [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentTemplate' {[Text]
rulesPackageArns :: [Text]
$sel:rulesPackageArns:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> [Text]
rulesPackageArns} -> [Text]
rulesPackageArns) (\s :: CreateAssessmentTemplate
s@CreateAssessmentTemplate' {} [Text]
a -> CreateAssessmentTemplate
s {$sel:rulesPackageArns:CreateAssessmentTemplate' :: [Text]
rulesPackageArns = [Text]
a} :: CreateAssessmentTemplate) (([Text] -> f [Text])
 -> CreateAssessmentTemplate -> f CreateAssessmentTemplate)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> CreateAssessmentTemplate
-> f CreateAssessmentTemplate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable CreateAssessmentTemplate

instance Prelude.NFData CreateAssessmentTemplate

instance Core.ToHeaders CreateAssessmentTemplate where
  toHeaders :: CreateAssessmentTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAssessmentTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"InspectorService.CreateAssessmentTemplate" ::
                          Prelude.ByteString
                      ),
            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 CreateAssessmentTemplate where
  toJSON :: CreateAssessmentTemplate -> Value
toJSON CreateAssessmentTemplate' {Natural
[Text]
Maybe [Attribute]
Text
rulesPackageArns :: [Text]
durationInSeconds :: Natural
assessmentTemplateName :: Text
assessmentTargetArn :: Text
userAttributesForFindings :: Maybe [Attribute]
$sel:rulesPackageArns:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> [Text]
$sel:durationInSeconds:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Natural
$sel:assessmentTemplateName:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Text
$sel:assessmentTargetArn:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Text
$sel:userAttributesForFindings:CreateAssessmentTemplate' :: CreateAssessmentTemplate -> Maybe [Attribute]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"userAttributesForFindings" Text -> [Attribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Attribute] -> Pair) -> Maybe [Attribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Attribute]
userAttributesForFindings,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"assessmentTargetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assessmentTargetArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"assessmentTemplateName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
assessmentTemplateName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"durationInSeconds" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
durationInSeconds),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"rulesPackageArns" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
rulesPackageArns)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateAssessmentTemplateResponse' 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:
--
-- 'httpStatus', 'createAssessmentTemplateResponse_httpStatus' - The response's http status code.
--
-- 'assessmentTemplateArn', 'createAssessmentTemplateResponse_assessmentTemplateArn' - The ARN that specifies the assessment template that is created.
newCreateAssessmentTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'assessmentTemplateArn'
  Prelude.Text ->
  CreateAssessmentTemplateResponse
newCreateAssessmentTemplateResponse :: Int -> Text -> CreateAssessmentTemplateResponse
newCreateAssessmentTemplateResponse
  Int
pHttpStatus_
  Text
pAssessmentTemplateArn_ =
    CreateAssessmentTemplateResponse' :: Int -> Text -> CreateAssessmentTemplateResponse
CreateAssessmentTemplateResponse'
      { $sel:httpStatus:CreateAssessmentTemplateResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:assessmentTemplateArn:CreateAssessmentTemplateResponse' :: Text
assessmentTemplateArn =
          Text
pAssessmentTemplateArn_
      }

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

-- | The ARN that specifies the assessment template that is created.
createAssessmentTemplateResponse_assessmentTemplateArn :: Lens.Lens' CreateAssessmentTemplateResponse Prelude.Text
createAssessmentTemplateResponse_assessmentTemplateArn :: (Text -> f Text)
-> CreateAssessmentTemplateResponse
-> f CreateAssessmentTemplateResponse
createAssessmentTemplateResponse_assessmentTemplateArn = (CreateAssessmentTemplateResponse -> Text)
-> (CreateAssessmentTemplateResponse
    -> Text -> CreateAssessmentTemplateResponse)
-> Lens
     CreateAssessmentTemplateResponse
     CreateAssessmentTemplateResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAssessmentTemplateResponse' {Text
assessmentTemplateArn :: Text
$sel:assessmentTemplateArn:CreateAssessmentTemplateResponse' :: CreateAssessmentTemplateResponse -> Text
assessmentTemplateArn} -> Text
assessmentTemplateArn) (\s :: CreateAssessmentTemplateResponse
s@CreateAssessmentTemplateResponse' {} Text
a -> CreateAssessmentTemplateResponse
s {$sel:assessmentTemplateArn:CreateAssessmentTemplateResponse' :: Text
assessmentTemplateArn = Text
a} :: CreateAssessmentTemplateResponse)

instance
  Prelude.NFData
    CreateAssessmentTemplateResponse