{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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 an organization. For information on how many
-- conformance packs you can have per account, see
-- <https://docs.aws.amazon.com/config/latest/developerguide/configlimits.html Service Limits>
-- in the Config Developer Guide.
--
-- 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 only one of the follow parameters: @TemplateS3Uri@,
-- @TemplateBody@ or @TemplateSSMDocumentDetails@.
module Amazonka.Config.PutConformancePack
  ( -- * Creating a Request
    PutConformancePack (..),
    newPutConformancePack,

    -- * Request Lenses
    putConformancePack_conformancePackInputParameters,
    putConformancePack_deliveryS3Bucket,
    putConformancePack_deliveryS3KeyPrefix,
    putConformancePack_templateBody,
    putConformancePack_templateS3Uri,
    putConformancePack_templateSSMDocumentDetails,
    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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | A list of @ConformancePackInputParameter@ objects.
    PutConformancePack -> Maybe [ConformancePackInputParameter]
conformancePackInputParameters :: Prelude.Maybe [ConformancePackInputParameter],
    -- | 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,
    -- | A string containing the full conformance pack template body. The
    -- structure containing the template body has a minimum length of 1 byte
    -- and a maximum length of 51,200 bytes.
    --
    -- You can use a YAML template with two resource types: Config rule
    -- (@AWS::Config::ConfigRule@) and remediation action
    -- (@AWS::Config::RemediationConfiguration@).
    PutConformancePack -> Maybe Text
templateBody :: Prelude.Maybe Prelude.Text,
    -- | The location of the file containing the template body
    -- (@s3:\/\/bucketname\/prefix@). The uri must point to a 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,
    -- | An object of type @TemplateSSMDocumentDetails@, which contains the name
    -- or the Amazon Resource Name (ARN) of the Amazon Web Services Systems
    -- Manager document (SSM document) and the version of the SSM document that
    -- is used to create a conformance pack.
    PutConformancePack -> Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails :: Prelude.Maybe TemplateSSMDocumentDetails,
    -- | The unique name of the conformance pack you want to deploy.
    PutConformancePack -> Text
conformancePackName :: Prelude.Text
  }
  deriving (PutConformancePack -> PutConformancePack -> Bool
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]
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
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. 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:
--
-- 'conformancePackInputParameters', 'putConformancePack_conformancePackInputParameters' - A list of @ConformancePackInputParameter@ objects.
--
-- '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.
--
-- 'templateBody', 'putConformancePack_templateBody' - A string containing the full conformance pack template body. The
-- structure containing the template body has a minimum length of 1 byte
-- and a maximum length of 51,200 bytes.
--
-- You can use a YAML template with two resource types: Config rule
-- (@AWS::Config::ConfigRule@) and remediation action
-- (@AWS::Config::RemediationConfiguration@).
--
-- 'templateS3Uri', 'putConformancePack_templateS3Uri' - The location of the file containing the template body
-- (@s3:\/\/bucketname\/prefix@). The uri must point to a 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.
--
-- 'templateSSMDocumentDetails', 'putConformancePack_templateSSMDocumentDetails' - An object of type @TemplateSSMDocumentDetails@, which contains the name
-- or the Amazon Resource Name (ARN) of the Amazon Web Services Systems
-- Manager document (SSM document) and the version of the SSM document that
-- is used to create a conformance pack.
--
-- 'conformancePackName', 'putConformancePack_conformancePackName' - The unique name of the conformance pack you want to deploy.
newPutConformancePack ::
  -- | 'conformancePackName'
  Prelude.Text ->
  PutConformancePack
newPutConformancePack :: Text -> PutConformancePack
newPutConformancePack Text
pConformancePackName_ =
  PutConformancePack'
    { $sel:conformancePackInputParameters:PutConformancePack' :: Maybe [ConformancePackInputParameter]
conformancePackInputParameters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryS3Bucket:PutConformancePack' :: Maybe Text
deliveryS3Bucket = forall a. Maybe a
Prelude.Nothing,
      $sel:deliveryS3KeyPrefix:PutConformancePack' :: Maybe Text
deliveryS3KeyPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:templateBody:PutConformancePack' :: Maybe Text
templateBody = forall a. Maybe a
Prelude.Nothing,
      $sel:templateS3Uri:PutConformancePack' :: Maybe Text
templateS3Uri = forall a. Maybe a
Prelude.Nothing,
      $sel:templateSSMDocumentDetails:PutConformancePack' :: Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:conformancePackName:PutConformancePack' :: Text
conformancePackName = Text
pConformancePackName_
    }

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

-- | 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 :: Lens' PutConformancePack (Maybe Text)
putConformancePack_deliveryS3Bucket = 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 :: Lens' PutConformancePack (Maybe Text)
putConformancePack_deliveryS3KeyPrefix = 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)

-- | A string containing the full conformance pack template body. The
-- structure containing the template body has a minimum length of 1 byte
-- and a maximum length of 51,200 bytes.
--
-- You can use a YAML template with two resource types: Config rule
-- (@AWS::Config::ConfigRule@) and remediation action
-- (@AWS::Config::RemediationConfiguration@).
putConformancePack_templateBody :: Lens.Lens' PutConformancePack (Prelude.Maybe Prelude.Text)
putConformancePack_templateBody :: Lens' PutConformancePack (Maybe Text)
putConformancePack_templateBody = 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)

-- | The location of the file containing the template body
-- (@s3:\/\/bucketname\/prefix@). The uri must point to a 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 :: Lens' PutConformancePack (Maybe Text)
putConformancePack_templateS3Uri = 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)

-- | An object of type @TemplateSSMDocumentDetails@, which contains the name
-- or the Amazon Resource Name (ARN) of the Amazon Web Services Systems
-- Manager document (SSM document) and the version of the SSM document that
-- is used to create a conformance pack.
putConformancePack_templateSSMDocumentDetails :: Lens.Lens' PutConformancePack (Prelude.Maybe TemplateSSMDocumentDetails)
putConformancePack_templateSSMDocumentDetails :: Lens' PutConformancePack (Maybe TemplateSSMDocumentDetails)
putConformancePack_templateSSMDocumentDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutConformancePack' {Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails :: Maybe TemplateSSMDocumentDetails
$sel:templateSSMDocumentDetails:PutConformancePack' :: PutConformancePack -> Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails} -> Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails) (\s :: PutConformancePack
s@PutConformancePack' {} Maybe TemplateSSMDocumentDetails
a -> PutConformancePack
s {$sel:templateSSMDocumentDetails:PutConformancePack' :: Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails = Maybe TemplateSSMDocumentDetails
a} :: PutConformancePack)

-- | The unique name of the conformance pack you want to deploy.
putConformancePack_conformancePackName :: Lens.Lens' PutConformancePack Prelude.Text
putConformancePack_conformancePackName :: Lens' PutConformancePack Text
putConformancePack_conformancePackName = 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 :: (Service -> Service)
-> PutConformancePack -> Request PutConformancePack
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutConformancePack
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutConformancePack)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> PutConformancePackResponse
PutConformancePackResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ConformancePackArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutConformancePack where
  hashWithSalt :: Int -> PutConformancePack -> Int
hashWithSalt Int
_salt PutConformancePack' {Maybe [ConformancePackInputParameter]
Maybe Text
Maybe TemplateSSMDocumentDetails
Text
conformancePackName :: Text
templateSSMDocumentDetails :: Maybe TemplateSSMDocumentDetails
templateS3Uri :: Maybe Text
templateBody :: Maybe Text
deliveryS3KeyPrefix :: Maybe Text
deliveryS3Bucket :: Maybe Text
conformancePackInputParameters :: Maybe [ConformancePackInputParameter]
$sel:conformancePackName:PutConformancePack' :: PutConformancePack -> Text
$sel:templateSSMDocumentDetails:PutConformancePack' :: PutConformancePack -> Maybe TemplateSSMDocumentDetails
$sel:templateS3Uri:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:templateBody:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3KeyPrefix:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3Bucket:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:conformancePackInputParameters:PutConformancePack' :: PutConformancePack -> Maybe [ConformancePackInputParameter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ConformancePackInputParameter]
conformancePackInputParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deliveryS3Bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deliveryS3KeyPrefix
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateBody
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
templateS3Uri
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
conformancePackName

instance Prelude.NFData PutConformancePack where
  rnf :: PutConformancePack -> ()
rnf PutConformancePack' {Maybe [ConformancePackInputParameter]
Maybe Text
Maybe TemplateSSMDocumentDetails
Text
conformancePackName :: Text
templateSSMDocumentDetails :: Maybe TemplateSSMDocumentDetails
templateS3Uri :: Maybe Text
templateBody :: Maybe Text
deliveryS3KeyPrefix :: Maybe Text
deliveryS3Bucket :: Maybe Text
conformancePackInputParameters :: Maybe [ConformancePackInputParameter]
$sel:conformancePackName:PutConformancePack' :: PutConformancePack -> Text
$sel:templateSSMDocumentDetails:PutConformancePack' :: PutConformancePack -> Maybe TemplateSSMDocumentDetails
$sel:templateS3Uri:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:templateBody:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3KeyPrefix:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3Bucket:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:conformancePackInputParameters:PutConformancePack' :: PutConformancePack -> Maybe [ConformancePackInputParameter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConformancePackInputParameter]
conformancePackInputParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deliveryS3Bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deliveryS3KeyPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateBody
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
templateS3Uri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
conformancePackName

instance Data.ToHeaders PutConformancePack where
  toHeaders :: PutConformancePack -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StarlingDoveService.PutConformancePack" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON PutConformancePack where
  toJSON :: PutConformancePack -> Value
toJSON PutConformancePack' {Maybe [ConformancePackInputParameter]
Maybe Text
Maybe TemplateSSMDocumentDetails
Text
conformancePackName :: Text
templateSSMDocumentDetails :: Maybe TemplateSSMDocumentDetails
templateS3Uri :: Maybe Text
templateBody :: Maybe Text
deliveryS3KeyPrefix :: Maybe Text
deliveryS3Bucket :: Maybe Text
conformancePackInputParameters :: Maybe [ConformancePackInputParameter]
$sel:conformancePackName:PutConformancePack' :: PutConformancePack -> Text
$sel:templateSSMDocumentDetails:PutConformancePack' :: PutConformancePack -> Maybe TemplateSSMDocumentDetails
$sel:templateS3Uri:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:templateBody:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3KeyPrefix:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:deliveryS3Bucket:PutConformancePack' :: PutConformancePack -> Maybe Text
$sel:conformancePackInputParameters:PutConformancePack' :: PutConformancePack -> Maybe [ConformancePackInputParameter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"ConformancePackInputParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ConformancePackInputParameter]
conformancePackInputParameters,
            (Key
"DeliveryS3Bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deliveryS3Bucket,
            (Key
"DeliveryS3KeyPrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deliveryS3KeyPrefix,
            (Key
"TemplateBody" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
templateBody,
            (Key
"TemplateS3Uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
templateS3Uri,
            (Key
"TemplateSSMDocumentDetails" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TemplateSSMDocumentDetails
templateSSMDocumentDetails,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ConformancePackName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
conformancePackName)
          ]
      )

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

instance Data.ToQuery PutConformancePack where
  toQuery :: PutConformancePack -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:conformancePackArn:PutConformancePackResponse' :: Maybe Text
conformancePackArn =
        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 :: Lens' PutConformancePackResponse (Maybe Text)
putConformancePackResponse_conformancePackArn = 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 :: Lens' PutConformancePackResponse Int
putConformancePackResponse_httpStatus = 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 where
  rnf :: PutConformancePackResponse -> ()
rnf PutConformancePackResponse' {Int
Maybe Text
httpStatus :: Int
conformancePackArn :: Maybe Text
$sel:httpStatus:PutConformancePackResponse' :: PutConformancePackResponse -> Int
$sel:conformancePackArn:PutConformancePackResponse' :: PutConformancePackResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
conformancePackArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus