{-# 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.VirtualGatewayTlsValidationContextSdsTrust
-- 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.VirtualGatewayTlsValidationContextSdsTrust where

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

-- | An object that represents a virtual gateway\'s listener\'s Transport
-- Layer Security (TLS) Secret Discovery Service validation context trust.
-- The proxy must be configured with a local SDS provider via a Unix Domain
-- Socket. See App Mesh
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html TLS documentation>
-- for more info.
--
-- /See:/ 'newVirtualGatewayTlsValidationContextSdsTrust' smart constructor.
data VirtualGatewayTlsValidationContextSdsTrust = VirtualGatewayTlsValidationContextSdsTrust'
  { -- | A reference to an object that represents the name of the secret for a
    -- virtual gateway\'s Transport Layer Security (TLS) Secret Discovery
    -- Service validation context trust.
    VirtualGatewayTlsValidationContextSdsTrust -> Text
secretName :: Prelude.Text
  }
  deriving (VirtualGatewayTlsValidationContextSdsTrust
-> VirtualGatewayTlsValidationContextSdsTrust -> Bool
(VirtualGatewayTlsValidationContextSdsTrust
 -> VirtualGatewayTlsValidationContextSdsTrust -> Bool)
-> (VirtualGatewayTlsValidationContextSdsTrust
    -> VirtualGatewayTlsValidationContextSdsTrust -> Bool)
-> Eq VirtualGatewayTlsValidationContextSdsTrust
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VirtualGatewayTlsValidationContextSdsTrust
-> VirtualGatewayTlsValidationContextSdsTrust -> Bool
$c/= :: VirtualGatewayTlsValidationContextSdsTrust
-> VirtualGatewayTlsValidationContextSdsTrust -> Bool
== :: VirtualGatewayTlsValidationContextSdsTrust
-> VirtualGatewayTlsValidationContextSdsTrust -> Bool
$c== :: VirtualGatewayTlsValidationContextSdsTrust
-> VirtualGatewayTlsValidationContextSdsTrust -> Bool
Prelude.Eq, ReadPrec [VirtualGatewayTlsValidationContextSdsTrust]
ReadPrec VirtualGatewayTlsValidationContextSdsTrust
Int -> ReadS VirtualGatewayTlsValidationContextSdsTrust
ReadS [VirtualGatewayTlsValidationContextSdsTrust]
(Int -> ReadS VirtualGatewayTlsValidationContextSdsTrust)
-> ReadS [VirtualGatewayTlsValidationContextSdsTrust]
-> ReadPrec VirtualGatewayTlsValidationContextSdsTrust
-> ReadPrec [VirtualGatewayTlsValidationContextSdsTrust]
-> Read VirtualGatewayTlsValidationContextSdsTrust
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VirtualGatewayTlsValidationContextSdsTrust]
$creadListPrec :: ReadPrec [VirtualGatewayTlsValidationContextSdsTrust]
readPrec :: ReadPrec VirtualGatewayTlsValidationContextSdsTrust
$creadPrec :: ReadPrec VirtualGatewayTlsValidationContextSdsTrust
readList :: ReadS [VirtualGatewayTlsValidationContextSdsTrust]
$creadList :: ReadS [VirtualGatewayTlsValidationContextSdsTrust]
readsPrec :: Int -> ReadS VirtualGatewayTlsValidationContextSdsTrust
$creadsPrec :: Int -> ReadS VirtualGatewayTlsValidationContextSdsTrust
Prelude.Read, Int -> VirtualGatewayTlsValidationContextSdsTrust -> ShowS
[VirtualGatewayTlsValidationContextSdsTrust] -> ShowS
VirtualGatewayTlsValidationContextSdsTrust -> String
(Int -> VirtualGatewayTlsValidationContextSdsTrust -> ShowS)
-> (VirtualGatewayTlsValidationContextSdsTrust -> String)
-> ([VirtualGatewayTlsValidationContextSdsTrust] -> ShowS)
-> Show VirtualGatewayTlsValidationContextSdsTrust
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VirtualGatewayTlsValidationContextSdsTrust] -> ShowS
$cshowList :: [VirtualGatewayTlsValidationContextSdsTrust] -> ShowS
show :: VirtualGatewayTlsValidationContextSdsTrust -> String
$cshow :: VirtualGatewayTlsValidationContextSdsTrust -> String
showsPrec :: Int -> VirtualGatewayTlsValidationContextSdsTrust -> ShowS
$cshowsPrec :: Int -> VirtualGatewayTlsValidationContextSdsTrust -> ShowS
Prelude.Show, (forall x.
 VirtualGatewayTlsValidationContextSdsTrust
 -> Rep VirtualGatewayTlsValidationContextSdsTrust x)
-> (forall x.
    Rep VirtualGatewayTlsValidationContextSdsTrust x
    -> VirtualGatewayTlsValidationContextSdsTrust)
-> Generic VirtualGatewayTlsValidationContextSdsTrust
forall x.
Rep VirtualGatewayTlsValidationContextSdsTrust x
-> VirtualGatewayTlsValidationContextSdsTrust
forall x.
VirtualGatewayTlsValidationContextSdsTrust
-> Rep VirtualGatewayTlsValidationContextSdsTrust x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VirtualGatewayTlsValidationContextSdsTrust x
-> VirtualGatewayTlsValidationContextSdsTrust
$cfrom :: forall x.
VirtualGatewayTlsValidationContextSdsTrust
-> Rep VirtualGatewayTlsValidationContextSdsTrust x
Prelude.Generic)

-- |
-- Create a value of 'VirtualGatewayTlsValidationContextSdsTrust' 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:
--
-- 'secretName', 'virtualGatewayTlsValidationContextSdsTrust_secretName' - A reference to an object that represents the name of the secret for a
-- virtual gateway\'s Transport Layer Security (TLS) Secret Discovery
-- Service validation context trust.
newVirtualGatewayTlsValidationContextSdsTrust ::
  -- | 'secretName'
  Prelude.Text ->
  VirtualGatewayTlsValidationContextSdsTrust
newVirtualGatewayTlsValidationContextSdsTrust :: Text -> VirtualGatewayTlsValidationContextSdsTrust
newVirtualGatewayTlsValidationContextSdsTrust
  Text
pSecretName_ =
    VirtualGatewayTlsValidationContextSdsTrust' :: Text -> VirtualGatewayTlsValidationContextSdsTrust
VirtualGatewayTlsValidationContextSdsTrust'
      { $sel:secretName:VirtualGatewayTlsValidationContextSdsTrust' :: Text
secretName =
          Text
pSecretName_
      }

-- | A reference to an object that represents the name of the secret for a
-- virtual gateway\'s Transport Layer Security (TLS) Secret Discovery
-- Service validation context trust.
virtualGatewayTlsValidationContextSdsTrust_secretName :: Lens.Lens' VirtualGatewayTlsValidationContextSdsTrust Prelude.Text
virtualGatewayTlsValidationContextSdsTrust_secretName :: (Text -> f Text)
-> VirtualGatewayTlsValidationContextSdsTrust
-> f VirtualGatewayTlsValidationContextSdsTrust
virtualGatewayTlsValidationContextSdsTrust_secretName = (VirtualGatewayTlsValidationContextSdsTrust -> Text)
-> (VirtualGatewayTlsValidationContextSdsTrust
    -> Text -> VirtualGatewayTlsValidationContextSdsTrust)
-> Lens
     VirtualGatewayTlsValidationContextSdsTrust
     VirtualGatewayTlsValidationContextSdsTrust
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VirtualGatewayTlsValidationContextSdsTrust' {Text
secretName :: Text
$sel:secretName:VirtualGatewayTlsValidationContextSdsTrust' :: VirtualGatewayTlsValidationContextSdsTrust -> Text
secretName} -> Text
secretName) (\s :: VirtualGatewayTlsValidationContextSdsTrust
s@VirtualGatewayTlsValidationContextSdsTrust' {} Text
a -> VirtualGatewayTlsValidationContextSdsTrust
s {$sel:secretName:VirtualGatewayTlsValidationContextSdsTrust' :: Text
secretName = Text
a} :: VirtualGatewayTlsValidationContextSdsTrust)

instance
  Core.FromJSON
    VirtualGatewayTlsValidationContextSdsTrust
  where
  parseJSON :: Value -> Parser VirtualGatewayTlsValidationContextSdsTrust
parseJSON =
    String
-> (Object -> Parser VirtualGatewayTlsValidationContextSdsTrust)
-> Value
-> Parser VirtualGatewayTlsValidationContextSdsTrust
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"VirtualGatewayTlsValidationContextSdsTrust"
      ( \Object
x ->
          Text -> VirtualGatewayTlsValidationContextSdsTrust
VirtualGatewayTlsValidationContextSdsTrust'
            (Text -> VirtualGatewayTlsValidationContextSdsTrust)
-> Parser Text -> Parser VirtualGatewayTlsValidationContextSdsTrust
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
"secretName")
      )

instance
  Prelude.Hashable
    VirtualGatewayTlsValidationContextSdsTrust

instance
  Prelude.NFData
    VirtualGatewayTlsValidationContextSdsTrust

instance
  Core.ToJSON
    VirtualGatewayTlsValidationContextSdsTrust
  where
  toJSON :: VirtualGatewayTlsValidationContextSdsTrust -> Value
toJSON
    VirtualGatewayTlsValidationContextSdsTrust' {Text
secretName :: Text
$sel:secretName:VirtualGatewayTlsValidationContextSdsTrust' :: VirtualGatewayTlsValidationContextSdsTrust -> 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
"secretName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretName)]
        )