{-# 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-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)
--
-- Updates a custom control in Audit Manager.
module Amazonka.AuditManager.UpdateControl
  ( -- * Creating a Request
    UpdateControl (..),
    newUpdateControl,

    -- * Request Lenses
    updateControl_testingInformation,
    updateControl_actionPlanInstructions,
    updateControl_actionPlanTitle,
    updateControl_description,
    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.Lens as Lens
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 steps that to follow to determine if the control has been satisfied.
    UpdateControl -> Maybe Text
testingInformation :: Prelude.Maybe Prelude.Text,
    -- | The recommended actions to carry out if the control is not 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 identifier for the specified control.
    UpdateControl -> Text
controlId :: Prelude.Text,
    -- | The name of the control to be updated.
    UpdateControl -> Text
name :: Prelude.Text,
    -- | The data mapping sources for the specified control.
    UpdateControl -> NonEmpty ControlMappingSource
controlMappingSources :: Prelude.NonEmpty ControlMappingSource
  }
  deriving (UpdateControl -> UpdateControl -> Bool
(UpdateControl -> UpdateControl -> Bool)
-> (UpdateControl -> UpdateControl -> Bool) -> Eq UpdateControl
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]
(Int -> ReadS UpdateControl)
-> ReadS [UpdateControl]
-> ReadPrec UpdateControl
-> ReadPrec [UpdateControl]
-> Read 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
(Int -> UpdateControl -> ShowS)
-> (UpdateControl -> String)
-> ([UpdateControl] -> ShowS)
-> Show UpdateControl
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. UpdateControl -> Rep UpdateControl x)
-> (forall x. Rep UpdateControl x -> UpdateControl)
-> Generic UpdateControl
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:
--
-- 'testingInformation', 'updateControl_testingInformation' - The steps that to follow to determine if the control has been satisfied.
--
-- 'actionPlanInstructions', 'updateControl_actionPlanInstructions' - The recommended actions to carry out if the control is not fulfilled.
--
-- 'actionPlanTitle', 'updateControl_actionPlanTitle' - The title of the action plan for remediating the control.
--
-- 'description', 'updateControl_description' - The optional description of the control.
--
-- 'controlId', 'updateControl_controlId' - The identifier for the specified control.
--
-- 'name', 'updateControl_name' - The name of the control to be updated.
--
-- 'controlMappingSources', 'updateControl_controlMappingSources' - The data mapping sources for the specified 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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> NonEmpty ControlMappingSource
-> UpdateControl
UpdateControl'
      { $sel:testingInformation:UpdateControl' :: Maybe Text
testingInformation =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:actionPlanInstructions:UpdateControl' :: Maybe Text
actionPlanInstructions = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:actionPlanTitle:UpdateControl' :: Maybe Text
actionPlanTitle = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateControl' :: Maybe Text
description = Maybe Text
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 =
          Tagged
  (NonEmpty ControlMappingSource)
  (Identity (NonEmpty ControlMappingSource))
-> Tagged
     (NonEmpty ControlMappingSource)
     (Identity (NonEmpty ControlMappingSource))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty ControlMappingSource)
   (Identity (NonEmpty ControlMappingSource))
 -> Tagged
      (NonEmpty ControlMappingSource)
      (Identity (NonEmpty ControlMappingSource)))
-> NonEmpty ControlMappingSource -> NonEmpty ControlMappingSource
forall t b. AReview t b -> b -> t
Lens.# NonEmpty ControlMappingSource
pControlMappingSources_
      }

-- | The steps that to follow to determine if the control has been satisfied.
updateControl_testingInformation :: Lens.Lens' UpdateControl (Prelude.Maybe Prelude.Text)
updateControl_testingInformation :: (Maybe Text -> f (Maybe Text)) -> UpdateControl -> f UpdateControl
updateControl_testingInformation = (UpdateControl -> Maybe Text)
-> (UpdateControl -> Maybe Text -> UpdateControl)
-> Lens UpdateControl UpdateControl (Maybe Text) (Maybe Text)
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 recommended actions to carry out if the control is not fulfilled.
updateControl_actionPlanInstructions :: Lens.Lens' UpdateControl (Prelude.Maybe Prelude.Text)
updateControl_actionPlanInstructions :: (Maybe Text -> f (Maybe Text)) -> UpdateControl -> f UpdateControl
updateControl_actionPlanInstructions = (UpdateControl -> Maybe Text)
-> (UpdateControl -> Maybe Text -> UpdateControl)
-> Lens UpdateControl UpdateControl (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> UpdateControl -> f UpdateControl
updateControl_actionPlanTitle = (UpdateControl -> Maybe Text)
-> (UpdateControl -> Maybe Text -> UpdateControl)
-> Lens UpdateControl UpdateControl (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> UpdateControl -> f UpdateControl
updateControl_description = (UpdateControl -> Maybe Text)
-> (UpdateControl -> Maybe Text -> UpdateControl)
-> Lens UpdateControl UpdateControl (Maybe Text) (Maybe Text)
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 identifier for the specified control.
updateControl_controlId :: Lens.Lens' UpdateControl Prelude.Text
updateControl_controlId :: (Text -> f Text) -> UpdateControl -> f UpdateControl
updateControl_controlId = (UpdateControl -> Text)
-> (UpdateControl -> Text -> UpdateControl)
-> Lens UpdateControl UpdateControl Text Text
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 control to be updated.
updateControl_name :: Lens.Lens' UpdateControl Prelude.Text
updateControl_name :: (Text -> f Text) -> UpdateControl -> f UpdateControl
updateControl_name = (UpdateControl -> Text)
-> (UpdateControl -> Text -> UpdateControl)
-> Lens UpdateControl UpdateControl Text Text
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 specified control.
updateControl_controlMappingSources :: Lens.Lens' UpdateControl (Prelude.NonEmpty ControlMappingSource)
updateControl_controlMappingSources :: (NonEmpty ControlMappingSource
 -> f (NonEmpty ControlMappingSource))
-> UpdateControl -> f UpdateControl
updateControl_controlMappingSources = (UpdateControl -> NonEmpty ControlMappingSource)
-> (UpdateControl
    -> NonEmpty ControlMappingSource -> UpdateControl)
-> Lens
     UpdateControl
     UpdateControl
     (NonEmpty ControlMappingSource)
     (NonEmpty ControlMappingSource)
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) ((NonEmpty ControlMappingSource
  -> f (NonEmpty ControlMappingSource))
 -> UpdateControl -> f UpdateControl)
-> ((NonEmpty ControlMappingSource
     -> f (NonEmpty ControlMappingSource))
    -> NonEmpty ControlMappingSource
    -> f (NonEmpty ControlMappingSource))
-> (NonEmpty ControlMappingSource
    -> f (NonEmpty ControlMappingSource))
-> UpdateControl
-> f UpdateControl
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty ControlMappingSource
 -> f (NonEmpty ControlMappingSource))
-> NonEmpty ControlMappingSource
-> f (NonEmpty ControlMappingSource)
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 :: UpdateControl -> Request UpdateControl
request = Service -> UpdateControl -> Request UpdateControl
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateControl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateControl)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateControl))
-> Logger
-> Service
-> Proxy UpdateControl
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateControl)))
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 Control -> Int -> UpdateControlResponse
UpdateControlResponse'
            (Maybe Control -> Int -> UpdateControlResponse)
-> Either String (Maybe Control)
-> Either String (Int -> UpdateControlResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Control)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"control")
            Either String (Int -> UpdateControlResponse)
-> Either String Int -> Either String UpdateControlResponse
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 UpdateControl

instance Prelude.NFData UpdateControl

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

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

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

-- | /See:/ 'newUpdateControlResponse' smart constructor.
data UpdateControlResponse = UpdateControlResponse'
  { -- | The name of the updated control set returned by the @UpdateControl@ API.
    UpdateControlResponse -> Maybe Control
control :: Prelude.Maybe Control,
    -- | The response's http status code.
    UpdateControlResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateControlResponse -> UpdateControlResponse -> Bool
(UpdateControlResponse -> UpdateControlResponse -> Bool)
-> (UpdateControlResponse -> UpdateControlResponse -> Bool)
-> Eq UpdateControlResponse
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]
(Int -> ReadS UpdateControlResponse)
-> ReadS [UpdateControlResponse]
-> ReadPrec UpdateControlResponse
-> ReadPrec [UpdateControlResponse]
-> Read 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
(Int -> UpdateControlResponse -> ShowS)
-> (UpdateControlResponse -> String)
-> ([UpdateControlResponse] -> ShowS)
-> Show UpdateControlResponse
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. UpdateControlResponse -> Rep UpdateControlResponse x)
-> (forall x. Rep UpdateControlResponse x -> UpdateControlResponse)
-> Generic UpdateControlResponse
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 returned by the @UpdateControl@ API.
--
-- 'httpStatus', 'updateControlResponse_httpStatus' - The response's http status code.
newUpdateControlResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateControlResponse
newUpdateControlResponse :: Int -> UpdateControlResponse
newUpdateControlResponse Int
pHttpStatus_ =
  UpdateControlResponse' :: Maybe Control -> Int -> UpdateControlResponse
UpdateControlResponse'
    { $sel:control:UpdateControlResponse' :: Maybe Control
control = Maybe Control
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateControlResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the updated control set returned by the @UpdateControl@ API.
updateControlResponse_control :: Lens.Lens' UpdateControlResponse (Prelude.Maybe Control)
updateControlResponse_control :: (Maybe Control -> f (Maybe Control))
-> UpdateControlResponse -> f UpdateControlResponse
updateControlResponse_control = (UpdateControlResponse -> Maybe Control)
-> (UpdateControlResponse
    -> Maybe Control -> UpdateControlResponse)
-> Lens
     UpdateControlResponse
     UpdateControlResponse
     (Maybe Control)
     (Maybe 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 :: (Int -> f Int) -> UpdateControlResponse -> f UpdateControlResponse
updateControlResponse_httpStatus = (UpdateControlResponse -> Int)
-> (UpdateControlResponse -> Int -> UpdateControlResponse)
-> Lens UpdateControlResponse UpdateControlResponse Int Int
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