{-# 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.MQ.UpdateConfiguration
-- 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 the specified configuration.
module Amazonka.MQ.UpdateConfiguration
  ( -- * Creating a Request
    UpdateConfiguration (..),
    newUpdateConfiguration,

    -- * Request Lenses
    updateConfiguration_description,
    updateConfiguration_configurationId,
    updateConfiguration_data,

    -- * Destructuring the Response
    UpdateConfigurationResponse (..),
    newUpdateConfigurationResponse,

    -- * Response Lenses
    updateConfigurationResponse_arn,
    updateConfigurationResponse_latestRevision,
    updateConfigurationResponse_created,
    updateConfigurationResponse_warnings,
    updateConfigurationResponse_name,
    updateConfigurationResponse_id,
    updateConfigurationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MQ.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Updates the specified configuration.
--
-- /See:/ 'newUpdateConfiguration' smart constructor.
data UpdateConfiguration = UpdateConfiguration'
  { -- | The description of the configuration.
    UpdateConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The unique ID that Amazon MQ generates for the configuration.
    UpdateConfiguration -> Text
configurationId :: Prelude.Text,
    -- | Required. The base64-encoded XML configuration.
    UpdateConfiguration -> Text
data' :: Prelude.Text
  }
  deriving (UpdateConfiguration -> UpdateConfiguration -> Bool
(UpdateConfiguration -> UpdateConfiguration -> Bool)
-> (UpdateConfiguration -> UpdateConfiguration -> Bool)
-> Eq UpdateConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConfiguration -> UpdateConfiguration -> Bool
$c/= :: UpdateConfiguration -> UpdateConfiguration -> Bool
== :: UpdateConfiguration -> UpdateConfiguration -> Bool
$c== :: UpdateConfiguration -> UpdateConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateConfiguration]
ReadPrec UpdateConfiguration
Int -> ReadS UpdateConfiguration
ReadS [UpdateConfiguration]
(Int -> ReadS UpdateConfiguration)
-> ReadS [UpdateConfiguration]
-> ReadPrec UpdateConfiguration
-> ReadPrec [UpdateConfiguration]
-> Read UpdateConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConfiguration]
$creadListPrec :: ReadPrec [UpdateConfiguration]
readPrec :: ReadPrec UpdateConfiguration
$creadPrec :: ReadPrec UpdateConfiguration
readList :: ReadS [UpdateConfiguration]
$creadList :: ReadS [UpdateConfiguration]
readsPrec :: Int -> ReadS UpdateConfiguration
$creadsPrec :: Int -> ReadS UpdateConfiguration
Prelude.Read, Int -> UpdateConfiguration -> ShowS
[UpdateConfiguration] -> ShowS
UpdateConfiguration -> String
(Int -> UpdateConfiguration -> ShowS)
-> (UpdateConfiguration -> String)
-> ([UpdateConfiguration] -> ShowS)
-> Show UpdateConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConfiguration] -> ShowS
$cshowList :: [UpdateConfiguration] -> ShowS
show :: UpdateConfiguration -> String
$cshow :: UpdateConfiguration -> String
showsPrec :: Int -> UpdateConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateConfiguration -> ShowS
Prelude.Show, (forall x. UpdateConfiguration -> Rep UpdateConfiguration x)
-> (forall x. Rep UpdateConfiguration x -> UpdateConfiguration)
-> Generic UpdateConfiguration
forall x. Rep UpdateConfiguration x -> UpdateConfiguration
forall x. UpdateConfiguration -> Rep UpdateConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateConfiguration x -> UpdateConfiguration
$cfrom :: forall x. UpdateConfiguration -> Rep UpdateConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConfiguration' 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:
--
-- 'description', 'updateConfiguration_description' - The description of the configuration.
--
-- 'configurationId', 'updateConfiguration_configurationId' - The unique ID that Amazon MQ generates for the configuration.
--
-- 'data'', 'updateConfiguration_data' - Required. The base64-encoded XML configuration.
newUpdateConfiguration ::
  -- | 'configurationId'
  Prelude.Text ->
  -- | 'data''
  Prelude.Text ->
  UpdateConfiguration
newUpdateConfiguration :: Text -> Text -> UpdateConfiguration
newUpdateConfiguration Text
pConfigurationId_ Text
pData_ =
  UpdateConfiguration' :: Maybe Text -> Text -> Text -> UpdateConfiguration
UpdateConfiguration'
    { $sel:description:UpdateConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationId:UpdateConfiguration' :: Text
configurationId = Text
pConfigurationId_,
      $sel:data':UpdateConfiguration' :: Text
data' = Text
pData_
    }

-- | The description of the configuration.
updateConfiguration_description :: Lens.Lens' UpdateConfiguration (Prelude.Maybe Prelude.Text)
updateConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> UpdateConfiguration -> f UpdateConfiguration
updateConfiguration_description = (UpdateConfiguration -> Maybe Text)
-> (UpdateConfiguration -> Maybe Text -> UpdateConfiguration)
-> Lens
     UpdateConfiguration UpdateConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:UpdateConfiguration' :: UpdateConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateConfiguration
s@UpdateConfiguration' {} Maybe Text
a -> UpdateConfiguration
s {$sel:description:UpdateConfiguration' :: Maybe Text
description = Maybe Text
a} :: UpdateConfiguration)

-- | The unique ID that Amazon MQ generates for the configuration.
updateConfiguration_configurationId :: Lens.Lens' UpdateConfiguration Prelude.Text
updateConfiguration_configurationId :: (Text -> f Text) -> UpdateConfiguration -> f UpdateConfiguration
updateConfiguration_configurationId = (UpdateConfiguration -> Text)
-> (UpdateConfiguration -> Text -> UpdateConfiguration)
-> Lens UpdateConfiguration UpdateConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfiguration' {Text
configurationId :: Text
$sel:configurationId:UpdateConfiguration' :: UpdateConfiguration -> Text
configurationId} -> Text
configurationId) (\s :: UpdateConfiguration
s@UpdateConfiguration' {} Text
a -> UpdateConfiguration
s {$sel:configurationId:UpdateConfiguration' :: Text
configurationId = Text
a} :: UpdateConfiguration)

-- | Required. The base64-encoded XML configuration.
updateConfiguration_data :: Lens.Lens' UpdateConfiguration Prelude.Text
updateConfiguration_data :: (Text -> f Text) -> UpdateConfiguration -> f UpdateConfiguration
updateConfiguration_data = (UpdateConfiguration -> Text)
-> (UpdateConfiguration -> Text -> UpdateConfiguration)
-> Lens UpdateConfiguration UpdateConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfiguration' {Text
data' :: Text
$sel:data':UpdateConfiguration' :: UpdateConfiguration -> Text
data'} -> Text
data') (\s :: UpdateConfiguration
s@UpdateConfiguration' {} Text
a -> UpdateConfiguration
s {$sel:data':UpdateConfiguration' :: Text
data' = Text
a} :: UpdateConfiguration)

instance Core.AWSRequest UpdateConfiguration where
  type
    AWSResponse UpdateConfiguration =
      UpdateConfigurationResponse
  request :: UpdateConfiguration -> Request UpdateConfiguration
request = Service -> UpdateConfiguration -> Request UpdateConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateConfiguration))
-> Logger
-> Service
-> Proxy UpdateConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe ConfigurationRevision
-> Maybe POSIX
-> Maybe [SanitizationWarning]
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateConfigurationResponse
UpdateConfigurationResponse'
            (Maybe Text
 -> Maybe ConfigurationRevision
 -> Maybe POSIX
 -> Maybe [SanitizationWarning]
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> UpdateConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ConfigurationRevision
      -> Maybe POSIX
      -> Maybe [SanitizationWarning]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"arn")
            Either
  String
  (Maybe ConfigurationRevision
   -> Maybe POSIX
   -> Maybe [SanitizationWarning]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateConfigurationResponse)
-> Either String (Maybe ConfigurationRevision)
-> Either
     String
     (Maybe POSIX
      -> Maybe [SanitizationWarning]
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> UpdateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ConfigurationRevision)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"latestRevision")
            Either
  String
  (Maybe POSIX
   -> Maybe [SanitizationWarning]
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> UpdateConfigurationResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe [SanitizationWarning]
      -> Maybe Text -> Maybe Text -> Int -> UpdateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"created")
            Either
  String
  (Maybe [SanitizationWarning]
   -> Maybe Text -> Maybe Text -> Int -> UpdateConfigurationResponse)
-> Either String (Maybe [SanitizationWarning])
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> UpdateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [SanitizationWarning]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"warnings" Either String (Maybe (Maybe [SanitizationWarning]))
-> Maybe [SanitizationWarning]
-> Either String (Maybe [SanitizationWarning])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SanitizationWarning]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> UpdateConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> UpdateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"name")
            Either String (Maybe Text -> Int -> UpdateConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"id")
            Either String (Int -> UpdateConfigurationResponse)
-> Either String Int -> Either String UpdateConfigurationResponse
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 UpdateConfiguration

instance Prelude.NFData UpdateConfiguration

instance Core.ToHeaders UpdateConfiguration where
  toHeaders :: UpdateConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateConfiguration -> 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 UpdateConfiguration where
  toJSON :: UpdateConfiguration -> Value
toJSON UpdateConfiguration' {Maybe Text
Text
data' :: Text
configurationId :: Text
description :: Maybe Text
$sel:data':UpdateConfiguration' :: UpdateConfiguration -> Text
$sel:configurationId:UpdateConfiguration' :: UpdateConfiguration -> Text
$sel:description:UpdateConfiguration' :: UpdateConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"data" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
data')
          ]
      )

instance Core.ToPath UpdateConfiguration where
  toPath :: UpdateConfiguration -> ByteString
toPath UpdateConfiguration' {Maybe Text
Text
data' :: Text
configurationId :: Text
description :: Maybe Text
$sel:data':UpdateConfiguration' :: UpdateConfiguration -> Text
$sel:configurationId:UpdateConfiguration' :: UpdateConfiguration -> Text
$sel:description:UpdateConfiguration' :: UpdateConfiguration -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/configurations/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configurationId]

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

-- | /See:/ 'newUpdateConfigurationResponse' smart constructor.
data UpdateConfigurationResponse = UpdateConfigurationResponse'
  { -- | Required. The Amazon Resource Name (ARN) of the configuration.
    UpdateConfigurationResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The latest revision of the configuration.
    UpdateConfigurationResponse -> Maybe ConfigurationRevision
latestRevision :: Prelude.Maybe ConfigurationRevision,
    -- | Required. The date and time of the configuration.
    UpdateConfigurationResponse -> Maybe POSIX
created :: Prelude.Maybe Core.POSIX,
    -- | The list of the first 20 warnings about the configuration XML elements
    -- or attributes that were sanitized.
    UpdateConfigurationResponse -> Maybe [SanitizationWarning]
warnings :: Prelude.Maybe [SanitizationWarning],
    -- | Required. The name of the configuration. This value can contain only
    -- alphanumeric characters, dashes, periods, underscores, and tildes (- . _
    -- ~). This value must be 1-150 characters long.
    UpdateConfigurationResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Required. The unique ID that Amazon MQ generates for the configuration.
    UpdateConfigurationResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateConfigurationResponse -> UpdateConfigurationResponse -> Bool
(UpdateConfigurationResponse
 -> UpdateConfigurationResponse -> Bool)
-> (UpdateConfigurationResponse
    -> UpdateConfigurationResponse -> Bool)
-> Eq UpdateConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateConfigurationResponse -> UpdateConfigurationResponse -> Bool
$c/= :: UpdateConfigurationResponse -> UpdateConfigurationResponse -> Bool
== :: UpdateConfigurationResponse -> UpdateConfigurationResponse -> Bool
$c== :: UpdateConfigurationResponse -> UpdateConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateConfigurationResponse]
ReadPrec UpdateConfigurationResponse
Int -> ReadS UpdateConfigurationResponse
ReadS [UpdateConfigurationResponse]
(Int -> ReadS UpdateConfigurationResponse)
-> ReadS [UpdateConfigurationResponse]
-> ReadPrec UpdateConfigurationResponse
-> ReadPrec [UpdateConfigurationResponse]
-> Read UpdateConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateConfigurationResponse]
readPrec :: ReadPrec UpdateConfigurationResponse
$creadPrec :: ReadPrec UpdateConfigurationResponse
readList :: ReadS [UpdateConfigurationResponse]
$creadList :: ReadS [UpdateConfigurationResponse]
readsPrec :: Int -> ReadS UpdateConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateConfigurationResponse
Prelude.Read, Int -> UpdateConfigurationResponse -> ShowS
[UpdateConfigurationResponse] -> ShowS
UpdateConfigurationResponse -> String
(Int -> UpdateConfigurationResponse -> ShowS)
-> (UpdateConfigurationResponse -> String)
-> ([UpdateConfigurationResponse] -> ShowS)
-> Show UpdateConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateConfigurationResponse] -> ShowS
$cshowList :: [UpdateConfigurationResponse] -> ShowS
show :: UpdateConfigurationResponse -> String
$cshow :: UpdateConfigurationResponse -> String
showsPrec :: Int -> UpdateConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 UpdateConfigurationResponse -> Rep UpdateConfigurationResponse x)
-> (forall x.
    Rep UpdateConfigurationResponse x -> UpdateConfigurationResponse)
-> Generic UpdateConfigurationResponse
forall x.
Rep UpdateConfigurationResponse x -> UpdateConfigurationResponse
forall x.
UpdateConfigurationResponse -> Rep UpdateConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateConfigurationResponse x -> UpdateConfigurationResponse
$cfrom :: forall x.
UpdateConfigurationResponse -> Rep UpdateConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateConfigurationResponse' 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:
--
-- 'arn', 'updateConfigurationResponse_arn' - Required. The Amazon Resource Name (ARN) of the configuration.
--
-- 'latestRevision', 'updateConfigurationResponse_latestRevision' - The latest revision of the configuration.
--
-- 'created', 'updateConfigurationResponse_created' - Required. The date and time of the configuration.
--
-- 'warnings', 'updateConfigurationResponse_warnings' - The list of the first 20 warnings about the configuration XML elements
-- or attributes that were sanitized.
--
-- 'name', 'updateConfigurationResponse_name' - Required. The name of the configuration. This value can contain only
-- alphanumeric characters, dashes, periods, underscores, and tildes (- . _
-- ~). This value must be 1-150 characters long.
--
-- 'id', 'updateConfigurationResponse_id' - Required. The unique ID that Amazon MQ generates for the configuration.
--
-- 'httpStatus', 'updateConfigurationResponse_httpStatus' - The response's http status code.
newUpdateConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateConfigurationResponse
newUpdateConfigurationResponse :: Int -> UpdateConfigurationResponse
newUpdateConfigurationResponse Int
pHttpStatus_ =
  UpdateConfigurationResponse' :: Maybe Text
-> Maybe ConfigurationRevision
-> Maybe POSIX
-> Maybe [SanitizationWarning]
-> Maybe Text
-> Maybe Text
-> Int
-> UpdateConfigurationResponse
UpdateConfigurationResponse'
    { $sel:arn:UpdateConfigurationResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:latestRevision:UpdateConfigurationResponse' :: Maybe ConfigurationRevision
latestRevision = Maybe ConfigurationRevision
forall a. Maybe a
Prelude.Nothing,
      $sel:created:UpdateConfigurationResponse' :: Maybe POSIX
created = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:UpdateConfigurationResponse' :: Maybe [SanitizationWarning]
warnings = Maybe [SanitizationWarning]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateConfigurationResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:UpdateConfigurationResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Required. The Amazon Resource Name (ARN) of the configuration.
updateConfigurationResponse_arn :: Lens.Lens' UpdateConfigurationResponse (Prelude.Maybe Prelude.Text)
updateConfigurationResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateConfigurationResponse -> f UpdateConfigurationResponse
updateConfigurationResponse_arn = (UpdateConfigurationResponse -> Maybe Text)
-> (UpdateConfigurationResponse
    -> Maybe Text -> UpdateConfigurationResponse)
-> Lens
     UpdateConfigurationResponse
     UpdateConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateConfigurationResponse' :: UpdateConfigurationResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateConfigurationResponse
s@UpdateConfigurationResponse' {} Maybe Text
a -> UpdateConfigurationResponse
s {$sel:arn:UpdateConfigurationResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateConfigurationResponse)

-- | The latest revision of the configuration.
updateConfigurationResponse_latestRevision :: Lens.Lens' UpdateConfigurationResponse (Prelude.Maybe ConfigurationRevision)
updateConfigurationResponse_latestRevision :: (Maybe ConfigurationRevision -> f (Maybe ConfigurationRevision))
-> UpdateConfigurationResponse -> f UpdateConfigurationResponse
updateConfigurationResponse_latestRevision = (UpdateConfigurationResponse -> Maybe ConfigurationRevision)
-> (UpdateConfigurationResponse
    -> Maybe ConfigurationRevision -> UpdateConfigurationResponse)
-> Lens
     UpdateConfigurationResponse
     UpdateConfigurationResponse
     (Maybe ConfigurationRevision)
     (Maybe ConfigurationRevision)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationResponse' {Maybe ConfigurationRevision
latestRevision :: Maybe ConfigurationRevision
$sel:latestRevision:UpdateConfigurationResponse' :: UpdateConfigurationResponse -> Maybe ConfigurationRevision
latestRevision} -> Maybe ConfigurationRevision
latestRevision) (\s :: UpdateConfigurationResponse
s@UpdateConfigurationResponse' {} Maybe ConfigurationRevision
a -> UpdateConfigurationResponse
s {$sel:latestRevision:UpdateConfigurationResponse' :: Maybe ConfigurationRevision
latestRevision = Maybe ConfigurationRevision
a} :: UpdateConfigurationResponse)

-- | Required. The date and time of the configuration.
updateConfigurationResponse_created :: Lens.Lens' UpdateConfigurationResponse (Prelude.Maybe Prelude.UTCTime)
updateConfigurationResponse_created :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConfigurationResponse -> f UpdateConfigurationResponse
updateConfigurationResponse_created = (UpdateConfigurationResponse -> Maybe POSIX)
-> (UpdateConfigurationResponse
    -> Maybe POSIX -> UpdateConfigurationResponse)
-> Lens
     UpdateConfigurationResponse
     UpdateConfigurationResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationResponse' {Maybe POSIX
created :: Maybe POSIX
$sel:created:UpdateConfigurationResponse' :: UpdateConfigurationResponse -> Maybe POSIX
created} -> Maybe POSIX
created) (\s :: UpdateConfigurationResponse
s@UpdateConfigurationResponse' {} Maybe POSIX
a -> UpdateConfigurationResponse
s {$sel:created:UpdateConfigurationResponse' :: Maybe POSIX
created = Maybe POSIX
a} :: UpdateConfigurationResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateConfigurationResponse -> f UpdateConfigurationResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateConfigurationResponse
-> f UpdateConfigurationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The list of the first 20 warnings about the configuration XML elements
-- or attributes that were sanitized.
updateConfigurationResponse_warnings :: Lens.Lens' UpdateConfigurationResponse (Prelude.Maybe [SanitizationWarning])
updateConfigurationResponse_warnings :: (Maybe [SanitizationWarning] -> f (Maybe [SanitizationWarning]))
-> UpdateConfigurationResponse -> f UpdateConfigurationResponse
updateConfigurationResponse_warnings = (UpdateConfigurationResponse -> Maybe [SanitizationWarning])
-> (UpdateConfigurationResponse
    -> Maybe [SanitizationWarning] -> UpdateConfigurationResponse)
-> Lens
     UpdateConfigurationResponse
     UpdateConfigurationResponse
     (Maybe [SanitizationWarning])
     (Maybe [SanitizationWarning])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationResponse' {Maybe [SanitizationWarning]
warnings :: Maybe [SanitizationWarning]
$sel:warnings:UpdateConfigurationResponse' :: UpdateConfigurationResponse -> Maybe [SanitizationWarning]
warnings} -> Maybe [SanitizationWarning]
warnings) (\s :: UpdateConfigurationResponse
s@UpdateConfigurationResponse' {} Maybe [SanitizationWarning]
a -> UpdateConfigurationResponse
s {$sel:warnings:UpdateConfigurationResponse' :: Maybe [SanitizationWarning]
warnings = Maybe [SanitizationWarning]
a} :: UpdateConfigurationResponse) ((Maybe [SanitizationWarning] -> f (Maybe [SanitizationWarning]))
 -> UpdateConfigurationResponse -> f UpdateConfigurationResponse)
-> ((Maybe [SanitizationWarning]
     -> f (Maybe [SanitizationWarning]))
    -> Maybe [SanitizationWarning] -> f (Maybe [SanitizationWarning]))
-> (Maybe [SanitizationWarning] -> f (Maybe [SanitizationWarning]))
-> UpdateConfigurationResponse
-> f UpdateConfigurationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SanitizationWarning]
  [SanitizationWarning]
  [SanitizationWarning]
  [SanitizationWarning]
-> Iso
     (Maybe [SanitizationWarning])
     (Maybe [SanitizationWarning])
     (Maybe [SanitizationWarning])
     (Maybe [SanitizationWarning])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [SanitizationWarning]
  [SanitizationWarning]
  [SanitizationWarning]
  [SanitizationWarning]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Required. The name of the configuration. This value can contain only
-- alphanumeric characters, dashes, periods, underscores, and tildes (- . _
-- ~). This value must be 1-150 characters long.
updateConfigurationResponse_name :: Lens.Lens' UpdateConfigurationResponse (Prelude.Maybe Prelude.Text)
updateConfigurationResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateConfigurationResponse -> f UpdateConfigurationResponse
updateConfigurationResponse_name = (UpdateConfigurationResponse -> Maybe Text)
-> (UpdateConfigurationResponse
    -> Maybe Text -> UpdateConfigurationResponse)
-> Lens
     UpdateConfigurationResponse
     UpdateConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateConfigurationResponse' :: UpdateConfigurationResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateConfigurationResponse
s@UpdateConfigurationResponse' {} Maybe Text
a -> UpdateConfigurationResponse
s {$sel:name:UpdateConfigurationResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateConfigurationResponse)

-- | Required. The unique ID that Amazon MQ generates for the configuration.
updateConfigurationResponse_id :: Lens.Lens' UpdateConfigurationResponse (Prelude.Maybe Prelude.Text)
updateConfigurationResponse_id :: (Maybe Text -> f (Maybe Text))
-> UpdateConfigurationResponse -> f UpdateConfigurationResponse
updateConfigurationResponse_id = (UpdateConfigurationResponse -> Maybe Text)
-> (UpdateConfigurationResponse
    -> Maybe Text -> UpdateConfigurationResponse)
-> Lens
     UpdateConfigurationResponse
     UpdateConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateConfigurationResponse' {Maybe Text
id :: Maybe Text
$sel:id:UpdateConfigurationResponse' :: UpdateConfigurationResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: UpdateConfigurationResponse
s@UpdateConfigurationResponse' {} Maybe Text
a -> UpdateConfigurationResponse
s {$sel:id:UpdateConfigurationResponse' :: Maybe Text
id = Maybe Text
a} :: UpdateConfigurationResponse)

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

instance Prelude.NFData UpdateConfigurationResponse