{-# 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.KMS.Types.XksProxyConfigurationType
-- 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.KMS.Types.XksProxyConfigurationType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.KMS.Types.XksProxyConnectivityType
import qualified Amazonka.Prelude as Prelude

-- | Detailed information about the external key store proxy (XKS proxy).
-- Your external key store proxy translates KMS requests into a format that
-- your external key manager can understand. These fields appear in a
-- DescribeCustomKeyStores response only when the @CustomKeyStoreType@ is
-- @EXTERNAL_KEY_STORE@.
--
-- /See:/ 'newXksProxyConfigurationType' smart constructor.
data XksProxyConfigurationType = XksProxyConfigurationType'
  { -- | The part of the external key store
    -- <https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateCustomKeyStore.html#KMS-CreateCustomKeyStore-request-XksProxyAuthenticationCredential proxy authentication credential>
    -- that uniquely identifies the secret access key.
    XksProxyConfigurationType -> Maybe (Sensitive Text)
accessKeyId :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Indicates whether the external key store proxy uses a public endpoint or
    -- an Amazon VPC endpoint service to communicate with KMS.
    XksProxyConfigurationType -> Maybe XksProxyConnectivityType
connectivity :: Prelude.Maybe XksProxyConnectivityType,
    -- | The URI endpoint for the external key store proxy.
    --
    -- If the external key store proxy has a public endpoint, it is displayed
    -- here.
    --
    -- If the external key store proxy uses an Amazon VPC endpoint service
    -- name, this field displays the private DNS name associated with the VPC
    -- endpoint service.
    XksProxyConfigurationType -> Maybe Text
uriEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The path to the external key store proxy APIs.
    XksProxyConfigurationType -> Maybe Text
uriPath :: Prelude.Maybe Prelude.Text,
    -- | The Amazon VPC endpoint service used to communicate with the external
    -- key store proxy. This field appears only when the external key store
    -- proxy uses an Amazon VPC endpoint service to communicate with KMS.
    XksProxyConfigurationType -> Maybe Text
vpcEndpointServiceName :: Prelude.Maybe Prelude.Text
  }
  deriving (XksProxyConfigurationType -> XksProxyConfigurationType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XksProxyConfigurationType -> XksProxyConfigurationType -> Bool
$c/= :: XksProxyConfigurationType -> XksProxyConfigurationType -> Bool
== :: XksProxyConfigurationType -> XksProxyConfigurationType -> Bool
$c== :: XksProxyConfigurationType -> XksProxyConfigurationType -> Bool
Prelude.Eq, Int -> XksProxyConfigurationType -> ShowS
[XksProxyConfigurationType] -> ShowS
XksProxyConfigurationType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [XksProxyConfigurationType] -> ShowS
$cshowList :: [XksProxyConfigurationType] -> ShowS
show :: XksProxyConfigurationType -> String
$cshow :: XksProxyConfigurationType -> String
showsPrec :: Int -> XksProxyConfigurationType -> ShowS
$cshowsPrec :: Int -> XksProxyConfigurationType -> ShowS
Prelude.Show, forall x.
Rep XksProxyConfigurationType x -> XksProxyConfigurationType
forall x.
XksProxyConfigurationType -> Rep XksProxyConfigurationType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep XksProxyConfigurationType x -> XksProxyConfigurationType
$cfrom :: forall x.
XksProxyConfigurationType -> Rep XksProxyConfigurationType x
Prelude.Generic)

-- |
-- Create a value of 'XksProxyConfigurationType' 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:
--
-- 'accessKeyId', 'xksProxyConfigurationType_accessKeyId' - The part of the external key store
-- <https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateCustomKeyStore.html#KMS-CreateCustomKeyStore-request-XksProxyAuthenticationCredential proxy authentication credential>
-- that uniquely identifies the secret access key.
--
-- 'connectivity', 'xksProxyConfigurationType_connectivity' - Indicates whether the external key store proxy uses a public endpoint or
-- an Amazon VPC endpoint service to communicate with KMS.
--
-- 'uriEndpoint', 'xksProxyConfigurationType_uriEndpoint' - The URI endpoint for the external key store proxy.
--
-- If the external key store proxy has a public endpoint, it is displayed
-- here.
--
-- If the external key store proxy uses an Amazon VPC endpoint service
-- name, this field displays the private DNS name associated with the VPC
-- endpoint service.
--
-- 'uriPath', 'xksProxyConfigurationType_uriPath' - The path to the external key store proxy APIs.
--
-- 'vpcEndpointServiceName', 'xksProxyConfigurationType_vpcEndpointServiceName' - The Amazon VPC endpoint service used to communicate with the external
-- key store proxy. This field appears only when the external key store
-- proxy uses an Amazon VPC endpoint service to communicate with KMS.
newXksProxyConfigurationType ::
  XksProxyConfigurationType
newXksProxyConfigurationType :: XksProxyConfigurationType
newXksProxyConfigurationType =
  XksProxyConfigurationType'
    { $sel:accessKeyId:XksProxyConfigurationType' :: Maybe (Sensitive Text)
accessKeyId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:connectivity:XksProxyConfigurationType' :: Maybe XksProxyConnectivityType
connectivity = forall a. Maybe a
Prelude.Nothing,
      $sel:uriEndpoint:XksProxyConfigurationType' :: Maybe Text
uriEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:uriPath:XksProxyConfigurationType' :: Maybe Text
uriPath = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcEndpointServiceName:XksProxyConfigurationType' :: Maybe Text
vpcEndpointServiceName = forall a. Maybe a
Prelude.Nothing
    }

-- | The part of the external key store
-- <https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateCustomKeyStore.html#KMS-CreateCustomKeyStore-request-XksProxyAuthenticationCredential proxy authentication credential>
-- that uniquely identifies the secret access key.
xksProxyConfigurationType_accessKeyId :: Lens.Lens' XksProxyConfigurationType (Prelude.Maybe Prelude.Text)
xksProxyConfigurationType_accessKeyId :: Lens' XksProxyConfigurationType (Maybe Text)
xksProxyConfigurationType_accessKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XksProxyConfigurationType' {Maybe (Sensitive Text)
accessKeyId :: Maybe (Sensitive Text)
$sel:accessKeyId:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe (Sensitive Text)
accessKeyId} -> Maybe (Sensitive Text)
accessKeyId) (\s :: XksProxyConfigurationType
s@XksProxyConfigurationType' {} Maybe (Sensitive Text)
a -> XksProxyConfigurationType
s {$sel:accessKeyId:XksProxyConfigurationType' :: Maybe (Sensitive Text)
accessKeyId = Maybe (Sensitive Text)
a} :: XksProxyConfigurationType) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | Indicates whether the external key store proxy uses a public endpoint or
-- an Amazon VPC endpoint service to communicate with KMS.
xksProxyConfigurationType_connectivity :: Lens.Lens' XksProxyConfigurationType (Prelude.Maybe XksProxyConnectivityType)
xksProxyConfigurationType_connectivity :: Lens' XksProxyConfigurationType (Maybe XksProxyConnectivityType)
xksProxyConfigurationType_connectivity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XksProxyConfigurationType' {Maybe XksProxyConnectivityType
connectivity :: Maybe XksProxyConnectivityType
$sel:connectivity:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe XksProxyConnectivityType
connectivity} -> Maybe XksProxyConnectivityType
connectivity) (\s :: XksProxyConfigurationType
s@XksProxyConfigurationType' {} Maybe XksProxyConnectivityType
a -> XksProxyConfigurationType
s {$sel:connectivity:XksProxyConfigurationType' :: Maybe XksProxyConnectivityType
connectivity = Maybe XksProxyConnectivityType
a} :: XksProxyConfigurationType)

-- | The URI endpoint for the external key store proxy.
--
-- If the external key store proxy has a public endpoint, it is displayed
-- here.
--
-- If the external key store proxy uses an Amazon VPC endpoint service
-- name, this field displays the private DNS name associated with the VPC
-- endpoint service.
xksProxyConfigurationType_uriEndpoint :: Lens.Lens' XksProxyConfigurationType (Prelude.Maybe Prelude.Text)
xksProxyConfigurationType_uriEndpoint :: Lens' XksProxyConfigurationType (Maybe Text)
xksProxyConfigurationType_uriEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XksProxyConfigurationType' {Maybe Text
uriEndpoint :: Maybe Text
$sel:uriEndpoint:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
uriEndpoint} -> Maybe Text
uriEndpoint) (\s :: XksProxyConfigurationType
s@XksProxyConfigurationType' {} Maybe Text
a -> XksProxyConfigurationType
s {$sel:uriEndpoint:XksProxyConfigurationType' :: Maybe Text
uriEndpoint = Maybe Text
a} :: XksProxyConfigurationType)

-- | The path to the external key store proxy APIs.
xksProxyConfigurationType_uriPath :: Lens.Lens' XksProxyConfigurationType (Prelude.Maybe Prelude.Text)
xksProxyConfigurationType_uriPath :: Lens' XksProxyConfigurationType (Maybe Text)
xksProxyConfigurationType_uriPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XksProxyConfigurationType' {Maybe Text
uriPath :: Maybe Text
$sel:uriPath:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
uriPath} -> Maybe Text
uriPath) (\s :: XksProxyConfigurationType
s@XksProxyConfigurationType' {} Maybe Text
a -> XksProxyConfigurationType
s {$sel:uriPath:XksProxyConfigurationType' :: Maybe Text
uriPath = Maybe Text
a} :: XksProxyConfigurationType)

-- | The Amazon VPC endpoint service used to communicate with the external
-- key store proxy. This field appears only when the external key store
-- proxy uses an Amazon VPC endpoint service to communicate with KMS.
xksProxyConfigurationType_vpcEndpointServiceName :: Lens.Lens' XksProxyConfigurationType (Prelude.Maybe Prelude.Text)
xksProxyConfigurationType_vpcEndpointServiceName :: Lens' XksProxyConfigurationType (Maybe Text)
xksProxyConfigurationType_vpcEndpointServiceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XksProxyConfigurationType' {Maybe Text
vpcEndpointServiceName :: Maybe Text
$sel:vpcEndpointServiceName:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
vpcEndpointServiceName} -> Maybe Text
vpcEndpointServiceName) (\s :: XksProxyConfigurationType
s@XksProxyConfigurationType' {} Maybe Text
a -> XksProxyConfigurationType
s {$sel:vpcEndpointServiceName:XksProxyConfigurationType' :: Maybe Text
vpcEndpointServiceName = Maybe Text
a} :: XksProxyConfigurationType)

instance Data.FromJSON XksProxyConfigurationType where
  parseJSON :: Value -> Parser XksProxyConfigurationType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"XksProxyConfigurationType"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe XksProxyConnectivityType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> XksProxyConfigurationType
XksProxyConfigurationType'
            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
"AccessKeyId")
            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
"Connectivity")
            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
"UriEndpoint")
            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
"UriPath")
            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
"VpcEndpointServiceName")
      )

instance Prelude.Hashable XksProxyConfigurationType where
  hashWithSalt :: Int -> XksProxyConfigurationType -> Int
hashWithSalt Int
_salt XksProxyConfigurationType' {Maybe Text
Maybe (Sensitive Text)
Maybe XksProxyConnectivityType
vpcEndpointServiceName :: Maybe Text
uriPath :: Maybe Text
uriEndpoint :: Maybe Text
connectivity :: Maybe XksProxyConnectivityType
accessKeyId :: Maybe (Sensitive Text)
$sel:vpcEndpointServiceName:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
$sel:uriPath:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
$sel:uriEndpoint:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
$sel:connectivity:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe XksProxyConnectivityType
$sel:accessKeyId:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accessKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe XksProxyConnectivityType
connectivity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uriEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uriPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcEndpointServiceName

instance Prelude.NFData XksProxyConfigurationType where
  rnf :: XksProxyConfigurationType -> ()
rnf XksProxyConfigurationType' {Maybe Text
Maybe (Sensitive Text)
Maybe XksProxyConnectivityType
vpcEndpointServiceName :: Maybe Text
uriPath :: Maybe Text
uriEndpoint :: Maybe Text
connectivity :: Maybe XksProxyConnectivityType
accessKeyId :: Maybe (Sensitive Text)
$sel:vpcEndpointServiceName:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
$sel:uriPath:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
$sel:uriEndpoint:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe Text
$sel:connectivity:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe XksProxyConnectivityType
$sel:accessKeyId:XksProxyConfigurationType' :: XksProxyConfigurationType -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accessKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe XksProxyConnectivityType
connectivity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uriEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uriPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcEndpointServiceName