{-# 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.ListedProfile
-- 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.ListedProfile 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
import Amazonka.Transfer.Types.ProfileType

-- | Returns the properties of the profile that was specified.
--
-- /See:/ 'newListedProfile' smart constructor.
data ListedProfile = ListedProfile'
  { -- | The Amazon Resource Name (ARN) of the specified profile.
    ListedProfile -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The @As2Id@ is the /AS2-name/, as defined in the
    -- <https://datatracker.ietf.org/doc/html/rfc4130 RFC 4130>. For inbound
    -- transfers, this is the @AS2-From@ header for the AS2 messages sent from
    -- the partner. For outbound connectors, this is the @AS2-To@ header for
    -- the AS2 messages sent to the partner using the @StartFileTransfer@ API
    -- operation. This ID cannot include spaces.
    ListedProfile -> Maybe Text
as2Id :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the local or partner AS2 profile.
    ListedProfile -> Maybe Text
profileId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether to list only @LOCAL@ type profiles or only @PARTNER@
    -- type profiles. If not supplied in the request, the command lists all
    -- types of profiles.
    ListedProfile -> Maybe ProfileType
profileType :: Prelude.Maybe ProfileType
  }
  deriving (ListedProfile -> ListedProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListedProfile -> ListedProfile -> Bool
$c/= :: ListedProfile -> ListedProfile -> Bool
== :: ListedProfile -> ListedProfile -> Bool
$c== :: ListedProfile -> ListedProfile -> Bool
Prelude.Eq, ReadPrec [ListedProfile]
ReadPrec ListedProfile
Int -> ReadS ListedProfile
ReadS [ListedProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListedProfile]
$creadListPrec :: ReadPrec [ListedProfile]
readPrec :: ReadPrec ListedProfile
$creadPrec :: ReadPrec ListedProfile
readList :: ReadS [ListedProfile]
$creadList :: ReadS [ListedProfile]
readsPrec :: Int -> ReadS ListedProfile
$creadsPrec :: Int -> ReadS ListedProfile
Prelude.Read, Int -> ListedProfile -> ShowS
[ListedProfile] -> ShowS
ListedProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListedProfile] -> ShowS
$cshowList :: [ListedProfile] -> ShowS
show :: ListedProfile -> String
$cshow :: ListedProfile -> String
showsPrec :: Int -> ListedProfile -> ShowS
$cshowsPrec :: Int -> ListedProfile -> ShowS
Prelude.Show, forall x. Rep ListedProfile x -> ListedProfile
forall x. ListedProfile -> Rep ListedProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListedProfile x -> ListedProfile
$cfrom :: forall x. ListedProfile -> Rep ListedProfile x
Prelude.Generic)

-- |
-- Create a value of 'ListedProfile' 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', 'listedProfile_arn' - The Amazon Resource Name (ARN) of the specified profile.
--
-- 'as2Id', 'listedProfile_as2Id' - The @As2Id@ is the /AS2-name/, as defined in the
-- <https://datatracker.ietf.org/doc/html/rfc4130 RFC 4130>. For inbound
-- transfers, this is the @AS2-From@ header for the AS2 messages sent from
-- the partner. For outbound connectors, this is the @AS2-To@ header for
-- the AS2 messages sent to the partner using the @StartFileTransfer@ API
-- operation. This ID cannot include spaces.
--
-- 'profileId', 'listedProfile_profileId' - A unique identifier for the local or partner AS2 profile.
--
-- 'profileType', 'listedProfile_profileType' - Indicates whether to list only @LOCAL@ type profiles or only @PARTNER@
-- type profiles. If not supplied in the request, the command lists all
-- types of profiles.
newListedProfile ::
  ListedProfile
newListedProfile :: ListedProfile
newListedProfile =
  ListedProfile'
    { $sel:arn:ListedProfile' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:as2Id:ListedProfile' :: Maybe Text
as2Id = forall a. Maybe a
Prelude.Nothing,
      $sel:profileId:ListedProfile' :: Maybe Text
profileId = forall a. Maybe a
Prelude.Nothing,
      $sel:profileType:ListedProfile' :: Maybe ProfileType
profileType = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The @As2Id@ is the /AS2-name/, as defined in the
-- <https://datatracker.ietf.org/doc/html/rfc4130 RFC 4130>. For inbound
-- transfers, this is the @AS2-From@ header for the AS2 messages sent from
-- the partner. For outbound connectors, this is the @AS2-To@ header for
-- the AS2 messages sent to the partner using the @StartFileTransfer@ API
-- operation. This ID cannot include spaces.
listedProfile_as2Id :: Lens.Lens' ListedProfile (Prelude.Maybe Prelude.Text)
listedProfile_as2Id :: Lens' ListedProfile (Maybe Text)
listedProfile_as2Id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedProfile' {Maybe Text
as2Id :: Maybe Text
$sel:as2Id:ListedProfile' :: ListedProfile -> Maybe Text
as2Id} -> Maybe Text
as2Id) (\s :: ListedProfile
s@ListedProfile' {} Maybe Text
a -> ListedProfile
s {$sel:as2Id:ListedProfile' :: Maybe Text
as2Id = Maybe Text
a} :: ListedProfile)

-- | A unique identifier for the local or partner AS2 profile.
listedProfile_profileId :: Lens.Lens' ListedProfile (Prelude.Maybe Prelude.Text)
listedProfile_profileId :: Lens' ListedProfile (Maybe Text)
listedProfile_profileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedProfile' {Maybe Text
profileId :: Maybe Text
$sel:profileId:ListedProfile' :: ListedProfile -> Maybe Text
profileId} -> Maybe Text
profileId) (\s :: ListedProfile
s@ListedProfile' {} Maybe Text
a -> ListedProfile
s {$sel:profileId:ListedProfile' :: Maybe Text
profileId = Maybe Text
a} :: ListedProfile)

-- | Indicates whether to list only @LOCAL@ type profiles or only @PARTNER@
-- type profiles. If not supplied in the request, the command lists all
-- types of profiles.
listedProfile_profileType :: Lens.Lens' ListedProfile (Prelude.Maybe ProfileType)
listedProfile_profileType :: Lens' ListedProfile (Maybe ProfileType)
listedProfile_profileType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedProfile' {Maybe ProfileType
profileType :: Maybe ProfileType
$sel:profileType:ListedProfile' :: ListedProfile -> Maybe ProfileType
profileType} -> Maybe ProfileType
profileType) (\s :: ListedProfile
s@ListedProfile' {} Maybe ProfileType
a -> ListedProfile
s {$sel:profileType:ListedProfile' :: Maybe ProfileType
profileType = Maybe ProfileType
a} :: ListedProfile)

instance Data.FromJSON ListedProfile where
  parseJSON :: Value -> Parser ListedProfile
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListedProfile"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe ProfileType -> ListedProfile
ListedProfile'
            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
"As2Id")
            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
"ProfileId")
            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
"ProfileType")
      )

instance Prelude.Hashable ListedProfile where
  hashWithSalt :: Int -> ListedProfile -> Int
hashWithSalt Int
_salt ListedProfile' {Maybe Text
Maybe ProfileType
profileType :: Maybe ProfileType
profileId :: Maybe Text
as2Id :: Maybe Text
arn :: Maybe Text
$sel:profileType:ListedProfile' :: ListedProfile -> Maybe ProfileType
$sel:profileId:ListedProfile' :: ListedProfile -> Maybe Text
$sel:as2Id:ListedProfile' :: ListedProfile -> Maybe Text
$sel:arn:ListedProfile' :: ListedProfile -> 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
as2Id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
profileId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProfileType
profileType

instance Prelude.NFData ListedProfile where
  rnf :: ListedProfile -> ()
rnf ListedProfile' {Maybe Text
Maybe ProfileType
profileType :: Maybe ProfileType
profileId :: Maybe Text
as2Id :: Maybe Text
arn :: Maybe Text
$sel:profileType:ListedProfile' :: ListedProfile -> Maybe ProfileType
$sel:profileId:ListedProfile' :: ListedProfile -> Maybe Text
$sel:as2Id:ListedProfile' :: ListedProfile -> Maybe Text
$sel:arn:ListedProfile' :: ListedProfile -> 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
as2Id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
profileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProfileType
profileType