{-# 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.SSM.PutComplianceItems
-- 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)
--
-- Registers a compliance type and other compliance details on a designated
-- resource. This operation lets you register custom compliance details
-- with a resource. This call overwrites existing compliance information on
-- the resource, so you must provide a full list of compliance items each
-- time that you send the request.
--
-- ComplianceType can be one of the following:
--
-- -   ExecutionId: The execution ID when the patch, association, or custom
--     compliance item was applied.
--
-- -   ExecutionType: Specify patch, association, or Custom:@string@.
--
-- -   ExecutionTime. The time the patch, association, or custom compliance
--     item was applied to the instance.
--
-- -   Id: The patch, association, or custom compliance ID.
--
-- -   Title: A title.
--
-- -   Status: The status of the compliance item. For example, @approved@
--     for patches, or @Failed@ for associations.
--
-- -   Severity: A patch severity. For example, @critical@.
--
-- -   DocumentName: An SSM document name. For example,
--     @AWS-RunPatchBaseline@.
--
-- -   DocumentVersion: An SSM document version number. For example, 4.
--
-- -   Classification: A patch classification. For example,
--     @security updates@.
--
-- -   PatchBaselineId: A patch baseline ID.
--
-- -   PatchSeverity: A patch severity. For example, @Critical@.
--
-- -   PatchState: A patch state. For example,
--     @InstancesWithFailedPatches@.
--
-- -   PatchGroup: The name of a patch group.
--
-- -   InstalledTime: The time the association, patch, or custom compliance
--     item was applied to the resource. Specify the time by using the
--     following format: yyyy-MM-dd\'T\'HH:mm:ss\'Z\'
module Amazonka.SSM.PutComplianceItems
  ( -- * Creating a Request
    PutComplianceItems (..),
    newPutComplianceItems,

    -- * Request Lenses
    putComplianceItems_uploadType,
    putComplianceItems_itemContentHash,
    putComplianceItems_resourceId,
    putComplianceItems_resourceType,
    putComplianceItems_complianceType,
    putComplianceItems_executionSummary,
    putComplianceItems_items,

    -- * Destructuring the Response
    PutComplianceItemsResponse (..),
    newPutComplianceItemsResponse,

    -- * Response Lenses
    putComplianceItemsResponse_httpStatus,
  )
where

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
import Amazonka.SSM.Types

-- | /See:/ 'newPutComplianceItems' smart constructor.
data PutComplianceItems = PutComplianceItems'
  { -- | The mode for uploading compliance items. You can specify @COMPLETE@ or
    -- @PARTIAL@. In @COMPLETE@ mode, the system overwrites all existing
    -- compliance information for the resource. You must provide a full list of
    -- compliance items each time you send the request.
    --
    -- In @PARTIAL@ mode, the system overwrites compliance information for a
    -- specific association. The association must be configured with
    -- @SyncCompliance@ set to @MANUAL@. By default, all requests use
    -- @COMPLETE@ mode.
    --
    -- This attribute is only valid for association compliance.
    PutComplianceItems -> Maybe ComplianceUploadType
uploadType :: Prelude.Maybe ComplianceUploadType,
    -- | MD5 or SHA-256 content hash. The content hash is used to determine if
    -- existing information should be overwritten or ignored. If the content
    -- hashes match, the request to put compliance information is ignored.
    PutComplianceItems -> Maybe Text
itemContentHash :: Prelude.Maybe Prelude.Text,
    -- | Specify an ID for this resource. For a managed instance, this is the
    -- instance ID.
    PutComplianceItems -> Text
resourceId :: Prelude.Text,
    -- | Specify the type of resource. @ManagedInstance@ is currently the only
    -- supported resource type.
    PutComplianceItems -> Text
resourceType :: Prelude.Text,
    -- | Specify the compliance type. For example, specify Association (for a
    -- State Manager association), Patch, or Custom:@string@.
    PutComplianceItems -> Text
complianceType :: Prelude.Text,
    -- | A summary of the call execution that includes an execution ID, the type
    -- of execution (for example, @Command@), and the date\/time of the
    -- execution using a datetime object that is saved in the following format:
    -- yyyy-MM-dd\'T\'HH:mm:ss\'Z\'.
    PutComplianceItems -> ComplianceExecutionSummary
executionSummary :: ComplianceExecutionSummary,
    -- | Information about the compliance as defined by the resource type. For
    -- example, for a patch compliance type, @Items@ includes information about
    -- the PatchSeverity, Classification, and so on.
    PutComplianceItems -> [ComplianceItemEntry]
items :: [ComplianceItemEntry]
  }
  deriving (PutComplianceItems -> PutComplianceItems -> Bool
(PutComplianceItems -> PutComplianceItems -> Bool)
-> (PutComplianceItems -> PutComplianceItems -> Bool)
-> Eq PutComplianceItems
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutComplianceItems -> PutComplianceItems -> Bool
$c/= :: PutComplianceItems -> PutComplianceItems -> Bool
== :: PutComplianceItems -> PutComplianceItems -> Bool
$c== :: PutComplianceItems -> PutComplianceItems -> Bool
Prelude.Eq, ReadPrec [PutComplianceItems]
ReadPrec PutComplianceItems
Int -> ReadS PutComplianceItems
ReadS [PutComplianceItems]
(Int -> ReadS PutComplianceItems)
-> ReadS [PutComplianceItems]
-> ReadPrec PutComplianceItems
-> ReadPrec [PutComplianceItems]
-> Read PutComplianceItems
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutComplianceItems]
$creadListPrec :: ReadPrec [PutComplianceItems]
readPrec :: ReadPrec PutComplianceItems
$creadPrec :: ReadPrec PutComplianceItems
readList :: ReadS [PutComplianceItems]
$creadList :: ReadS [PutComplianceItems]
readsPrec :: Int -> ReadS PutComplianceItems
$creadsPrec :: Int -> ReadS PutComplianceItems
Prelude.Read, Int -> PutComplianceItems -> ShowS
[PutComplianceItems] -> ShowS
PutComplianceItems -> String
(Int -> PutComplianceItems -> ShowS)
-> (PutComplianceItems -> String)
-> ([PutComplianceItems] -> ShowS)
-> Show PutComplianceItems
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutComplianceItems] -> ShowS
$cshowList :: [PutComplianceItems] -> ShowS
show :: PutComplianceItems -> String
$cshow :: PutComplianceItems -> String
showsPrec :: Int -> PutComplianceItems -> ShowS
$cshowsPrec :: Int -> PutComplianceItems -> ShowS
Prelude.Show, (forall x. PutComplianceItems -> Rep PutComplianceItems x)
-> (forall x. Rep PutComplianceItems x -> PutComplianceItems)
-> Generic PutComplianceItems
forall x. Rep PutComplianceItems x -> PutComplianceItems
forall x. PutComplianceItems -> Rep PutComplianceItems x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutComplianceItems x -> PutComplianceItems
$cfrom :: forall x. PutComplianceItems -> Rep PutComplianceItems x
Prelude.Generic)

-- |
-- Create a value of 'PutComplianceItems' 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:
--
-- 'uploadType', 'putComplianceItems_uploadType' - The mode for uploading compliance items. You can specify @COMPLETE@ or
-- @PARTIAL@. In @COMPLETE@ mode, the system overwrites all existing
-- compliance information for the resource. You must provide a full list of
-- compliance items each time you send the request.
--
-- In @PARTIAL@ mode, the system overwrites compliance information for a
-- specific association. The association must be configured with
-- @SyncCompliance@ set to @MANUAL@. By default, all requests use
-- @COMPLETE@ mode.
--
-- This attribute is only valid for association compliance.
--
-- 'itemContentHash', 'putComplianceItems_itemContentHash' - MD5 or SHA-256 content hash. The content hash is used to determine if
-- existing information should be overwritten or ignored. If the content
-- hashes match, the request to put compliance information is ignored.
--
-- 'resourceId', 'putComplianceItems_resourceId' - Specify an ID for this resource. For a managed instance, this is the
-- instance ID.
--
-- 'resourceType', 'putComplianceItems_resourceType' - Specify the type of resource. @ManagedInstance@ is currently the only
-- supported resource type.
--
-- 'complianceType', 'putComplianceItems_complianceType' - Specify the compliance type. For example, specify Association (for a
-- State Manager association), Patch, or Custom:@string@.
--
-- 'executionSummary', 'putComplianceItems_executionSummary' - A summary of the call execution that includes an execution ID, the type
-- of execution (for example, @Command@), and the date\/time of the
-- execution using a datetime object that is saved in the following format:
-- yyyy-MM-dd\'T\'HH:mm:ss\'Z\'.
--
-- 'items', 'putComplianceItems_items' - Information about the compliance as defined by the resource type. For
-- example, for a patch compliance type, @Items@ includes information about
-- the PatchSeverity, Classification, and so on.
newPutComplianceItems ::
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'resourceType'
  Prelude.Text ->
  -- | 'complianceType'
  Prelude.Text ->
  -- | 'executionSummary'
  ComplianceExecutionSummary ->
  PutComplianceItems
newPutComplianceItems :: Text
-> Text -> Text -> ComplianceExecutionSummary -> PutComplianceItems
newPutComplianceItems
  Text
pResourceId_
  Text
pResourceType_
  Text
pComplianceType_
  ComplianceExecutionSummary
pExecutionSummary_ =
    PutComplianceItems' :: Maybe ComplianceUploadType
-> Maybe Text
-> Text
-> Text
-> Text
-> ComplianceExecutionSummary
-> [ComplianceItemEntry]
-> PutComplianceItems
PutComplianceItems'
      { $sel:uploadType:PutComplianceItems' :: Maybe ComplianceUploadType
uploadType = Maybe ComplianceUploadType
forall a. Maybe a
Prelude.Nothing,
        $sel:itemContentHash:PutComplianceItems' :: Maybe Text
itemContentHash = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:resourceId:PutComplianceItems' :: Text
resourceId = Text
pResourceId_,
        $sel:resourceType:PutComplianceItems' :: Text
resourceType = Text
pResourceType_,
        $sel:complianceType:PutComplianceItems' :: Text
complianceType = Text
pComplianceType_,
        $sel:executionSummary:PutComplianceItems' :: ComplianceExecutionSummary
executionSummary = ComplianceExecutionSummary
pExecutionSummary_,
        $sel:items:PutComplianceItems' :: [ComplianceItemEntry]
items = [ComplianceItemEntry]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The mode for uploading compliance items. You can specify @COMPLETE@ or
-- @PARTIAL@. In @COMPLETE@ mode, the system overwrites all existing
-- compliance information for the resource. You must provide a full list of
-- compliance items each time you send the request.
--
-- In @PARTIAL@ mode, the system overwrites compliance information for a
-- specific association. The association must be configured with
-- @SyncCompliance@ set to @MANUAL@. By default, all requests use
-- @COMPLETE@ mode.
--
-- This attribute is only valid for association compliance.
putComplianceItems_uploadType :: Lens.Lens' PutComplianceItems (Prelude.Maybe ComplianceUploadType)
putComplianceItems_uploadType :: (Maybe ComplianceUploadType -> f (Maybe ComplianceUploadType))
-> PutComplianceItems -> f PutComplianceItems
putComplianceItems_uploadType = (PutComplianceItems -> Maybe ComplianceUploadType)
-> (PutComplianceItems
    -> Maybe ComplianceUploadType -> PutComplianceItems)
-> Lens
     PutComplianceItems
     PutComplianceItems
     (Maybe ComplianceUploadType)
     (Maybe ComplianceUploadType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {Maybe ComplianceUploadType
uploadType :: Maybe ComplianceUploadType
$sel:uploadType:PutComplianceItems' :: PutComplianceItems -> Maybe ComplianceUploadType
uploadType} -> Maybe ComplianceUploadType
uploadType) (\s :: PutComplianceItems
s@PutComplianceItems' {} Maybe ComplianceUploadType
a -> PutComplianceItems
s {$sel:uploadType:PutComplianceItems' :: Maybe ComplianceUploadType
uploadType = Maybe ComplianceUploadType
a} :: PutComplianceItems)

-- | MD5 or SHA-256 content hash. The content hash is used to determine if
-- existing information should be overwritten or ignored. If the content
-- hashes match, the request to put compliance information is ignored.
putComplianceItems_itemContentHash :: Lens.Lens' PutComplianceItems (Prelude.Maybe Prelude.Text)
putComplianceItems_itemContentHash :: (Maybe Text -> f (Maybe Text))
-> PutComplianceItems -> f PutComplianceItems
putComplianceItems_itemContentHash = (PutComplianceItems -> Maybe Text)
-> (PutComplianceItems -> Maybe Text -> PutComplianceItems)
-> Lens
     PutComplianceItems PutComplianceItems (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {Maybe Text
itemContentHash :: Maybe Text
$sel:itemContentHash:PutComplianceItems' :: PutComplianceItems -> Maybe Text
itemContentHash} -> Maybe Text
itemContentHash) (\s :: PutComplianceItems
s@PutComplianceItems' {} Maybe Text
a -> PutComplianceItems
s {$sel:itemContentHash:PutComplianceItems' :: Maybe Text
itemContentHash = Maybe Text
a} :: PutComplianceItems)

-- | Specify an ID for this resource. For a managed instance, this is the
-- instance ID.
putComplianceItems_resourceId :: Lens.Lens' PutComplianceItems Prelude.Text
putComplianceItems_resourceId :: (Text -> f Text) -> PutComplianceItems -> f PutComplianceItems
putComplianceItems_resourceId = (PutComplianceItems -> Text)
-> (PutComplianceItems -> Text -> PutComplianceItems)
-> Lens PutComplianceItems PutComplianceItems Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {Text
resourceId :: Text
$sel:resourceId:PutComplianceItems' :: PutComplianceItems -> Text
resourceId} -> Text
resourceId) (\s :: PutComplianceItems
s@PutComplianceItems' {} Text
a -> PutComplianceItems
s {$sel:resourceId:PutComplianceItems' :: Text
resourceId = Text
a} :: PutComplianceItems)

-- | Specify the type of resource. @ManagedInstance@ is currently the only
-- supported resource type.
putComplianceItems_resourceType :: Lens.Lens' PutComplianceItems Prelude.Text
putComplianceItems_resourceType :: (Text -> f Text) -> PutComplianceItems -> f PutComplianceItems
putComplianceItems_resourceType = (PutComplianceItems -> Text)
-> (PutComplianceItems -> Text -> PutComplianceItems)
-> Lens PutComplianceItems PutComplianceItems Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {Text
resourceType :: Text
$sel:resourceType:PutComplianceItems' :: PutComplianceItems -> Text
resourceType} -> Text
resourceType) (\s :: PutComplianceItems
s@PutComplianceItems' {} Text
a -> PutComplianceItems
s {$sel:resourceType:PutComplianceItems' :: Text
resourceType = Text
a} :: PutComplianceItems)

-- | Specify the compliance type. For example, specify Association (for a
-- State Manager association), Patch, or Custom:@string@.
putComplianceItems_complianceType :: Lens.Lens' PutComplianceItems Prelude.Text
putComplianceItems_complianceType :: (Text -> f Text) -> PutComplianceItems -> f PutComplianceItems
putComplianceItems_complianceType = (PutComplianceItems -> Text)
-> (PutComplianceItems -> Text -> PutComplianceItems)
-> Lens PutComplianceItems PutComplianceItems Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {Text
complianceType :: Text
$sel:complianceType:PutComplianceItems' :: PutComplianceItems -> Text
complianceType} -> Text
complianceType) (\s :: PutComplianceItems
s@PutComplianceItems' {} Text
a -> PutComplianceItems
s {$sel:complianceType:PutComplianceItems' :: Text
complianceType = Text
a} :: PutComplianceItems)

-- | A summary of the call execution that includes an execution ID, the type
-- of execution (for example, @Command@), and the date\/time of the
-- execution using a datetime object that is saved in the following format:
-- yyyy-MM-dd\'T\'HH:mm:ss\'Z\'.
putComplianceItems_executionSummary :: Lens.Lens' PutComplianceItems ComplianceExecutionSummary
putComplianceItems_executionSummary :: (ComplianceExecutionSummary -> f ComplianceExecutionSummary)
-> PutComplianceItems -> f PutComplianceItems
putComplianceItems_executionSummary = (PutComplianceItems -> ComplianceExecutionSummary)
-> (PutComplianceItems
    -> ComplianceExecutionSummary -> PutComplianceItems)
-> Lens
     PutComplianceItems
     PutComplianceItems
     ComplianceExecutionSummary
     ComplianceExecutionSummary
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {ComplianceExecutionSummary
executionSummary :: ComplianceExecutionSummary
$sel:executionSummary:PutComplianceItems' :: PutComplianceItems -> ComplianceExecutionSummary
executionSummary} -> ComplianceExecutionSummary
executionSummary) (\s :: PutComplianceItems
s@PutComplianceItems' {} ComplianceExecutionSummary
a -> PutComplianceItems
s {$sel:executionSummary:PutComplianceItems' :: ComplianceExecutionSummary
executionSummary = ComplianceExecutionSummary
a} :: PutComplianceItems)

-- | Information about the compliance as defined by the resource type. For
-- example, for a patch compliance type, @Items@ includes information about
-- the PatchSeverity, Classification, and so on.
putComplianceItems_items :: Lens.Lens' PutComplianceItems [ComplianceItemEntry]
putComplianceItems_items :: ([ComplianceItemEntry] -> f [ComplianceItemEntry])
-> PutComplianceItems -> f PutComplianceItems
putComplianceItems_items = (PutComplianceItems -> [ComplianceItemEntry])
-> (PutComplianceItems
    -> [ComplianceItemEntry] -> PutComplianceItems)
-> Lens
     PutComplianceItems
     PutComplianceItems
     [ComplianceItemEntry]
     [ComplianceItemEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutComplianceItems' {[ComplianceItemEntry]
items :: [ComplianceItemEntry]
$sel:items:PutComplianceItems' :: PutComplianceItems -> [ComplianceItemEntry]
items} -> [ComplianceItemEntry]
items) (\s :: PutComplianceItems
s@PutComplianceItems' {} [ComplianceItemEntry]
a -> PutComplianceItems
s {$sel:items:PutComplianceItems' :: [ComplianceItemEntry]
items = [ComplianceItemEntry]
a} :: PutComplianceItems) (([ComplianceItemEntry] -> f [ComplianceItemEntry])
 -> PutComplianceItems -> f PutComplianceItems)
-> (([ComplianceItemEntry] -> f [ComplianceItemEntry])
    -> [ComplianceItemEntry] -> f [ComplianceItemEntry])
-> ([ComplianceItemEntry] -> f [ComplianceItemEntry])
-> PutComplianceItems
-> f PutComplianceItems
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ComplianceItemEntry] -> f [ComplianceItemEntry])
-> [ComplianceItemEntry] -> f [ComplianceItemEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest PutComplianceItems where
  type
    AWSResponse PutComplianceItems =
      PutComplianceItemsResponse
  request :: PutComplianceItems -> Request PutComplianceItems
request = Service -> PutComplianceItems -> Request PutComplianceItems
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutComplianceItems
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutComplianceItems)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse PutComplianceItems))
-> Logger
-> Service
-> Proxy PutComplianceItems
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutComplianceItems)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> PutComplianceItemsResponse
PutComplianceItemsResponse'
            (Int -> PutComplianceItemsResponse)
-> Either String Int -> Either String PutComplianceItemsResponse
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))
      )

instance Prelude.Hashable PutComplianceItems

instance Prelude.NFData PutComplianceItems

instance Core.ToHeaders PutComplianceItems where
  toHeaders :: PutComplianceItems -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutComplianceItems -> 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
"AmazonSSM.PutComplianceItems" ::
                          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 PutComplianceItems where
  toJSON :: PutComplianceItems -> Value
toJSON PutComplianceItems' {[ComplianceItemEntry]
Maybe Text
Maybe ComplianceUploadType
Text
ComplianceExecutionSummary
items :: [ComplianceItemEntry]
executionSummary :: ComplianceExecutionSummary
complianceType :: Text
resourceType :: Text
resourceId :: Text
itemContentHash :: Maybe Text
uploadType :: Maybe ComplianceUploadType
$sel:items:PutComplianceItems' :: PutComplianceItems -> [ComplianceItemEntry]
$sel:executionSummary:PutComplianceItems' :: PutComplianceItems -> ComplianceExecutionSummary
$sel:complianceType:PutComplianceItems' :: PutComplianceItems -> Text
$sel:resourceType:PutComplianceItems' :: PutComplianceItems -> Text
$sel:resourceId:PutComplianceItems' :: PutComplianceItems -> Text
$sel:itemContentHash:PutComplianceItems' :: PutComplianceItems -> Maybe Text
$sel:uploadType:PutComplianceItems' :: PutComplianceItems -> Maybe ComplianceUploadType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"UploadType" Text -> ComplianceUploadType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ComplianceUploadType -> Pair)
-> Maybe ComplianceUploadType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComplianceUploadType
uploadType,
            (Text
"ItemContentHash" 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
itemContentHash,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ComplianceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
complianceType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ExecutionSummary" Text -> ComplianceExecutionSummary -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ComplianceExecutionSummary
executionSummary),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Items" Text -> [ComplianceItemEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [ComplianceItemEntry]
items)
          ]
      )

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

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

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

-- |
-- Create a value of 'PutComplianceItemsResponse' 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', 'putComplianceItemsResponse_httpStatus' - The response's http status code.
newPutComplianceItemsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutComplianceItemsResponse
newPutComplianceItemsResponse :: Int -> PutComplianceItemsResponse
newPutComplianceItemsResponse Int
pHttpStatus_ =
  PutComplianceItemsResponse' :: Int -> PutComplianceItemsResponse
PutComplianceItemsResponse'
    { $sel:httpStatus:PutComplianceItemsResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData PutComplianceItemsResponse