{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AuditManager.UpdateControl
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a custom control in Audit Manager.
module Amazonka.AuditManager.UpdateControl
  ( -- * Creating a Request
    UpdateControl (..),
    newUpdateControl,

    -- * Request Lenses
    updateControl_actionPlanInstructions,
    updateControl_actionPlanTitle,
    updateControl_description,
    updateControl_testingInformation,
    updateControl_controlId,
    updateControl_name,
    updateControl_controlMappingSources,

    -- * Destructuring the Response
    UpdateControlResponse (..),
    newUpdateControlResponse,

    -- * Response Lenses
    updateControlResponse_control,
    updateControlResponse_httpStatus,
  )
where

import Amazonka.AuditManager.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:/ 'newUpdateControl' smart constructor.
data UpdateControl = UpdateControl'
  { -- | The recommended actions to carry out if the control isn\'t fulfilled.
    UpdateControl -> Maybe Text
actionPlanInstructions :: Prelude.Maybe Prelude.Text,
    -- | The title of the action plan for remediating the control.
    UpdateControl -> Maybe Text
actionPlanTitle :: Prelude.Maybe Prelude.Text,
    -- | The optional description of the control.
    UpdateControl -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The steps that you should follow to determine if the control is met.
    UpdateControl -> Maybe Text
testingInformation :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the control.
    UpdateControl -> Text
controlId :: Prelude.Text,
    -- | The name of the updated control.
    UpdateControl -> Text
name :: Prelude.Text,
    -- | The data mapping sources for the control.
    UpdateControl -> NonEmpty ControlMappingSource
controlMappingSources :: Prelude.NonEmpty ControlMappingSource
  }
  deriving (UpdateControl -> UpdateControl -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateControl -> UpdateControl -> Bool
$c/= :: UpdateControl -> UpdateControl -> Bool
== :: UpdateControl -> UpdateControl -> Bool
$c== :: UpdateControl -> UpdateControl -> Bool
Prelude.Eq, ReadPrec [UpdateControl]
ReadPrec UpdateControl
Int -> ReadS UpdateControl
ReadS [UpdateControl]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateControl]
$creadListPrec :: ReadPrec [UpdateControl]
readPrec :: ReadPrec UpdateControl
$creadPrec :: ReadPrec UpdateControl
readList :: ReadS [UpdateControl]
$creadList :: ReadS [UpdateControl]
readsPrec :: Int -> ReadS UpdateControl
$creadsPrec :: Int -> ReadS UpdateControl
Prelude.Read, Int -> UpdateControl -> ShowS
[UpdateControl] -> ShowS
UpdateControl -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateControl] -> ShowS
$cshowList :: [UpdateControl] -> ShowS
show :: UpdateControl -> String
$cshow :: UpdateControl -> String
showsPrec :: Int -> UpdateControl -> ShowS
$cshowsPrec :: Int -> UpdateControl -> ShowS
Prelude.Show, forall x. Rep UpdateControl x -> UpdateControl
forall x. UpdateControl -> Rep UpdateControl x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateControl x -> UpdateControl
$cfrom :: forall x. UpdateControl -> Rep UpdateControl x
Prelude.Generic)

-- |
-- Create a value of 'UpdateControl' 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:
--
-- 'actionPlanInstructions', 'updateControl_actionPlanInstructions' - The recommended actions to carry out if the control isn\'t fulfilled.
--
-- 'actionPlanTitle', 'updateControl_actionPlanTitle' - The title of the action plan for remediating the control.
--
-- 'description', 'updateControl_description' - The optional description of the control.
--
-- 'testingInformation', 'updateControl_testingInformation' - The steps that you should follow to determine if the control is met.
--
-- 'controlId', 'updateControl_controlId' - The identifier for the control.
--
-- 'name', 'updateControl_name' - The name of the updated control.
--
-- 'controlMappingSources', 'updateControl_controlMappingSources' - The data mapping sources for the control.
newUpdateControl ::
  -- | 'controlId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'controlMappingSources'
  Prelude.NonEmpty ControlMappingSource ->
  UpdateControl
newUpdateControl :: Text -> Text -> NonEmpty ControlMappingSource -> UpdateControl
newUpdateControl
  Text
pControlId_
  Text
pName_
  NonEmpty ControlMappingSource
pControlMappingSources_ =
    UpdateControl'
      { $sel:actionPlanInstructions:UpdateControl' :: Maybe Text
actionPlanInstructions =
          forall a. Maybe a
Prelude.Nothing,
        $sel:actionPlanTitle:UpdateControl' :: Maybe Text
actionPlanTitle = forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateControl' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:testingInformation:UpdateControl' :: Maybe Text
testingInformation = forall a. Maybe a
Prelude.Nothing,
        $sel:controlId:UpdateControl' :: Text
controlId = Text
pControlId_,
        $sel:name:UpdateControl' :: Text
name = Text
pName_,
        $sel:controlMappingSources:UpdateControl' :: NonEmpty ControlMappingSource
controlMappingSources =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty ControlMappingSource
pControlMappingSources_
      }

-- | The recommended actions to carry out if the control isn\'t fulfilled.
updateControl_actionPlanInstructions :: Lens.Lens' UpdateControl (Prelude.Maybe Prelude.Text)
updateControl_actionPlanInstructions :: Lens' UpdateControl (Maybe Text)
updateControl_actionPlanInstructions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {Maybe Text
actionPlanInstructions :: Maybe Text
$sel:actionPlanInstructions:UpdateControl' :: UpdateControl -> Maybe Text
actionPlanInstructions} -> Maybe Text
actionPlanInstructions) (\s :: UpdateControl
s@UpdateControl' {} Maybe Text
a -> UpdateControl
s {$sel:actionPlanInstructions:UpdateControl' :: Maybe Text
actionPlanInstructions = Maybe Text
a} :: UpdateControl)

-- | The title of the action plan for remediating the control.
updateControl_actionPlanTitle :: Lens.Lens' UpdateControl (Prelude.Maybe Prelude.Text)
updateControl_actionPlanTitle :: Lens' UpdateControl (Maybe Text)
updateControl_actionPlanTitle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {Maybe Text
actionPlanTitle :: Maybe Text
$sel:actionPlanTitle:UpdateControl' :: UpdateControl -> Maybe Text
actionPlanTitle} -> Maybe Text
actionPlanTitle) (\s :: UpdateControl
s@UpdateControl' {} Maybe Text
a -> UpdateControl
s {$sel:actionPlanTitle:UpdateControl' :: Maybe Text
actionPlanTitle = Maybe Text
a} :: UpdateControl)

-- | The optional description of the control.
updateControl_description :: Lens.Lens' UpdateControl (Prelude.Maybe Prelude.Text)
updateControl_description :: Lens' UpdateControl (Maybe Text)
updateControl_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {Maybe Text
description :: Maybe Text
$sel:description:UpdateControl' :: UpdateControl -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateControl
s@UpdateControl' {} Maybe Text
a -> UpdateControl
s {$sel:description:UpdateControl' :: Maybe Text
description = Maybe Text
a} :: UpdateControl)

-- | The steps that you should follow to determine if the control is met.
updateControl_testingInformation :: Lens.Lens' UpdateControl (Prelude.Maybe Prelude.Text)
updateControl_testingInformation :: Lens' UpdateControl (Maybe Text)
updateControl_testingInformation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {Maybe Text
testingInformation :: Maybe Text
$sel:testingInformation:UpdateControl' :: UpdateControl -> Maybe Text
testingInformation} -> Maybe Text
testingInformation) (\s :: UpdateControl
s@UpdateControl' {} Maybe Text
a -> UpdateControl
s {$sel:testingInformation:UpdateControl' :: Maybe Text
testingInformation = Maybe Text
a} :: UpdateControl)

-- | The identifier for the control.
updateControl_controlId :: Lens.Lens' UpdateControl Prelude.Text
updateControl_controlId :: Lens' UpdateControl Text
updateControl_controlId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {Text
controlId :: Text
$sel:controlId:UpdateControl' :: UpdateControl -> Text
controlId} -> Text
controlId) (\s :: UpdateControl
s@UpdateControl' {} Text
a -> UpdateControl
s {$sel:controlId:UpdateControl' :: Text
controlId = Text
a} :: UpdateControl)

-- | The name of the updated control.
updateControl_name :: Lens.Lens' UpdateControl Prelude.Text
updateControl_name :: Lens' UpdateControl Text
updateControl_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {Text
name :: Text
$sel:name:UpdateControl' :: UpdateControl -> Text
name} -> Text
name) (\s :: UpdateControl
s@UpdateControl' {} Text
a -> UpdateControl
s {$sel:name:UpdateControl' :: Text
name = Text
a} :: UpdateControl)

-- | The data mapping sources for the control.
updateControl_controlMappingSources :: Lens.Lens' UpdateControl (Prelude.NonEmpty ControlMappingSource)
updateControl_controlMappingSources :: Lens' UpdateControl (NonEmpty ControlMappingSource)
updateControl_controlMappingSources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControl' {NonEmpty ControlMappingSource
controlMappingSources :: NonEmpty ControlMappingSource
$sel:controlMappingSources:UpdateControl' :: UpdateControl -> NonEmpty ControlMappingSource
controlMappingSources} -> NonEmpty ControlMappingSource
controlMappingSources) (\s :: UpdateControl
s@UpdateControl' {} NonEmpty ControlMappingSource
a -> UpdateControl
s {$sel:controlMappingSources:UpdateControl' :: NonEmpty ControlMappingSource
controlMappingSources = NonEmpty ControlMappingSource
a} :: UpdateControl) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest UpdateControl where
  type
    AWSResponse UpdateControl =
      UpdateControlResponse
  request :: (Service -> Service) -> UpdateControl -> Request UpdateControl
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateControl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateControl)))
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 Control -> Int -> UpdateControlResponse
UpdateControlResponse'
            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
"control")
            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 UpdateControl where
  hashWithSalt :: Int -> UpdateControl -> Int
hashWithSalt Int
_salt UpdateControl' {Maybe Text
NonEmpty ControlMappingSource
Text
controlMappingSources :: NonEmpty ControlMappingSource
name :: Text
controlId :: Text
testingInformation :: Maybe Text
description :: Maybe Text
actionPlanTitle :: Maybe Text
actionPlanInstructions :: Maybe Text
$sel:controlMappingSources:UpdateControl' :: UpdateControl -> NonEmpty ControlMappingSource
$sel:name:UpdateControl' :: UpdateControl -> Text
$sel:controlId:UpdateControl' :: UpdateControl -> Text
$sel:testingInformation:UpdateControl' :: UpdateControl -> Maybe Text
$sel:description:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanTitle:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanInstructions:UpdateControl' :: UpdateControl -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionPlanInstructions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionPlanTitle
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
testingInformation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
controlId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty ControlMappingSource
controlMappingSources

instance Prelude.NFData UpdateControl where
  rnf :: UpdateControl -> ()
rnf UpdateControl' {Maybe Text
NonEmpty ControlMappingSource
Text
controlMappingSources :: NonEmpty ControlMappingSource
name :: Text
controlId :: Text
testingInformation :: Maybe Text
description :: Maybe Text
actionPlanTitle :: Maybe Text
actionPlanInstructions :: Maybe Text
$sel:controlMappingSources:UpdateControl' :: UpdateControl -> NonEmpty ControlMappingSource
$sel:name:UpdateControl' :: UpdateControl -> Text
$sel:controlId:UpdateControl' :: UpdateControl -> Text
$sel:testingInformation:UpdateControl' :: UpdateControl -> Maybe Text
$sel:description:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanTitle:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanInstructions:UpdateControl' :: UpdateControl -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionPlanInstructions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionPlanTitle
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
testingInformation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
controlId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty ControlMappingSource
controlMappingSources

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

instance Data.ToJSON UpdateControl where
  toJSON :: UpdateControl -> Value
toJSON UpdateControl' {Maybe Text
NonEmpty ControlMappingSource
Text
controlMappingSources :: NonEmpty ControlMappingSource
name :: Text
controlId :: Text
testingInformation :: Maybe Text
description :: Maybe Text
actionPlanTitle :: Maybe Text
actionPlanInstructions :: Maybe Text
$sel:controlMappingSources:UpdateControl' :: UpdateControl -> NonEmpty ControlMappingSource
$sel:name:UpdateControl' :: UpdateControl -> Text
$sel:controlId:UpdateControl' :: UpdateControl -> Text
$sel:testingInformation:UpdateControl' :: UpdateControl -> Maybe Text
$sel:description:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanTitle:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanInstructions:UpdateControl' :: UpdateControl -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"actionPlanInstructions" 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
actionPlanInstructions,
            (Key
"actionPlanTitle" 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
actionPlanTitle,
            (Key
"description" 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
description,
            (Key
"testingInformation" 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
testingInformation,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"controlMappingSources"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty ControlMappingSource
controlMappingSources
              )
          ]
      )

instance Data.ToPath UpdateControl where
  toPath :: UpdateControl -> ByteString
toPath UpdateControl' {Maybe Text
NonEmpty ControlMappingSource
Text
controlMappingSources :: NonEmpty ControlMappingSource
name :: Text
controlId :: Text
testingInformation :: Maybe Text
description :: Maybe Text
actionPlanTitle :: Maybe Text
actionPlanInstructions :: Maybe Text
$sel:controlMappingSources:UpdateControl' :: UpdateControl -> NonEmpty ControlMappingSource
$sel:name:UpdateControl' :: UpdateControl -> Text
$sel:controlId:UpdateControl' :: UpdateControl -> Text
$sel:testingInformation:UpdateControl' :: UpdateControl -> Maybe Text
$sel:description:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanTitle:UpdateControl' :: UpdateControl -> Maybe Text
$sel:actionPlanInstructions:UpdateControl' :: UpdateControl -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/controls/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
controlId]

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

-- | /See:/ 'newUpdateControlResponse' smart constructor.
data UpdateControlResponse = UpdateControlResponse'
  { -- | The name of the updated control set that the @UpdateControl@ API
    -- returned.
    UpdateControlResponse -> Maybe Control
control :: Prelude.Maybe Control,
    -- | The response's http status code.
    UpdateControlResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateControlResponse -> UpdateControlResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateControlResponse -> UpdateControlResponse -> Bool
$c/= :: UpdateControlResponse -> UpdateControlResponse -> Bool
== :: UpdateControlResponse -> UpdateControlResponse -> Bool
$c== :: UpdateControlResponse -> UpdateControlResponse -> Bool
Prelude.Eq, ReadPrec [UpdateControlResponse]
ReadPrec UpdateControlResponse
Int -> ReadS UpdateControlResponse
ReadS [UpdateControlResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateControlResponse]
$creadListPrec :: ReadPrec [UpdateControlResponse]
readPrec :: ReadPrec UpdateControlResponse
$creadPrec :: ReadPrec UpdateControlResponse
readList :: ReadS [UpdateControlResponse]
$creadList :: ReadS [UpdateControlResponse]
readsPrec :: Int -> ReadS UpdateControlResponse
$creadsPrec :: Int -> ReadS UpdateControlResponse
Prelude.Read, Int -> UpdateControlResponse -> ShowS
[UpdateControlResponse] -> ShowS
UpdateControlResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateControlResponse] -> ShowS
$cshowList :: [UpdateControlResponse] -> ShowS
show :: UpdateControlResponse -> String
$cshow :: UpdateControlResponse -> String
showsPrec :: Int -> UpdateControlResponse -> ShowS
$cshowsPrec :: Int -> UpdateControlResponse -> ShowS
Prelude.Show, forall x. Rep UpdateControlResponse x -> UpdateControlResponse
forall x. UpdateControlResponse -> Rep UpdateControlResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateControlResponse x -> UpdateControlResponse
$cfrom :: forall x. UpdateControlResponse -> Rep UpdateControlResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateControlResponse' 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:
--
-- 'control', 'updateControlResponse_control' - The name of the updated control set that the @UpdateControl@ API
-- returned.
--
-- 'httpStatus', 'updateControlResponse_httpStatus' - The response's http status code.
newUpdateControlResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateControlResponse
newUpdateControlResponse :: Int -> UpdateControlResponse
newUpdateControlResponse Int
pHttpStatus_ =
  UpdateControlResponse'
    { $sel:control:UpdateControlResponse' :: Maybe Control
control = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateControlResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the updated control set that the @UpdateControl@ API
-- returned.
updateControlResponse_control :: Lens.Lens' UpdateControlResponse (Prelude.Maybe Control)
updateControlResponse_control :: Lens' UpdateControlResponse (Maybe Control)
updateControlResponse_control = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateControlResponse' {Maybe Control
control :: Maybe Control
$sel:control:UpdateControlResponse' :: UpdateControlResponse -> Maybe Control
control} -> Maybe Control
control) (\s :: UpdateControlResponse
s@UpdateControlResponse' {} Maybe Control
a -> UpdateControlResponse
s {$sel:control:UpdateControlResponse' :: Maybe Control
control = Maybe Control
a} :: UpdateControlResponse)

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

instance Prelude.NFData UpdateControlResponse where
  rnf :: UpdateControlResponse -> ()
rnf UpdateControlResponse' {Int
Maybe Control
httpStatus :: Int
control :: Maybe Control
$sel:httpStatus:UpdateControlResponse' :: UpdateControlResponse -> Int
$sel:control:UpdateControlResponse' :: UpdateControlResponse -> Maybe Control
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Control
control
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus