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

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

-- |
-- Module      : Amazonka.Transfer.Types.ListedConnector
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Transfer.Types.ListedConnector where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Returns details of the connector that is specified.
--
-- /See:/ 'newListedConnector' smart constructor.
data ListedConnector = ListedConnector'
  { -- | The Amazon Resource Name (ARN) of the specified connector.
    ListedConnector -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the connector.
    ListedConnector -> Maybe Text
connectorId :: Prelude.Maybe Prelude.Text,
    -- | The URL of the partner\'s AS2 endpoint.
    ListedConnector -> Maybe Text
url :: Prelude.Maybe Prelude.Text
  }
  deriving (ListedConnector -> ListedConnector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListedConnector -> ListedConnector -> Bool
$c/= :: ListedConnector -> ListedConnector -> Bool
== :: ListedConnector -> ListedConnector -> Bool
$c== :: ListedConnector -> ListedConnector -> Bool
Prelude.Eq, ReadPrec [ListedConnector]
ReadPrec ListedConnector
Int -> ReadS ListedConnector
ReadS [ListedConnector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListedConnector]
$creadListPrec :: ReadPrec [ListedConnector]
readPrec :: ReadPrec ListedConnector
$creadPrec :: ReadPrec ListedConnector
readList :: ReadS [ListedConnector]
$creadList :: ReadS [ListedConnector]
readsPrec :: Int -> ReadS ListedConnector
$creadsPrec :: Int -> ReadS ListedConnector
Prelude.Read, Int -> ListedConnector -> ShowS
[ListedConnector] -> ShowS
ListedConnector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListedConnector] -> ShowS
$cshowList :: [ListedConnector] -> ShowS
show :: ListedConnector -> String
$cshow :: ListedConnector -> String
showsPrec :: Int -> ListedConnector -> ShowS
$cshowsPrec :: Int -> ListedConnector -> ShowS
Prelude.Show, forall x. Rep ListedConnector x -> ListedConnector
forall x. ListedConnector -> Rep ListedConnector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListedConnector x -> ListedConnector
$cfrom :: forall x. ListedConnector -> Rep ListedConnector x
Prelude.Generic)

-- |
-- Create a value of 'ListedConnector' 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', 'listedConnector_arn' - The Amazon Resource Name (ARN) of the specified connector.
--
-- 'connectorId', 'listedConnector_connectorId' - The unique identifier for the connector.
--
-- 'url', 'listedConnector_url' - The URL of the partner\'s AS2 endpoint.
newListedConnector ::
  ListedConnector
newListedConnector :: ListedConnector
newListedConnector =
  ListedConnector'
    { $sel:arn:ListedConnector' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:connectorId:ListedConnector' :: Maybe Text
connectorId = forall a. Maybe a
Prelude.Nothing,
      $sel:url:ListedConnector' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the specified connector.
listedConnector_arn :: Lens.Lens' ListedConnector (Prelude.Maybe Prelude.Text)
listedConnector_arn :: Lens' ListedConnector (Maybe Text)
listedConnector_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedConnector' {Maybe Text
arn :: Maybe Text
$sel:arn:ListedConnector' :: ListedConnector -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ListedConnector
s@ListedConnector' {} Maybe Text
a -> ListedConnector
s {$sel:arn:ListedConnector' :: Maybe Text
arn = Maybe Text
a} :: ListedConnector)

-- | The unique identifier for the connector.
listedConnector_connectorId :: Lens.Lens' ListedConnector (Prelude.Maybe Prelude.Text)
listedConnector_connectorId :: Lens' ListedConnector (Maybe Text)
listedConnector_connectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedConnector' {Maybe Text
connectorId :: Maybe Text
$sel:connectorId:ListedConnector' :: ListedConnector -> Maybe Text
connectorId} -> Maybe Text
connectorId) (\s :: ListedConnector
s@ListedConnector' {} Maybe Text
a -> ListedConnector
s {$sel:connectorId:ListedConnector' :: Maybe Text
connectorId = Maybe Text
a} :: ListedConnector)

-- | The URL of the partner\'s AS2 endpoint.
listedConnector_url :: Lens.Lens' ListedConnector (Prelude.Maybe Prelude.Text)
listedConnector_url :: Lens' ListedConnector (Maybe Text)
listedConnector_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedConnector' {Maybe Text
url :: Maybe Text
$sel:url:ListedConnector' :: ListedConnector -> Maybe Text
url} -> Maybe Text
url) (\s :: ListedConnector
s@ListedConnector' {} Maybe Text
a -> ListedConnector
s {$sel:url:ListedConnector' :: Maybe Text
url = Maybe Text
a} :: ListedConnector)

instance Data.FromJSON ListedConnector where
  parseJSON :: Value -> Parser ListedConnector
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListedConnector"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ListedConnector
ListedConnector'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ConnectorId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Url")
      )

instance Prelude.Hashable ListedConnector where
  hashWithSalt :: Int -> ListedConnector -> Int
hashWithSalt Int
_salt ListedConnector' {Maybe Text
url :: Maybe Text
connectorId :: Maybe Text
arn :: Maybe Text
$sel:url:ListedConnector' :: ListedConnector -> Maybe Text
$sel:connectorId:ListedConnector' :: ListedConnector -> Maybe Text
$sel:arn:ListedConnector' :: ListedConnector -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url

instance Prelude.NFData ListedConnector where
  rnf :: ListedConnector -> ()
rnf ListedConnector' {Maybe Text
url :: Maybe Text
connectorId :: Maybe Text
arn :: Maybe Text
$sel:url:ListedConnector' :: ListedConnector -> Maybe Text
$sel:connectorId:ListedConnector' :: ListedConnector -> Maybe Text
$sel:arn:ListedConnector' :: ListedConnector -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url