{-# 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.AppMesh.Types.ListenerTlsAcmCertificate
-- 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)
module Amazonka.AppMesh.Types.ListenerTlsAcmCertificate where

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

-- | An object that represents an AWS Certicate Manager (ACM) certificate.
--
-- /See:/ 'newListenerTlsAcmCertificate' smart constructor.
data ListenerTlsAcmCertificate = ListenerTlsAcmCertificate'
  { -- | The Amazon Resource Name (ARN) for the certificate. The certificate must
    -- meet specific requirements and you must have proxy authorization
    -- enabled. For more information, see
    -- <https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites Transport Layer Security (TLS)>.
    ListenerTlsAcmCertificate -> Text
certificateArn :: Prelude.Text
  }
  deriving (ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool
(ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool)
-> (ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool)
-> Eq ListenerTlsAcmCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool
$c/= :: ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool
== :: ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool
$c== :: ListenerTlsAcmCertificate -> ListenerTlsAcmCertificate -> Bool
Prelude.Eq, ReadPrec [ListenerTlsAcmCertificate]
ReadPrec ListenerTlsAcmCertificate
Int -> ReadS ListenerTlsAcmCertificate
ReadS [ListenerTlsAcmCertificate]
(Int -> ReadS ListenerTlsAcmCertificate)
-> ReadS [ListenerTlsAcmCertificate]
-> ReadPrec ListenerTlsAcmCertificate
-> ReadPrec [ListenerTlsAcmCertificate]
-> Read ListenerTlsAcmCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListenerTlsAcmCertificate]
$creadListPrec :: ReadPrec [ListenerTlsAcmCertificate]
readPrec :: ReadPrec ListenerTlsAcmCertificate
$creadPrec :: ReadPrec ListenerTlsAcmCertificate
readList :: ReadS [ListenerTlsAcmCertificate]
$creadList :: ReadS [ListenerTlsAcmCertificate]
readsPrec :: Int -> ReadS ListenerTlsAcmCertificate
$creadsPrec :: Int -> ReadS ListenerTlsAcmCertificate
Prelude.Read, Int -> ListenerTlsAcmCertificate -> ShowS
[ListenerTlsAcmCertificate] -> ShowS
ListenerTlsAcmCertificate -> String
(Int -> ListenerTlsAcmCertificate -> ShowS)
-> (ListenerTlsAcmCertificate -> String)
-> ([ListenerTlsAcmCertificate] -> ShowS)
-> Show ListenerTlsAcmCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListenerTlsAcmCertificate] -> ShowS
$cshowList :: [ListenerTlsAcmCertificate] -> ShowS
show :: ListenerTlsAcmCertificate -> String
$cshow :: ListenerTlsAcmCertificate -> String
showsPrec :: Int -> ListenerTlsAcmCertificate -> ShowS
$cshowsPrec :: Int -> ListenerTlsAcmCertificate -> ShowS
Prelude.Show, (forall x.
 ListenerTlsAcmCertificate -> Rep ListenerTlsAcmCertificate x)
-> (forall x.
    Rep ListenerTlsAcmCertificate x -> ListenerTlsAcmCertificate)
-> Generic ListenerTlsAcmCertificate
forall x.
Rep ListenerTlsAcmCertificate x -> ListenerTlsAcmCertificate
forall x.
ListenerTlsAcmCertificate -> Rep ListenerTlsAcmCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListenerTlsAcmCertificate x -> ListenerTlsAcmCertificate
$cfrom :: forall x.
ListenerTlsAcmCertificate -> Rep ListenerTlsAcmCertificate x
Prelude.Generic)

-- |
-- Create a value of 'ListenerTlsAcmCertificate' 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:
--
-- 'certificateArn', 'listenerTlsAcmCertificate_certificateArn' - The Amazon Resource Name (ARN) for the certificate. The certificate must
-- meet specific requirements and you must have proxy authorization
-- enabled. For more information, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites Transport Layer Security (TLS)>.
newListenerTlsAcmCertificate ::
  -- | 'certificateArn'
  Prelude.Text ->
  ListenerTlsAcmCertificate
newListenerTlsAcmCertificate :: Text -> ListenerTlsAcmCertificate
newListenerTlsAcmCertificate Text
pCertificateArn_ =
  ListenerTlsAcmCertificate' :: Text -> ListenerTlsAcmCertificate
ListenerTlsAcmCertificate'
    { $sel:certificateArn:ListenerTlsAcmCertificate' :: Text
certificateArn =
        Text
pCertificateArn_
    }

-- | The Amazon Resource Name (ARN) for the certificate. The certificate must
-- meet specific requirements and you must have proxy authorization
-- enabled. For more information, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites Transport Layer Security (TLS)>.
listenerTlsAcmCertificate_certificateArn :: Lens.Lens' ListenerTlsAcmCertificate Prelude.Text
listenerTlsAcmCertificate_certificateArn :: (Text -> f Text)
-> ListenerTlsAcmCertificate -> f ListenerTlsAcmCertificate
listenerTlsAcmCertificate_certificateArn = (ListenerTlsAcmCertificate -> Text)
-> (ListenerTlsAcmCertificate -> Text -> ListenerTlsAcmCertificate)
-> Lens
     ListenerTlsAcmCertificate ListenerTlsAcmCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListenerTlsAcmCertificate' {Text
certificateArn :: Text
$sel:certificateArn:ListenerTlsAcmCertificate' :: ListenerTlsAcmCertificate -> Text
certificateArn} -> Text
certificateArn) (\s :: ListenerTlsAcmCertificate
s@ListenerTlsAcmCertificate' {} Text
a -> ListenerTlsAcmCertificate
s {$sel:certificateArn:ListenerTlsAcmCertificate' :: Text
certificateArn = Text
a} :: ListenerTlsAcmCertificate)

instance Core.FromJSON ListenerTlsAcmCertificate where
  parseJSON :: Value -> Parser ListenerTlsAcmCertificate
parseJSON =
    String
-> (Object -> Parser ListenerTlsAcmCertificate)
-> Value
-> Parser ListenerTlsAcmCertificate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListenerTlsAcmCertificate"
      ( \Object
x ->
          Text -> ListenerTlsAcmCertificate
ListenerTlsAcmCertificate'
            (Text -> ListenerTlsAcmCertificate)
-> Parser Text -> Parser ListenerTlsAcmCertificate
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"certificateArn")
      )

instance Prelude.Hashable ListenerTlsAcmCertificate

instance Prelude.NFData ListenerTlsAcmCertificate

instance Core.ToJSON ListenerTlsAcmCertificate where
  toJSON :: ListenerTlsAcmCertificate -> Value
toJSON ListenerTlsAcmCertificate' {Text
certificateArn :: Text
$sel:certificateArn:ListenerTlsAcmCertificate' :: ListenerTlsAcmCertificate -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"certificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateArn)
          ]
      )