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

    -- * Request Lenses
    createDiscoverer_crossAccount,
    createDiscoverer_description,
    createDiscoverer_tags,
    createDiscoverer_sourceArn,

    -- * Destructuring the Response
    CreateDiscovererResponse (..),
    newCreateDiscovererResponse,

    -- * Response Lenses
    createDiscovererResponse_state,
    createDiscovererResponse_crossAccount,
    createDiscovererResponse_sourceArn,
    createDiscovererResponse_discovererId,
    createDiscovererResponse_description,
    createDiscovererResponse_tags,
    createDiscovererResponse_discovererArn,
    createDiscovererResponse_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:/ 'newCreateDiscoverer' smart constructor.
data CreateDiscoverer = CreateDiscoverer'
  { -- | Support discovery of schemas in events sent to the bus from another
    -- account. (default: true).
    CreateDiscoverer -> Maybe Bool
crossAccount :: Prelude.Maybe Prelude.Bool,
    -- | A description for the discoverer.
    CreateDiscoverer -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Tags associated with the resource.
    CreateDiscoverer -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The ARN of the event bus.
    CreateDiscoverer -> Text
sourceArn :: Prelude.Text
  }
  deriving (CreateDiscoverer -> CreateDiscoverer -> Bool
(CreateDiscoverer -> CreateDiscoverer -> Bool)
-> (CreateDiscoverer -> CreateDiscoverer -> Bool)
-> Eq CreateDiscoverer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDiscoverer -> CreateDiscoverer -> Bool
$c/= :: CreateDiscoverer -> CreateDiscoverer -> Bool
== :: CreateDiscoverer -> CreateDiscoverer -> Bool
$c== :: CreateDiscoverer -> CreateDiscoverer -> Bool
Prelude.Eq, ReadPrec [CreateDiscoverer]
ReadPrec CreateDiscoverer
Int -> ReadS CreateDiscoverer
ReadS [CreateDiscoverer]
(Int -> ReadS CreateDiscoverer)
-> ReadS [CreateDiscoverer]
-> ReadPrec CreateDiscoverer
-> ReadPrec [CreateDiscoverer]
-> Read CreateDiscoverer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDiscoverer]
$creadListPrec :: ReadPrec [CreateDiscoverer]
readPrec :: ReadPrec CreateDiscoverer
$creadPrec :: ReadPrec CreateDiscoverer
readList :: ReadS [CreateDiscoverer]
$creadList :: ReadS [CreateDiscoverer]
readsPrec :: Int -> ReadS CreateDiscoverer
$creadsPrec :: Int -> ReadS CreateDiscoverer
Prelude.Read, Int -> CreateDiscoverer -> ShowS
[CreateDiscoverer] -> ShowS
CreateDiscoverer -> String
(Int -> CreateDiscoverer -> ShowS)
-> (CreateDiscoverer -> String)
-> ([CreateDiscoverer] -> ShowS)
-> Show CreateDiscoverer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDiscoverer] -> ShowS
$cshowList :: [CreateDiscoverer] -> ShowS
show :: CreateDiscoverer -> String
$cshow :: CreateDiscoverer -> String
showsPrec :: Int -> CreateDiscoverer -> ShowS
$cshowsPrec :: Int -> CreateDiscoverer -> ShowS
Prelude.Show, (forall x. CreateDiscoverer -> Rep CreateDiscoverer x)
-> (forall x. Rep CreateDiscoverer x -> CreateDiscoverer)
-> Generic CreateDiscoverer
forall x. Rep CreateDiscoverer x -> CreateDiscoverer
forall x. CreateDiscoverer -> Rep CreateDiscoverer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDiscoverer x -> CreateDiscoverer
$cfrom :: forall x. CreateDiscoverer -> Rep CreateDiscoverer x
Prelude.Generic)

-- |
-- Create a value of 'CreateDiscoverer' 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', 'createDiscoverer_crossAccount' - Support discovery of schemas in events sent to the bus from another
-- account. (default: true).
--
-- 'description', 'createDiscoverer_description' - A description for the discoverer.
--
-- 'tags', 'createDiscoverer_tags' - Tags associated with the resource.
--
-- 'sourceArn', 'createDiscoverer_sourceArn' - The ARN of the event bus.
newCreateDiscoverer ::
  -- | 'sourceArn'
  Prelude.Text ->
  CreateDiscoverer
newCreateDiscoverer :: Text -> CreateDiscoverer
newCreateDiscoverer Text
pSourceArn_ =
  CreateDiscoverer' :: Maybe Bool
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> CreateDiscoverer
CreateDiscoverer'
    { $sel:crossAccount:CreateDiscoverer' :: Maybe Bool
crossAccount = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateDiscoverer' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateDiscoverer' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:CreateDiscoverer' :: Text
sourceArn = Text
pSourceArn_
    }

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

-- | A description for the discoverer.
createDiscoverer_description :: Lens.Lens' CreateDiscoverer (Prelude.Maybe Prelude.Text)
createDiscoverer_description :: (Maybe Text -> f (Maybe Text))
-> CreateDiscoverer -> f CreateDiscoverer
createDiscoverer_description = (CreateDiscoverer -> Maybe Text)
-> (CreateDiscoverer -> Maybe Text -> CreateDiscoverer)
-> Lens CreateDiscoverer CreateDiscoverer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiscoverer' {Maybe Text
description :: Maybe Text
$sel:description:CreateDiscoverer' :: CreateDiscoverer -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateDiscoverer
s@CreateDiscoverer' {} Maybe Text
a -> CreateDiscoverer
s {$sel:description:CreateDiscoverer' :: Maybe Text
description = Maybe Text
a} :: CreateDiscoverer)

-- | Tags associated with the resource.
createDiscoverer_tags :: Lens.Lens' CreateDiscoverer (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDiscoverer_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDiscoverer -> f CreateDiscoverer
createDiscoverer_tags = (CreateDiscoverer -> Maybe (HashMap Text Text))
-> (CreateDiscoverer
    -> Maybe (HashMap Text Text) -> CreateDiscoverer)
-> Lens
     CreateDiscoverer
     CreateDiscoverer
     (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 (\CreateDiscoverer' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDiscoverer' :: CreateDiscoverer -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDiscoverer
s@CreateDiscoverer' {} Maybe (HashMap Text Text)
a -> CreateDiscoverer
s {$sel:tags:CreateDiscoverer' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDiscoverer) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateDiscoverer -> f CreateDiscoverer)
-> ((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)))
-> CreateDiscoverer
-> f CreateDiscoverer
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 event bus.
createDiscoverer_sourceArn :: Lens.Lens' CreateDiscoverer Prelude.Text
createDiscoverer_sourceArn :: (Text -> f Text) -> CreateDiscoverer -> f CreateDiscoverer
createDiscoverer_sourceArn = (CreateDiscoverer -> Text)
-> (CreateDiscoverer -> Text -> CreateDiscoverer)
-> Lens CreateDiscoverer CreateDiscoverer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiscoverer' {Text
sourceArn :: Text
$sel:sourceArn:CreateDiscoverer' :: CreateDiscoverer -> Text
sourceArn} -> Text
sourceArn) (\s :: CreateDiscoverer
s@CreateDiscoverer' {} Text
a -> CreateDiscoverer
s {$sel:sourceArn:CreateDiscoverer' :: Text
sourceArn = Text
a} :: CreateDiscoverer)

instance Core.AWSRequest CreateDiscoverer where
  type
    AWSResponse CreateDiscoverer =
      CreateDiscovererResponse
  request :: CreateDiscoverer -> Request CreateDiscoverer
request = Service -> CreateDiscoverer -> Request CreateDiscoverer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDiscoverer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDiscoverer))
-> Logger
-> Service
-> Proxy CreateDiscoverer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateDiscoverer)))
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
-> CreateDiscovererResponse
CreateDiscovererResponse'
            (Maybe DiscovererState
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Maybe Text
 -> Int
 -> CreateDiscovererResponse)
-> Either String (Maybe DiscovererState)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> CreateDiscovererResponse)
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
   -> CreateDiscovererResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> CreateDiscovererResponse)
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
   -> CreateDiscovererResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> CreateDiscovererResponse)
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
   -> CreateDiscovererResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Maybe Text
      -> Int
      -> CreateDiscovererResponse)
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
   -> CreateDiscovererResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text Text)
      -> Maybe Text -> Int -> CreateDiscovererResponse)
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 -> CreateDiscovererResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Maybe Text -> Int -> CreateDiscovererResponse)
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 -> CreateDiscovererResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDiscovererResponse)
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 -> CreateDiscovererResponse)
-> Either String Int -> Either String CreateDiscovererResponse
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 CreateDiscoverer

instance Prelude.NFData CreateDiscoverer

instance Core.ToHeaders CreateDiscoverer where
  toHeaders :: CreateDiscoverer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateDiscoverer -> 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 CreateDiscoverer where
  toJSON :: CreateDiscoverer -> Value
toJSON CreateDiscoverer' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Text
sourceArn :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
crossAccount :: Maybe Bool
$sel:sourceArn:CreateDiscoverer' :: CreateDiscoverer -> Text
$sel:tags:CreateDiscoverer' :: CreateDiscoverer -> Maybe (HashMap Text Text)
$sel:description:CreateDiscoverer' :: CreateDiscoverer -> Maybe Text
$sel:crossAccount:CreateDiscoverer' :: CreateDiscoverer -> 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,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateDiscovererResponse' 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', 'createDiscovererResponse_state' - The state of the discoverer.
--
-- 'crossAccount', 'createDiscovererResponse_crossAccount' - The Status if the discoverer will discover schemas from events sent from
-- another account.
--
-- 'sourceArn', 'createDiscovererResponse_sourceArn' - The ARN of the event bus.
--
-- 'discovererId', 'createDiscovererResponse_discovererId' - The ID of the discoverer.
--
-- 'description', 'createDiscovererResponse_description' - The description of the discoverer.
--
-- 'tags', 'createDiscovererResponse_tags' - Tags associated with the resource.
--
-- 'discovererArn', 'createDiscovererResponse_discovererArn' - The ARN of the discoverer.
--
-- 'httpStatus', 'createDiscovererResponse_httpStatus' - The response's http status code.
newCreateDiscovererResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDiscovererResponse
newCreateDiscovererResponse :: Int -> CreateDiscovererResponse
newCreateDiscovererResponse Int
pHttpStatus_ =
  CreateDiscovererResponse' :: Maybe DiscovererState
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Int
-> CreateDiscovererResponse
CreateDiscovererResponse'
    { $sel:state:CreateDiscovererResponse' :: Maybe DiscovererState
state = Maybe DiscovererState
forall a. Maybe a
Prelude.Nothing,
      $sel:crossAccount:CreateDiscovererResponse' :: Maybe Bool
crossAccount = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:CreateDiscovererResponse' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:discovererId:CreateDiscovererResponse' :: Maybe Text
discovererId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateDiscovererResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateDiscovererResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:discovererArn:CreateDiscovererResponse' :: Maybe Text
discovererArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDiscovererResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

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

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

-- | Tags associated with the resource.
createDiscovererResponse_tags :: Lens.Lens' CreateDiscovererResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createDiscovererResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateDiscovererResponse -> f CreateDiscovererResponse
createDiscovererResponse_tags = (CreateDiscovererResponse -> Maybe (HashMap Text Text))
-> (CreateDiscovererResponse
    -> Maybe (HashMap Text Text) -> CreateDiscovererResponse)
-> Lens
     CreateDiscovererResponse
     CreateDiscovererResponse
     (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 (\CreateDiscovererResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateDiscovererResponse' :: CreateDiscovererResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateDiscovererResponse
s@CreateDiscovererResponse' {} Maybe (HashMap Text Text)
a -> CreateDiscovererResponse
s {$sel:tags:CreateDiscovererResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateDiscovererResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateDiscovererResponse -> f CreateDiscovererResponse)
-> ((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)))
-> CreateDiscovererResponse
-> f CreateDiscovererResponse
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.
createDiscovererResponse_discovererArn :: Lens.Lens' CreateDiscovererResponse (Prelude.Maybe Prelude.Text)
createDiscovererResponse_discovererArn :: (Maybe Text -> f (Maybe Text))
-> CreateDiscovererResponse -> f CreateDiscovererResponse
createDiscovererResponse_discovererArn = (CreateDiscovererResponse -> Maybe Text)
-> (CreateDiscovererResponse
    -> Maybe Text -> CreateDiscovererResponse)
-> Lens
     CreateDiscovererResponse
     CreateDiscovererResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDiscovererResponse' {Maybe Text
discovererArn :: Maybe Text
$sel:discovererArn:CreateDiscovererResponse' :: CreateDiscovererResponse -> Maybe Text
discovererArn} -> Maybe Text
discovererArn) (\s :: CreateDiscovererResponse
s@CreateDiscovererResponse' {} Maybe Text
a -> CreateDiscovererResponse
s {$sel:discovererArn:CreateDiscovererResponse' :: Maybe Text
discovererArn = Maybe Text
a} :: CreateDiscovererResponse)

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

instance Prelude.NFData CreateDiscovererResponse