{-# 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.Schemas.UpdateDiscoverer
-- 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 discoverer
module Amazonka.Schemas.UpdateDiscoverer
  ( -- * Creating a Request
    UpdateDiscoverer (..),
    newUpdateDiscoverer,

    -- * Request Lenses
    updateDiscoverer_crossAccount,
    updateDiscoverer_description,
    updateDiscoverer_discovererId,

    -- * Destructuring the Response
    UpdateDiscovererResponse (..),
    newUpdateDiscovererResponse,

    -- * Response Lenses
    updateDiscovererResponse_state,
    updateDiscovererResponse_crossAccount,
    updateDiscovererResponse_sourceArn,
    updateDiscovererResponse_discovererId,
    updateDiscovererResponse_description,
    updateDiscovererResponse_tags,
    updateDiscovererResponse_discovererArn,
    updateDiscovererResponse_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.Schemas.Types

-- | /See:/ 'newUpdateDiscoverer' smart constructor.
data UpdateDiscoverer = UpdateDiscoverer'
  { -- | Support discovery of schemas in events sent to the bus from another
    -- account. (default: true)
    UpdateDiscoverer -> Maybe Bool
crossAccount :: Prelude.Maybe Prelude.Bool,
    -- | The description of the discoverer to update.
    UpdateDiscoverer -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the discoverer.
    UpdateDiscoverer -> Text
discovererId :: Prelude.Text
  }
  deriving (UpdateDiscoverer -> UpdateDiscoverer -> Bool
(UpdateDiscoverer -> UpdateDiscoverer -> Bool)
-> (UpdateDiscoverer -> UpdateDiscoverer -> Bool)
-> Eq UpdateDiscoverer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDiscoverer -> UpdateDiscoverer -> Bool
$c/= :: UpdateDiscoverer -> UpdateDiscoverer -> Bool
== :: UpdateDiscoverer -> UpdateDiscoverer -> Bool
$c== :: UpdateDiscoverer -> UpdateDiscoverer -> Bool
Prelude.Eq, ReadPrec [UpdateDiscoverer]
ReadPrec UpdateDiscoverer
Int -> ReadS UpdateDiscoverer
ReadS [UpdateDiscoverer]
(Int -> ReadS UpdateDiscoverer)
-> ReadS [UpdateDiscoverer]
-> ReadPrec UpdateDiscoverer
-> ReadPrec [UpdateDiscoverer]
-> Read UpdateDiscoverer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDiscoverer]
$creadListPrec :: ReadPrec [UpdateDiscoverer]
readPrec :: ReadPrec UpdateDiscoverer
$creadPrec :: ReadPrec UpdateDiscoverer
readList :: ReadS [UpdateDiscoverer]
$creadList :: ReadS [UpdateDiscoverer]
readsPrec :: Int -> ReadS UpdateDiscoverer
$creadsPrec :: Int -> ReadS UpdateDiscoverer
Prelude.Read, Int -> UpdateDiscoverer -> ShowS
[UpdateDiscoverer] -> ShowS
UpdateDiscoverer -> String
(Int -> UpdateDiscoverer -> ShowS)
-> (UpdateDiscoverer -> String)
-> ([UpdateDiscoverer] -> ShowS)
-> Show UpdateDiscoverer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDiscoverer] -> ShowS
$cshowList :: [UpdateDiscoverer] -> ShowS
show :: UpdateDiscoverer -> String
$cshow :: UpdateDiscoverer -> String
showsPrec :: Int -> UpdateDiscoverer -> ShowS
$cshowsPrec :: Int -> UpdateDiscoverer -> ShowS
Prelude.Show, (forall x. UpdateDiscoverer -> Rep UpdateDiscoverer x)
-> (forall x. Rep UpdateDiscoverer x -> UpdateDiscoverer)
-> Generic UpdateDiscoverer
forall x. Rep UpdateDiscoverer x -> UpdateDiscoverer
forall x. UpdateDiscoverer -> Rep UpdateDiscoverer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDiscoverer x -> UpdateDiscoverer
$cfrom :: forall x. UpdateDiscoverer -> Rep UpdateDiscoverer x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDiscoverer' 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:
--
-- 'crossAccount', 'updateDiscoverer_crossAccount' - Support discovery of schemas in events sent to the bus from another
-- account. (default: true)
--
-- 'description', 'updateDiscoverer_description' - The description of the discoverer to update.
--
-- 'discovererId', 'updateDiscoverer_discovererId' - The ID of the discoverer.
newUpdateDiscoverer ::
  -- | 'discovererId'
  Prelude.Text ->
  UpdateDiscoverer
newUpdateDiscoverer :: Text -> UpdateDiscoverer
newUpdateDiscoverer Text
pDiscovererId_ =
  UpdateDiscoverer' :: Maybe Bool -> Maybe Text -> Text -> UpdateDiscoverer
UpdateDiscoverer'
    { $sel:crossAccount:UpdateDiscoverer' :: Maybe Bool
crossAccount = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateDiscoverer' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:discovererId:UpdateDiscoverer' :: Text
discovererId = Text
pDiscovererId_
    }

-- | Support discovery of schemas in events sent to the bus from another
-- account. (default: true)
updateDiscoverer_crossAccount :: Lens.Lens' UpdateDiscoverer (Prelude.Maybe Prelude.Bool)
updateDiscoverer_crossAccount :: (Maybe Bool -> f (Maybe Bool))
-> UpdateDiscoverer -> f UpdateDiscoverer
updateDiscoverer_crossAccount = (UpdateDiscoverer -> Maybe Bool)
-> (UpdateDiscoverer -> Maybe Bool -> UpdateDiscoverer)
-> Lens UpdateDiscoverer UpdateDiscoverer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscoverer' {Maybe Bool
crossAccount :: Maybe Bool
$sel:crossAccount:UpdateDiscoverer' :: UpdateDiscoverer -> Maybe Bool
crossAccount} -> Maybe Bool
crossAccount) (\s :: UpdateDiscoverer
s@UpdateDiscoverer' {} Maybe Bool
a -> UpdateDiscoverer
s {$sel:crossAccount:UpdateDiscoverer' :: Maybe Bool
crossAccount = Maybe Bool
a} :: UpdateDiscoverer)

-- | The description of the discoverer to update.
updateDiscoverer_description :: Lens.Lens' UpdateDiscoverer (Prelude.Maybe Prelude.Text)
updateDiscoverer_description :: (Maybe Text -> f (Maybe Text))
-> UpdateDiscoverer -> f UpdateDiscoverer
updateDiscoverer_description = (UpdateDiscoverer -> Maybe Text)
-> (UpdateDiscoverer -> Maybe Text -> UpdateDiscoverer)
-> Lens UpdateDiscoverer UpdateDiscoverer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscoverer' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDiscoverer' :: UpdateDiscoverer -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDiscoverer
s@UpdateDiscoverer' {} Maybe Text
a -> UpdateDiscoverer
s {$sel:description:UpdateDiscoverer' :: Maybe Text
description = Maybe Text
a} :: UpdateDiscoverer)

-- | The ID of the discoverer.
updateDiscoverer_discovererId :: Lens.Lens' UpdateDiscoverer Prelude.Text
updateDiscoverer_discovererId :: (Text -> f Text) -> UpdateDiscoverer -> f UpdateDiscoverer
updateDiscoverer_discovererId = (UpdateDiscoverer -> Text)
-> (UpdateDiscoverer -> Text -> UpdateDiscoverer)
-> Lens UpdateDiscoverer UpdateDiscoverer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscoverer' {Text
discovererId :: Text
$sel:discovererId:UpdateDiscoverer' :: UpdateDiscoverer -> Text
discovererId} -> Text
discovererId) (\s :: UpdateDiscoverer
s@UpdateDiscoverer' {} Text
a -> UpdateDiscoverer
s {$sel:discovererId:UpdateDiscoverer' :: Text
discovererId = Text
a} :: UpdateDiscoverer)

instance Core.AWSRequest UpdateDiscoverer where
  type
    AWSResponse UpdateDiscoverer =
      UpdateDiscovererResponse
  request :: UpdateDiscoverer -> Request UpdateDiscoverer
request = Service -> UpdateDiscoverer -> Request UpdateDiscoverer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDiscoverer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateDiscoverer))
-> Logger
-> Service
-> Proxy UpdateDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDiscoverer)))
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 DiscovererState
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Int
-> UpdateDiscovererResponse
UpdateDiscovererResponse'
            (Maybe DiscovererState
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Int
 -> UpdateDiscovererResponse)
-> Either String (Maybe DiscovererState)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> UpdateDiscovererResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe DiscovererState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"State")
            Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Int
   -> UpdateDiscovererResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> UpdateDiscovererResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CrossAccount")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Int
   -> UpdateDiscovererResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> UpdateDiscovererResponse)
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
"SourceArn")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Int
   -> UpdateDiscovererResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> UpdateDiscovererResponse)
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
"DiscovererId")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Maybe Text
   -> Int
   -> UpdateDiscovererResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Text -> Int -> UpdateDiscovererResponse)
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
"Description")
            Either
  String
  (Maybe (HashMap Text Text)
   -> Maybe Text -> Int -> UpdateDiscovererResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Maybe Text -> Int -> UpdateDiscovererResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> UpdateDiscovererResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateDiscovererResponse)
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
"DiscovererArn")
            Either String (Int -> UpdateDiscovererResponse)
-> Either String Int -> Either String UpdateDiscovererResponse
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 UpdateDiscoverer

instance Prelude.NFData UpdateDiscoverer

instance Core.ToHeaders UpdateDiscoverer where
  toHeaders :: UpdateDiscoverer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateDiscoverer -> 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 UpdateDiscoverer where
  toJSON :: UpdateDiscoverer -> Value
toJSON UpdateDiscoverer' {Maybe Bool
Maybe Text
Text
discovererId :: Text
description :: Maybe Text
crossAccount :: Maybe Bool
$sel:discovererId:UpdateDiscoverer' :: UpdateDiscoverer -> Text
$sel:description:UpdateDiscoverer' :: UpdateDiscoverer -> Maybe Text
$sel:crossAccount:UpdateDiscoverer' :: UpdateDiscoverer -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CrossAccount" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
crossAccount,
            (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
          ]
      )

instance Core.ToPath UpdateDiscoverer where
  toPath :: UpdateDiscoverer -> ByteString
toPath UpdateDiscoverer' {Maybe Bool
Maybe Text
Text
discovererId :: Text
description :: Maybe Text
crossAccount :: Maybe Bool
$sel:discovererId:UpdateDiscoverer' :: UpdateDiscoverer -> Text
$sel:description:UpdateDiscoverer' :: UpdateDiscoverer -> Maybe Text
$sel:crossAccount:UpdateDiscoverer' :: UpdateDiscoverer -> Maybe Bool
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/v1/discoverers/id/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
discovererId]

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

-- | /See:/ 'newUpdateDiscovererResponse' smart constructor.
data UpdateDiscovererResponse = UpdateDiscovererResponse'
  { -- | The state of the discoverer.
    UpdateDiscovererResponse -> Maybe DiscovererState
state :: Prelude.Maybe DiscovererState,
    -- | The Status if the discoverer will discover schemas from events sent from
    -- another account.
    UpdateDiscovererResponse -> Maybe Bool
crossAccount :: Prelude.Maybe Prelude.Bool,
    -- | The ARN of the event bus.
    UpdateDiscovererResponse -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the discoverer.
    UpdateDiscovererResponse -> Maybe Text
discovererId :: Prelude.Maybe Prelude.Text,
    -- | The description of the discoverer.
    UpdateDiscovererResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Tags associated with the resource.
    UpdateDiscovererResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ARN of the discoverer.
    UpdateDiscovererResponse -> Maybe Text
discovererArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateDiscovererResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool
(UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool)
-> (UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool)
-> Eq UpdateDiscovererResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool
$c/= :: UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool
== :: UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool
$c== :: UpdateDiscovererResponse -> UpdateDiscovererResponse -> Bool
Prelude.Eq, ReadPrec [UpdateDiscovererResponse]
ReadPrec UpdateDiscovererResponse
Int -> ReadS UpdateDiscovererResponse
ReadS [UpdateDiscovererResponse]
(Int -> ReadS UpdateDiscovererResponse)
-> ReadS [UpdateDiscovererResponse]
-> ReadPrec UpdateDiscovererResponse
-> ReadPrec [UpdateDiscovererResponse]
-> Read UpdateDiscovererResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateDiscovererResponse]
$creadListPrec :: ReadPrec [UpdateDiscovererResponse]
readPrec :: ReadPrec UpdateDiscovererResponse
$creadPrec :: ReadPrec UpdateDiscovererResponse
readList :: ReadS [UpdateDiscovererResponse]
$creadList :: ReadS [UpdateDiscovererResponse]
readsPrec :: Int -> ReadS UpdateDiscovererResponse
$creadsPrec :: Int -> ReadS UpdateDiscovererResponse
Prelude.Read, Int -> UpdateDiscovererResponse -> ShowS
[UpdateDiscovererResponse] -> ShowS
UpdateDiscovererResponse -> String
(Int -> UpdateDiscovererResponse -> ShowS)
-> (UpdateDiscovererResponse -> String)
-> ([UpdateDiscovererResponse] -> ShowS)
-> Show UpdateDiscovererResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDiscovererResponse] -> ShowS
$cshowList :: [UpdateDiscovererResponse] -> ShowS
show :: UpdateDiscovererResponse -> String
$cshow :: UpdateDiscovererResponse -> String
showsPrec :: Int -> UpdateDiscovererResponse -> ShowS
$cshowsPrec :: Int -> UpdateDiscovererResponse -> ShowS
Prelude.Show, (forall x.
 UpdateDiscovererResponse -> Rep UpdateDiscovererResponse x)
-> (forall x.
    Rep UpdateDiscovererResponse x -> UpdateDiscovererResponse)
-> Generic UpdateDiscovererResponse
forall x.
Rep UpdateDiscovererResponse x -> UpdateDiscovererResponse
forall x.
UpdateDiscovererResponse -> Rep UpdateDiscovererResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateDiscovererResponse x -> UpdateDiscovererResponse
$cfrom :: forall x.
UpdateDiscovererResponse -> Rep UpdateDiscovererResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDiscovererResponse' 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:
--
-- 'state', 'updateDiscovererResponse_state' - The state of the discoverer.
--
-- 'crossAccount', 'updateDiscovererResponse_crossAccount' - The Status if the discoverer will discover schemas from events sent from
-- another account.
--
-- 'sourceArn', 'updateDiscovererResponse_sourceArn' - The ARN of the event bus.
--
-- 'discovererId', 'updateDiscovererResponse_discovererId' - The ID of the discoverer.
--
-- 'description', 'updateDiscovererResponse_description' - The description of the discoverer.
--
-- 'tags', 'updateDiscovererResponse_tags' - Tags associated with the resource.
--
-- 'discovererArn', 'updateDiscovererResponse_discovererArn' - The ARN of the discoverer.
--
-- 'httpStatus', 'updateDiscovererResponse_httpStatus' - The response's http status code.
newUpdateDiscovererResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateDiscovererResponse
newUpdateDiscovererResponse :: Int -> UpdateDiscovererResponse
newUpdateDiscovererResponse Int
pHttpStatus_ =
  UpdateDiscovererResponse' :: Maybe DiscovererState
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Int
-> UpdateDiscovererResponse
UpdateDiscovererResponse'
    { $sel:state:UpdateDiscovererResponse' :: Maybe DiscovererState
state = Maybe DiscovererState
forall a. Maybe a
Prelude.Nothing,
      $sel:crossAccount:UpdateDiscovererResponse' :: Maybe Bool
crossAccount = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:UpdateDiscovererResponse' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:discovererId:UpdateDiscovererResponse' :: Maybe Text
discovererId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateDiscovererResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:UpdateDiscovererResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:discovererArn:UpdateDiscovererResponse' :: Maybe Text
discovererArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateDiscovererResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The state of the discoverer.
updateDiscovererResponse_state :: Lens.Lens' UpdateDiscovererResponse (Prelude.Maybe DiscovererState)
updateDiscovererResponse_state :: (Maybe DiscovererState -> f (Maybe DiscovererState))
-> UpdateDiscovererResponse -> f UpdateDiscovererResponse
updateDiscovererResponse_state = (UpdateDiscovererResponse -> Maybe DiscovererState)
-> (UpdateDiscovererResponse
    -> Maybe DiscovererState -> UpdateDiscovererResponse)
-> Lens
     UpdateDiscovererResponse
     UpdateDiscovererResponse
     (Maybe DiscovererState)
     (Maybe DiscovererState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscovererResponse' {Maybe DiscovererState
state :: Maybe DiscovererState
$sel:state:UpdateDiscovererResponse' :: UpdateDiscovererResponse -> Maybe DiscovererState
state} -> Maybe DiscovererState
state) (\s :: UpdateDiscovererResponse
s@UpdateDiscovererResponse' {} Maybe DiscovererState
a -> UpdateDiscovererResponse
s {$sel:state:UpdateDiscovererResponse' :: Maybe DiscovererState
state = Maybe DiscovererState
a} :: UpdateDiscovererResponse)

-- | The Status if the discoverer will discover schemas from events sent from
-- another account.
updateDiscovererResponse_crossAccount :: Lens.Lens' UpdateDiscovererResponse (Prelude.Maybe Prelude.Bool)
updateDiscovererResponse_crossAccount :: (Maybe Bool -> f (Maybe Bool))
-> UpdateDiscovererResponse -> f UpdateDiscovererResponse
updateDiscovererResponse_crossAccount = (UpdateDiscovererResponse -> Maybe Bool)
-> (UpdateDiscovererResponse
    -> Maybe Bool -> UpdateDiscovererResponse)
-> Lens
     UpdateDiscovererResponse
     UpdateDiscovererResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscovererResponse' {Maybe Bool
crossAccount :: Maybe Bool
$sel:crossAccount:UpdateDiscovererResponse' :: UpdateDiscovererResponse -> Maybe Bool
crossAccount} -> Maybe Bool
crossAccount) (\s :: UpdateDiscovererResponse
s@UpdateDiscovererResponse' {} Maybe Bool
a -> UpdateDiscovererResponse
s {$sel:crossAccount:UpdateDiscovererResponse' :: Maybe Bool
crossAccount = Maybe Bool
a} :: UpdateDiscovererResponse)

-- | The ARN of the event bus.
updateDiscovererResponse_sourceArn :: Lens.Lens' UpdateDiscovererResponse (Prelude.Maybe Prelude.Text)
updateDiscovererResponse_sourceArn :: (Maybe Text -> f (Maybe Text))
-> UpdateDiscovererResponse -> f UpdateDiscovererResponse
updateDiscovererResponse_sourceArn = (UpdateDiscovererResponse -> Maybe Text)
-> (UpdateDiscovererResponse
    -> Maybe Text -> UpdateDiscovererResponse)
-> Lens
     UpdateDiscovererResponse
     UpdateDiscovererResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscovererResponse' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:UpdateDiscovererResponse' :: UpdateDiscovererResponse -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: UpdateDiscovererResponse
s@UpdateDiscovererResponse' {} Maybe Text
a -> UpdateDiscovererResponse
s {$sel:sourceArn:UpdateDiscovererResponse' :: Maybe Text
sourceArn = Maybe Text
a} :: UpdateDiscovererResponse)

-- | The ID of the discoverer.
updateDiscovererResponse_discovererId :: Lens.Lens' UpdateDiscovererResponse (Prelude.Maybe Prelude.Text)
updateDiscovererResponse_discovererId :: (Maybe Text -> f (Maybe Text))
-> UpdateDiscovererResponse -> f UpdateDiscovererResponse
updateDiscovererResponse_discovererId = (UpdateDiscovererResponse -> Maybe Text)
-> (UpdateDiscovererResponse
    -> Maybe Text -> UpdateDiscovererResponse)
-> Lens
     UpdateDiscovererResponse
     UpdateDiscovererResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscovererResponse' {Maybe Text
discovererId :: Maybe Text
$sel:discovererId:UpdateDiscovererResponse' :: UpdateDiscovererResponse -> Maybe Text
discovererId} -> Maybe Text
discovererId) (\s :: UpdateDiscovererResponse
s@UpdateDiscovererResponse' {} Maybe Text
a -> UpdateDiscovererResponse
s {$sel:discovererId:UpdateDiscovererResponse' :: Maybe Text
discovererId = Maybe Text
a} :: UpdateDiscovererResponse)

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

-- | Tags associated with the resource.
updateDiscovererResponse_tags :: Lens.Lens' UpdateDiscovererResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateDiscovererResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateDiscovererResponse -> f UpdateDiscovererResponse
updateDiscovererResponse_tags = (UpdateDiscovererResponse -> Maybe (HashMap Text Text))
-> (UpdateDiscovererResponse
    -> Maybe (HashMap Text Text) -> UpdateDiscovererResponse)
-> Lens
     UpdateDiscovererResponse
     UpdateDiscovererResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscovererResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:UpdateDiscovererResponse' :: UpdateDiscovererResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: UpdateDiscovererResponse
s@UpdateDiscovererResponse' {} Maybe (HashMap Text Text)
a -> UpdateDiscovererResponse
s {$sel:tags:UpdateDiscovererResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: UpdateDiscovererResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> UpdateDiscovererResponse -> f UpdateDiscovererResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> UpdateDiscovererResponse
-> f UpdateDiscovererResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the discoverer.
updateDiscovererResponse_discovererArn :: Lens.Lens' UpdateDiscovererResponse (Prelude.Maybe Prelude.Text)
updateDiscovererResponse_discovererArn :: (Maybe Text -> f (Maybe Text))
-> UpdateDiscovererResponse -> f UpdateDiscovererResponse
updateDiscovererResponse_discovererArn = (UpdateDiscovererResponse -> Maybe Text)
-> (UpdateDiscovererResponse
    -> Maybe Text -> UpdateDiscovererResponse)
-> Lens
     UpdateDiscovererResponse
     UpdateDiscovererResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDiscovererResponse' {Maybe Text
discovererArn :: Maybe Text
$sel:discovererArn:UpdateDiscovererResponse' :: UpdateDiscovererResponse -> Maybe Text
discovererArn} -> Maybe Text
discovererArn) (\s :: UpdateDiscovererResponse
s@UpdateDiscovererResponse' {} Maybe Text
a -> UpdateDiscovererResponse
s {$sel:discovererArn:UpdateDiscovererResponse' :: Maybe Text
discovererArn = Maybe Text
a} :: UpdateDiscovererResponse)

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

instance Prelude.NFData UpdateDiscovererResponse