{-# 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.Config.PutConformancePack
-- 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 or updates a conformance pack. A conformance pack is a
-- collection of Config rules that can be easily deployed in an account and
-- a region and across Amazon Web Services Organization.
--
-- This API creates a service linked role @AWSServiceRoleForConfigConforms@
-- in your account. The service linked role is created only when the role
-- does not exist in your account.
--
-- You must specify either the @TemplateS3Uri@ or the @TemplateBody@
-- parameter, but not both. If you provide both Config uses the
-- @TemplateS3Uri@ parameter and ignores the @TemplateBody@ parameter.
module Amazonka.Config.PutConformancePack
  ( -- * Creating a Request
    PutConformancePack (..),
    newPutConformancePack,

    -- * Request Lenses
    putConformancePack_deliveryS3Bucket,
    putConformancePack_deliveryS3KeyPrefix,
    putConformancePack_templateS3Uri,
    putConformancePack_conformancePackInputParameters,
    putConformancePack_templateBody,
    putConformancePack_conformancePackName,

    -- * Destructuring the Response
    PutConformancePackResponse (..),
    newPutConformancePackResponse,

    -- * Response Lenses
    putConformancePackResponse_conformancePackArn,
    putConformancePackResponse_httpStatus,
  )
where

import Amazonka.Config.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:/ 'newPutConformancePack' smart constructor.
data PutConformancePack = PutConformancePack'
  { -- | The name of the Amazon S3 bucket where Config stores conformance pack
    -- templates.
    --
    -- This field is optional.
    PutConformancePack -> Maybe Text
deliveryS3Bucket :: Prelude.Maybe Prelude.Text,
    -- | The prefix for the Amazon S3 bucket.
    --
    -- This field is optional.
    PutConformancePack -> Maybe Text
deliveryS3KeyPrefix :: Prelude.Maybe Prelude.Text,
    -- | Location of file containing the template body
    -- (@s3:\/\/bucketname\/prefix@). The uri must point to the conformance
    -- pack template (max size: 300 KB) that is located in an Amazon S3 bucket
    -- in the same region as the conformance pack.
    --
    -- You must have access to read Amazon S3 bucket.
    PutConformancePack -> Maybe Text
templateS3Uri :: Prelude.Maybe Prelude.Text,
    -- | A list of @ConformancePackInputParameter@ objects.
    PutConformancePack -> Maybe [ConformancePackInputParameter]
conformancePackInputParameters :: Prelude.Maybe [ConformancePackInputParameter],
    -- | A string containing full conformance pack template body. Structure
    -- containing the template body with a minimum length of 1 byte and a
    -- maximum length of 51,200 bytes.
    --
    -- You can only use a YAML template with one resource type, that is, config
    -- rule and a remediation action.
    PutConformancePack -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | Name of the conformance pack you want to create.
    PutConformancePack -> Text
conformancePackName :: Prelude.Text
  }
  deriving (PutConformancePack -> PutConformancePack -> Bool
(PutConformancePack -> PutConformancePack -> Bool)
-> (PutConformancePack -> PutConformancePack -> Bool)
-> Eq PutConformancePack
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutConformancePack -> PutConformancePack -> Bool
$c/= :: PutConformancePack -> PutConformancePack -> Bool
== :: PutConformancePack -> PutConformancePack -> Bool
$c== :: PutConformancePack -> PutConformancePack -> Bool
Prelude.Eq, ReadPrec [PutConformancePack]
ReadPrec PutConformancePack
Int -> ReadS PutConformancePack
ReadS [PutConformancePack]
(Int -> ReadS PutConformancePack)
-> ReadS [PutConformancePack]
-> ReadPrec PutConformancePack
-> ReadPrec [PutConformancePack]
-> Read PutConformancePack
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutConformancePack]
$creadListPrec :: ReadPrec [PutConformancePack]
readPrec :: ReadPrec PutConformancePack
$creadPrec :: ReadPrec PutConformancePack
readList :: ReadS [PutConformancePack]
$creadList :: ReadS [PutConformancePack]
readsPrec :: Int -> ReadS PutConformancePack
$creadsPrec :: Int -> ReadS PutConformancePack
Prelude.Read, Int -> PutConformancePack -> ShowS
[PutConformancePack] -> ShowS
PutConformancePack -> String
(Int -> PutConformancePack -> ShowS)
-> (PutConformancePack -> String)
-> ([PutConformancePack] -> ShowS)
-> Show PutConformancePack
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutConformancePack] -> ShowS
$cshowList :: [PutConformancePack] -> ShowS
show :: PutConformancePack -> String
$cshow :: PutConformancePack -> String
showsPrec :: Int -> PutConformancePack -> ShowS
$cshowsPrec :: Int -> PutConformancePack -> ShowS
Prelude.Show, (forall x. PutConformancePack -> Rep PutConformancePack x)
-> (forall x. Rep PutConformancePack x -> PutConformancePack)
-> Generic PutConformancePack
forall x. Rep PutConformancePack x -> PutConformancePack
forall x. PutConformancePack -> Rep PutConformancePack x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutConformancePack x -> PutConformancePack
$cfrom :: forall x. PutConformancePack -> Rep PutConformancePack x
Prelude.Generic)

-- |
-- Create a value of 'PutConformancePack' 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:
--
-- 'deliveryS3Bucket', 'putConformancePack_deliveryS3Bucket' - The name of the Amazon S3 bucket where Config stores conformance pack
-- templates.
--
-- This field is optional.
--
-- 'deliveryS3KeyPrefix', 'putConformancePack_deliveryS3KeyPrefix' - The prefix for the Amazon S3 bucket.
--
-- This field is optional.
--
-- 'templateS3Uri', 'putConformancePack_templateS3Uri' - Location of file containing the template body
-- (@s3:\/\/bucketname\/prefix@). The uri must point to the conformance
-- pack template (max size: 300 KB) that is located in an Amazon S3 bucket
-- in the same region as the conformance pack.
--
-- You must have access to read Amazon S3 bucket.
--
-- 'conformancePackInputParameters', 'putConformancePack_conformancePackInputParameters' - A list of @ConformancePackInputParameter@ objects.
--
-- 'templateBody', 'putConformancePack_templateBody' - A string containing full conformance pack template body. Structure
-- containing the template body with a minimum length of 1 byte and a
-- maximum length of 51,200 bytes.
--
-- You can only use a YAML template with one resource type, that is, config
-- rule and a remediation action.
--
-- 'conformancePackName', 'putConformancePack_conformancePackName' - Name of the conformance pack you want to create.
newPutConformancePack ::
  -- | 'conformancePackName'
  Prelude.Text ->
  PutConformancePack
newPutConformancePack :: Text -> PutConformancePack
newPutConformancePack Text
pConformancePackName_ =
  PutConformancePack' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ConformancePackInputParameter]
-> Maybe Text
-> Text
-> PutConformancePack
PutConformancePack'
    { $sel:deliveryS3Bucket:PutConformancePack' :: Maybe Text
deliveryS3Bucket =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryS3KeyPrefix:PutConformancePack' :: Maybe Text
deliveryS3KeyPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateS3Uri:PutConformancePack' :: Maybe Text
templateS3Uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:conformancePackInputParameters:PutConformancePack' :: Maybe [ConformancePackInputParameter]
conformancePackInputParameters = Maybe [ConformancePackInputParameter]
forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:PutConformancePack' :: Maybe Text
templateBody = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:conformancePackName:PutConformancePack' :: Text
conformancePackName = Text
pConformancePackName_
    }

-- | The name of the Amazon S3 bucket where Config stores conformance pack
-- templates.
--
-- This field is optional.
putConformancePack_deliveryS3Bucket :: Lens.Lens' PutConformancePack (Prelude.Maybe Prelude.Text)
putConformancePack_deliveryS3Bucket :: (Maybe Text -> f (Maybe Text))
-> PutConformancePack -> f PutConformancePack
putConformancePack_deliveryS3Bucket = (PutConformancePack -> Maybe Text)
-> (PutConformancePack -> Maybe Text -> PutConformancePack)
-> Lens
     PutConformancePack PutConformancePack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Maybe Text
deliveryS3Bucket :: Maybe Text
$sel:deliveryS3Bucket:PutConformancePack' :: PutConformancePack -> Maybe Text
deliveryS3Bucket} -> Maybe Text
deliveryS3Bucket) (\s :: PutConformancePack
s@PutConformancePack' {} Maybe Text
a -> PutConformancePack
s {$sel:deliveryS3Bucket:PutConformancePack' :: Maybe Text
deliveryS3Bucket = Maybe Text
a} :: PutConformancePack)

-- | The prefix for the Amazon S3 bucket.
--
-- This field is optional.
putConformancePack_deliveryS3KeyPrefix :: Lens.Lens' PutConformancePack (Prelude.Maybe Prelude.Text)
putConformancePack_deliveryS3KeyPrefix :: (Maybe Text -> f (Maybe Text))
-> PutConformancePack -> f PutConformancePack
putConformancePack_deliveryS3KeyPrefix = (PutConformancePack -> Maybe Text)
-> (PutConformancePack -> Maybe Text -> PutConformancePack)
-> Lens
     PutConformancePack PutConformancePack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Maybe Text
deliveryS3KeyPrefix :: Maybe Text
$sel:deliveryS3KeyPrefix:PutConformancePack' :: PutConformancePack -> Maybe Text
deliveryS3KeyPrefix} -> Maybe Text
deliveryS3KeyPrefix) (\s :: PutConformancePack
s@PutConformancePack' {} Maybe Text
a -> PutConformancePack
s {$sel:deliveryS3KeyPrefix:PutConformancePack' :: Maybe Text
deliveryS3KeyPrefix = Maybe Text
a} :: PutConformancePack)

-- | Location of file containing the template body
-- (@s3:\/\/bucketname\/prefix@). The uri must point to the conformance
-- pack template (max size: 300 KB) that is located in an Amazon S3 bucket
-- in the same region as the conformance pack.
--
-- You must have access to read Amazon S3 bucket.
putConformancePack_templateS3Uri :: Lens.Lens' PutConformancePack (Prelude.Maybe Prelude.Text)
putConformancePack_templateS3Uri :: (Maybe Text -> f (Maybe Text))
-> PutConformancePack -> f PutConformancePack
putConformancePack_templateS3Uri = (PutConformancePack -> Maybe Text)
-> (PutConformancePack -> Maybe Text -> PutConformancePack)
-> Lens
     PutConformancePack PutConformancePack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Maybe Text
templateS3Uri :: Maybe Text
$sel:templateS3Uri:PutConformancePack' :: PutConformancePack -> Maybe Text
templateS3Uri} -> Maybe Text
templateS3Uri) (\s :: PutConformancePack
s@PutConformancePack' {} Maybe Text
a -> PutConformancePack
s {$sel:templateS3Uri:PutConformancePack' :: Maybe Text
templateS3Uri = Maybe Text
a} :: PutConformancePack)

-- | A list of @ConformancePackInputParameter@ objects.
putConformancePack_conformancePackInputParameters :: Lens.Lens' PutConformancePack (Prelude.Maybe [ConformancePackInputParameter])
putConformancePack_conformancePackInputParameters :: (Maybe [ConformancePackInputParameter]
 -> f (Maybe [ConformancePackInputParameter]))
-> PutConformancePack -> f PutConformancePack
putConformancePack_conformancePackInputParameters = (PutConformancePack -> Maybe [ConformancePackInputParameter])
-> (PutConformancePack
    -> Maybe [ConformancePackInputParameter] -> PutConformancePack)
-> Lens
     PutConformancePack
     PutConformancePack
     (Maybe [ConformancePackInputParameter])
     (Maybe [ConformancePackInputParameter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Maybe [ConformancePackInputParameter]
conformancePackInputParameters :: Maybe [ConformancePackInputParameter]
$sel:conformancePackInputParameters:PutConformancePack' :: PutConformancePack -> Maybe [ConformancePackInputParameter]
conformancePackInputParameters} -> Maybe [ConformancePackInputParameter]
conformancePackInputParameters) (\s :: PutConformancePack
s@PutConformancePack' {} Maybe [ConformancePackInputParameter]
a -> PutConformancePack
s {$sel:conformancePackInputParameters:PutConformancePack' :: Maybe [ConformancePackInputParameter]
conformancePackInputParameters = Maybe [ConformancePackInputParameter]
a} :: PutConformancePack) ((Maybe [ConformancePackInputParameter]
  -> f (Maybe [ConformancePackInputParameter]))
 -> PutConformancePack -> f PutConformancePack)
-> ((Maybe [ConformancePackInputParameter]
     -> f (Maybe [ConformancePackInputParameter]))
    -> Maybe [ConformancePackInputParameter]
    -> f (Maybe [ConformancePackInputParameter]))
-> (Maybe [ConformancePackInputParameter]
    -> f (Maybe [ConformancePackInputParameter]))
-> PutConformancePack
-> f PutConformancePack
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ConformancePackInputParameter]
  [ConformancePackInputParameter]
  [ConformancePackInputParameter]
  [ConformancePackInputParameter]
-> Iso
     (Maybe [ConformancePackInputParameter])
     (Maybe [ConformancePackInputParameter])
     (Maybe [ConformancePackInputParameter])
     (Maybe [ConformancePackInputParameter])
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
  [ConformancePackInputParameter]
  [ConformancePackInputParameter]
  [ConformancePackInputParameter]
  [ConformancePackInputParameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A string containing full conformance pack template body. Structure
-- containing the template body with a minimum length of 1 byte and a
-- maximum length of 51,200 bytes.
--
-- You can only use a YAML template with one resource type, that is, config
-- rule and a remediation action.
putConformancePack_templateBody :: Lens.Lens' PutConformancePack (Prelude.Maybe Prelude.Text)
putConformancePack_templateBody :: (Maybe Text -> f (Maybe Text))
-> PutConformancePack -> f PutConformancePack
putConformancePack_templateBody = (PutConformancePack -> Maybe Text)
-> (PutConformancePack -> Maybe Text -> PutConformancePack)
-> Lens
     PutConformancePack PutConformancePack (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Maybe Text
templateBody :: Maybe Text
$sel:templateBody:PutConformancePack' :: PutConformancePack -> Maybe Text
templateBody} -> Maybe Text
templateBody) (\s :: PutConformancePack
s@PutConformancePack' {} Maybe Text
a -> PutConformancePack
s {$sel:templateBody:PutConformancePack' :: Maybe Text
templateBody = Maybe Text
a} :: PutConformancePack)

-- | Name of the conformance pack you want to create.
putConformancePack_conformancePackName :: Lens.Lens' PutConformancePack Prelude.Text
putConformancePack_conformancePackName :: (Text -> f Text) -> PutConformancePack -> f PutConformancePack
putConformancePack_conformancePackName = (PutConformancePack -> Text)
-> (PutConformancePack -> Text -> PutConformancePack)
-> Lens PutConformancePack PutConformancePack Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Text
conformancePackName :: Text
$sel:conformancePackName:PutConformancePack' :: PutConformancePack -> Text
conformancePackName} -> Text
conformancePackName) (\s :: PutConformancePack
s@PutConformancePack' {} Text
a -> PutConformancePack
s {$sel:conformancePackName:PutConformancePack' :: Text
conformancePackName = Text
a} :: PutConformancePack)

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

instance Prelude.NFData PutConformancePack

instance Core.ToHeaders PutConformancePack where
  toHeaders :: PutConformancePack -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutConformancePack -> 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
"StarlingDoveService.PutConformancePack" ::
                          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 PutConformancePack where
  toJSON :: PutConformancePack -> Value
toJSON PutConformancePack' {Maybe [ConformancePackInputParameter]
Maybe Text
Text
conformancePackName :: Text
templateBody :: Maybe Text
conformancePackInputParameters :: Maybe [ConformancePackInputParameter]
templateS3Uri :: Maybe Text
deliveryS3KeyPrefix :: Maybe Text
deliveryS3Bucket :: Maybe Text
$sel:conformancePackName:PutConformancePack' :: PutConformancePack -> Text
$sel:templateBody:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:conformancePackInputParameters:PutConformancePack' :: PutConformancePack -> Maybe [ConformancePackInputParameter]
$sel:templateS3Uri:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3KeyPrefix:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3Bucket:PutConformancePack' :: PutConformancePack -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DeliveryS3Bucket" 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
deliveryS3Bucket,
            (Text
"DeliveryS3KeyPrefix" 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
deliveryS3KeyPrefix,
            (Text
"TemplateS3Uri" 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
templateS3Uri,
            (Text
"ConformancePackInputParameters" Text -> [ConformancePackInputParameter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ConformancePackInputParameter] -> Pair)
-> Maybe [ConformancePackInputParameter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ConformancePackInputParameter]
conformancePackInputParameters,
            (Text
"TemplateBody" 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
templateBody,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ConformancePackName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
conformancePackName)
          ]
      )

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

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

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

-- |
-- Create a value of 'PutConformancePackResponse' 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:
--
-- 'conformancePackArn', 'putConformancePackResponse_conformancePackArn' - ARN of the conformance pack.
--
-- 'httpStatus', 'putConformancePackResponse_httpStatus' - The response's http status code.
newPutConformancePackResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutConformancePackResponse
newPutConformancePackResponse :: Int -> PutConformancePackResponse
newPutConformancePackResponse Int
pHttpStatus_ =
  PutConformancePackResponse' :: Maybe Text -> Int -> PutConformancePackResponse
PutConformancePackResponse'
    { $sel:conformancePackArn:PutConformancePackResponse' :: Maybe Text
conformancePackArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutConformancePackResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | ARN of the conformance pack.
putConformancePackResponse_conformancePackArn :: Lens.Lens' PutConformancePackResponse (Prelude.Maybe Prelude.Text)
putConformancePackResponse_conformancePackArn :: (Maybe Text -> f (Maybe Text))
-> PutConformancePackResponse -> f PutConformancePackResponse
putConformancePackResponse_conformancePackArn = (PutConformancePackResponse -> Maybe Text)
-> (PutConformancePackResponse
    -> Maybe Text -> PutConformancePackResponse)
-> Lens
     PutConformancePackResponse
     PutConformancePackResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePackResponse' {Maybe Text
conformancePackArn :: Maybe Text
$sel:conformancePackArn:PutConformancePackResponse' :: PutConformancePackResponse -> Maybe Text
conformancePackArn} -> Maybe Text
conformancePackArn) (\s :: PutConformancePackResponse
s@PutConformancePackResponse' {} Maybe Text
a -> PutConformancePackResponse
s {$sel:conformancePackArn:PutConformancePackResponse' :: Maybe Text
conformancePackArn = Maybe Text
a} :: PutConformancePackResponse)

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

instance Prelude.NFData PutConformancePackResponse