{-# 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.ProtocolDetails
-- 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.ProtocolDetails 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.As2Transport
import Amazonka.Transfer.Types.SetStatOption
import Amazonka.Transfer.Types.TlsSessionResumptionMode

-- | The protocol settings that are configured for your server.
--
-- /See:/ 'newProtocolDetails' smart constructor.
data ProtocolDetails = ProtocolDetails'
  { -- | Indicates the transport method for the AS2 messages. Currently, only
    -- HTTP is supported.
    ProtocolDetails -> Maybe (NonEmpty As2Transport)
as2Transports :: Prelude.Maybe (Prelude.NonEmpty As2Transport),
    -- | Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4
    -- address, such as the public IP address of a firewall, router, or load
    -- balancer. For example:
    --
    -- @aws transfer update-server --protocol-details PassiveIp=0.0.0.0@
    --
    -- Replace @0.0.0.0@ in the example above with the actual IP address you
    -- want to use.
    --
    -- If you change the @PassiveIp@ value, you must stop and then restart your
    -- Transfer Family server for the change to take effect. For details on
    -- using passive mode (PASV) in a NAT environment, see
    -- <http://aws.amazon.com/blogs/storage/configuring-your-ftps-server-behind-a-firewall-or-nat-with-aws-transfer-family/ Configuring your FTPS server behind a firewall or NAT with Transfer Family>.
    --
    -- /Special values/
    --
    -- The @AUTO@ and @0.0.0.0@ are special values for the @PassiveIp@
    -- parameter. The value @PassiveIp=AUTO@ is assigned by default to FTP and
    -- FTPS type servers. In this case, the server automatically responds with
    -- one of the endpoint IPs within the PASV response. @PassiveIp=0.0.0.0@
    -- has a more unique application for its usage. For example, if you have a
    -- High Availability (HA) Network Load Balancer (NLB) environment, where
    -- you have 3 subnets, you can only specify a single IP address using the
    -- @PassiveIp@ parameter. This reduces the effectiveness of having High
    -- Availability. In this case, you can specify @PassiveIp=0.0.0.0@. This
    -- tells the client to use the same IP address as the Control connection
    -- and utilize all AZs for their connections. Note, however, that not all
    -- FTP clients support the @PassiveIp=0.0.0.0@ response. FileZilla and
    -- WinSCP do support it. If you are using other clients, check to see if
    -- your client supports the @PassiveIp=0.0.0.0@ response.
    ProtocolDetails -> Maybe Text
passiveIp :: Prelude.Maybe Prelude.Text,
    -- | Use the @SetStatOption@ to ignore the error that is generated when the
    -- client attempts to use @SETSTAT@ on a file you are uploading to an S3
    -- bucket.
    --
    -- Some SFTP file transfer clients can attempt to change the attributes of
    -- remote files, including timestamp and permissions, using commands, such
    -- as @SETSTAT@ when uploading the file. However, these commands are not
    -- compatible with object storage systems, such as Amazon S3. Due to this
    -- incompatibility, file uploads from these clients can result in errors
    -- even when the file is otherwise successfully uploaded.
    --
    -- Set the value to @ENABLE_NO_OP@ to have the Transfer Family server
    -- ignore the @SETSTAT@ command, and upload files without needing to make
    -- any changes to your SFTP client. While the @SetStatOption@
    -- @ENABLE_NO_OP@ setting ignores the error, it does generate a log entry
    -- in Amazon CloudWatch Logs, so you can determine when the client is
    -- making a @SETSTAT@ call.
    --
    -- If you want to preserve the original timestamp for your file, and modify
    -- other file attributes using @SETSTAT@, you can use Amazon EFS as backend
    -- storage with Transfer Family.
    ProtocolDetails -> Maybe SetStatOption
setStatOption :: Prelude.Maybe SetStatOption,
    -- | A property used with Transfer Family servers that use the FTPS protocol.
    -- TLS Session Resumption provides a mechanism to resume or share a
    -- negotiated secret key between the control and data connection for an
    -- FTPS session. @TlsSessionResumptionMode@ determines whether or not the
    -- server resumes recent, negotiated sessions through a unique session ID.
    -- This property is available during @CreateServer@ and @UpdateServer@
    -- calls. If a @TlsSessionResumptionMode@ value is not specified during
    -- @CreateServer@, it is set to @ENFORCED@ by default.
    --
    -- -   @DISABLED@: the server does not process TLS session resumption
    --     client requests and creates a new TLS session for each request.
    --
    -- -   @ENABLED@: the server processes and accepts clients that are
    --     performing TLS session resumption. The server doesn\'t reject client
    --     data connections that do not perform the TLS session resumption
    --     client processing.
    --
    -- -   @ENFORCED@: the server processes and accepts clients that are
    --     performing TLS session resumption. The server rejects client data
    --     connections that do not perform the TLS session resumption client
    --     processing. Before you set the value to @ENFORCED@, test your
    --     clients.
    --
    --     Not all FTPS clients perform TLS session resumption. So, if you
    --     choose to enforce TLS session resumption, you prevent any
    --     connections from FTPS clients that don\'t perform the protocol
    --     negotiation. To determine whether or not you can use the @ENFORCED@
    --     value, you need to test your clients.
    ProtocolDetails -> Maybe TlsSessionResumptionMode
tlsSessionResumptionMode :: Prelude.Maybe TlsSessionResumptionMode
  }
  deriving (ProtocolDetails -> ProtocolDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtocolDetails -> ProtocolDetails -> Bool
$c/= :: ProtocolDetails -> ProtocolDetails -> Bool
== :: ProtocolDetails -> ProtocolDetails -> Bool
$c== :: ProtocolDetails -> ProtocolDetails -> Bool
Prelude.Eq, ReadPrec [ProtocolDetails]
ReadPrec ProtocolDetails
Int -> ReadS ProtocolDetails
ReadS [ProtocolDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProtocolDetails]
$creadListPrec :: ReadPrec [ProtocolDetails]
readPrec :: ReadPrec ProtocolDetails
$creadPrec :: ReadPrec ProtocolDetails
readList :: ReadS [ProtocolDetails]
$creadList :: ReadS [ProtocolDetails]
readsPrec :: Int -> ReadS ProtocolDetails
$creadsPrec :: Int -> ReadS ProtocolDetails
Prelude.Read, Int -> ProtocolDetails -> ShowS
[ProtocolDetails] -> ShowS
ProtocolDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtocolDetails] -> ShowS
$cshowList :: [ProtocolDetails] -> ShowS
show :: ProtocolDetails -> String
$cshow :: ProtocolDetails -> String
showsPrec :: Int -> ProtocolDetails -> ShowS
$cshowsPrec :: Int -> ProtocolDetails -> ShowS
Prelude.Show, forall x. Rep ProtocolDetails x -> ProtocolDetails
forall x. ProtocolDetails -> Rep ProtocolDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProtocolDetails x -> ProtocolDetails
$cfrom :: forall x. ProtocolDetails -> Rep ProtocolDetails x
Prelude.Generic)

-- |
-- Create a value of 'ProtocolDetails' 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:
--
-- 'as2Transports', 'protocolDetails_as2Transports' - Indicates the transport method for the AS2 messages. Currently, only
-- HTTP is supported.
--
-- 'passiveIp', 'protocolDetails_passiveIp' - Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4
-- address, such as the public IP address of a firewall, router, or load
-- balancer. For example:
--
-- @aws transfer update-server --protocol-details PassiveIp=0.0.0.0@
--
-- Replace @0.0.0.0@ in the example above with the actual IP address you
-- want to use.
--
-- If you change the @PassiveIp@ value, you must stop and then restart your
-- Transfer Family server for the change to take effect. For details on
-- using passive mode (PASV) in a NAT environment, see
-- <http://aws.amazon.com/blogs/storage/configuring-your-ftps-server-behind-a-firewall-or-nat-with-aws-transfer-family/ Configuring your FTPS server behind a firewall or NAT with Transfer Family>.
--
-- /Special values/
--
-- The @AUTO@ and @0.0.0.0@ are special values for the @PassiveIp@
-- parameter. The value @PassiveIp=AUTO@ is assigned by default to FTP and
-- FTPS type servers. In this case, the server automatically responds with
-- one of the endpoint IPs within the PASV response. @PassiveIp=0.0.0.0@
-- has a more unique application for its usage. For example, if you have a
-- High Availability (HA) Network Load Balancer (NLB) environment, where
-- you have 3 subnets, you can only specify a single IP address using the
-- @PassiveIp@ parameter. This reduces the effectiveness of having High
-- Availability. In this case, you can specify @PassiveIp=0.0.0.0@. This
-- tells the client to use the same IP address as the Control connection
-- and utilize all AZs for their connections. Note, however, that not all
-- FTP clients support the @PassiveIp=0.0.0.0@ response. FileZilla and
-- WinSCP do support it. If you are using other clients, check to see if
-- your client supports the @PassiveIp=0.0.0.0@ response.
--
-- 'setStatOption', 'protocolDetails_setStatOption' - Use the @SetStatOption@ to ignore the error that is generated when the
-- client attempts to use @SETSTAT@ on a file you are uploading to an S3
-- bucket.
--
-- Some SFTP file transfer clients can attempt to change the attributes of
-- remote files, including timestamp and permissions, using commands, such
-- as @SETSTAT@ when uploading the file. However, these commands are not
-- compatible with object storage systems, such as Amazon S3. Due to this
-- incompatibility, file uploads from these clients can result in errors
-- even when the file is otherwise successfully uploaded.
--
-- Set the value to @ENABLE_NO_OP@ to have the Transfer Family server
-- ignore the @SETSTAT@ command, and upload files without needing to make
-- any changes to your SFTP client. While the @SetStatOption@
-- @ENABLE_NO_OP@ setting ignores the error, it does generate a log entry
-- in Amazon CloudWatch Logs, so you can determine when the client is
-- making a @SETSTAT@ call.
--
-- If you want to preserve the original timestamp for your file, and modify
-- other file attributes using @SETSTAT@, you can use Amazon EFS as backend
-- storage with Transfer Family.
--
-- 'tlsSessionResumptionMode', 'protocolDetails_tlsSessionResumptionMode' - A property used with Transfer Family servers that use the FTPS protocol.
-- TLS Session Resumption provides a mechanism to resume or share a
-- negotiated secret key between the control and data connection for an
-- FTPS session. @TlsSessionResumptionMode@ determines whether or not the
-- server resumes recent, negotiated sessions through a unique session ID.
-- This property is available during @CreateServer@ and @UpdateServer@
-- calls. If a @TlsSessionResumptionMode@ value is not specified during
-- @CreateServer@, it is set to @ENFORCED@ by default.
--
-- -   @DISABLED@: the server does not process TLS session resumption
--     client requests and creates a new TLS session for each request.
--
-- -   @ENABLED@: the server processes and accepts clients that are
--     performing TLS session resumption. The server doesn\'t reject client
--     data connections that do not perform the TLS session resumption
--     client processing.
--
-- -   @ENFORCED@: the server processes and accepts clients that are
--     performing TLS session resumption. The server rejects client data
--     connections that do not perform the TLS session resumption client
--     processing. Before you set the value to @ENFORCED@, test your
--     clients.
--
--     Not all FTPS clients perform TLS session resumption. So, if you
--     choose to enforce TLS session resumption, you prevent any
--     connections from FTPS clients that don\'t perform the protocol
--     negotiation. To determine whether or not you can use the @ENFORCED@
--     value, you need to test your clients.
newProtocolDetails ::
  ProtocolDetails
newProtocolDetails :: ProtocolDetails
newProtocolDetails =
  ProtocolDetails'
    { $sel:as2Transports:ProtocolDetails' :: Maybe (NonEmpty As2Transport)
as2Transports = forall a. Maybe a
Prelude.Nothing,
      $sel:passiveIp:ProtocolDetails' :: Maybe Text
passiveIp = forall a. Maybe a
Prelude.Nothing,
      $sel:setStatOption:ProtocolDetails' :: Maybe SetStatOption
setStatOption = forall a. Maybe a
Prelude.Nothing,
      $sel:tlsSessionResumptionMode:ProtocolDetails' :: Maybe TlsSessionResumptionMode
tlsSessionResumptionMode = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates the transport method for the AS2 messages. Currently, only
-- HTTP is supported.
protocolDetails_as2Transports :: Lens.Lens' ProtocolDetails (Prelude.Maybe (Prelude.NonEmpty As2Transport))
protocolDetails_as2Transports :: Lens' ProtocolDetails (Maybe (NonEmpty As2Transport))
protocolDetails_as2Transports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolDetails' {Maybe (NonEmpty As2Transport)
as2Transports :: Maybe (NonEmpty As2Transport)
$sel:as2Transports:ProtocolDetails' :: ProtocolDetails -> Maybe (NonEmpty As2Transport)
as2Transports} -> Maybe (NonEmpty As2Transport)
as2Transports) (\s :: ProtocolDetails
s@ProtocolDetails' {} Maybe (NonEmpty As2Transport)
a -> ProtocolDetails
s {$sel:as2Transports:ProtocolDetails' :: Maybe (NonEmpty As2Transport)
as2Transports = Maybe (NonEmpty As2Transport)
a} :: ProtocolDetails) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates passive mode, for FTP and FTPS protocols. Enter a single IPv4
-- address, such as the public IP address of a firewall, router, or load
-- balancer. For example:
--
-- @aws transfer update-server --protocol-details PassiveIp=0.0.0.0@
--
-- Replace @0.0.0.0@ in the example above with the actual IP address you
-- want to use.
--
-- If you change the @PassiveIp@ value, you must stop and then restart your
-- Transfer Family server for the change to take effect. For details on
-- using passive mode (PASV) in a NAT environment, see
-- <http://aws.amazon.com/blogs/storage/configuring-your-ftps-server-behind-a-firewall-or-nat-with-aws-transfer-family/ Configuring your FTPS server behind a firewall or NAT with Transfer Family>.
--
-- /Special values/
--
-- The @AUTO@ and @0.0.0.0@ are special values for the @PassiveIp@
-- parameter. The value @PassiveIp=AUTO@ is assigned by default to FTP and
-- FTPS type servers. In this case, the server automatically responds with
-- one of the endpoint IPs within the PASV response. @PassiveIp=0.0.0.0@
-- has a more unique application for its usage. For example, if you have a
-- High Availability (HA) Network Load Balancer (NLB) environment, where
-- you have 3 subnets, you can only specify a single IP address using the
-- @PassiveIp@ parameter. This reduces the effectiveness of having High
-- Availability. In this case, you can specify @PassiveIp=0.0.0.0@. This
-- tells the client to use the same IP address as the Control connection
-- and utilize all AZs for their connections. Note, however, that not all
-- FTP clients support the @PassiveIp=0.0.0.0@ response. FileZilla and
-- WinSCP do support it. If you are using other clients, check to see if
-- your client supports the @PassiveIp=0.0.0.0@ response.
protocolDetails_passiveIp :: Lens.Lens' ProtocolDetails (Prelude.Maybe Prelude.Text)
protocolDetails_passiveIp :: Lens' ProtocolDetails (Maybe Text)
protocolDetails_passiveIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolDetails' {Maybe Text
passiveIp :: Maybe Text
$sel:passiveIp:ProtocolDetails' :: ProtocolDetails -> Maybe Text
passiveIp} -> Maybe Text
passiveIp) (\s :: ProtocolDetails
s@ProtocolDetails' {} Maybe Text
a -> ProtocolDetails
s {$sel:passiveIp:ProtocolDetails' :: Maybe Text
passiveIp = Maybe Text
a} :: ProtocolDetails)

-- | Use the @SetStatOption@ to ignore the error that is generated when the
-- client attempts to use @SETSTAT@ on a file you are uploading to an S3
-- bucket.
--
-- Some SFTP file transfer clients can attempt to change the attributes of
-- remote files, including timestamp and permissions, using commands, such
-- as @SETSTAT@ when uploading the file. However, these commands are not
-- compatible with object storage systems, such as Amazon S3. Due to this
-- incompatibility, file uploads from these clients can result in errors
-- even when the file is otherwise successfully uploaded.
--
-- Set the value to @ENABLE_NO_OP@ to have the Transfer Family server
-- ignore the @SETSTAT@ command, and upload files without needing to make
-- any changes to your SFTP client. While the @SetStatOption@
-- @ENABLE_NO_OP@ setting ignores the error, it does generate a log entry
-- in Amazon CloudWatch Logs, so you can determine when the client is
-- making a @SETSTAT@ call.
--
-- If you want to preserve the original timestamp for your file, and modify
-- other file attributes using @SETSTAT@, you can use Amazon EFS as backend
-- storage with Transfer Family.
protocolDetails_setStatOption :: Lens.Lens' ProtocolDetails (Prelude.Maybe SetStatOption)
protocolDetails_setStatOption :: Lens' ProtocolDetails (Maybe SetStatOption)
protocolDetails_setStatOption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolDetails' {Maybe SetStatOption
setStatOption :: Maybe SetStatOption
$sel:setStatOption:ProtocolDetails' :: ProtocolDetails -> Maybe SetStatOption
setStatOption} -> Maybe SetStatOption
setStatOption) (\s :: ProtocolDetails
s@ProtocolDetails' {} Maybe SetStatOption
a -> ProtocolDetails
s {$sel:setStatOption:ProtocolDetails' :: Maybe SetStatOption
setStatOption = Maybe SetStatOption
a} :: ProtocolDetails)

-- | A property used with Transfer Family servers that use the FTPS protocol.
-- TLS Session Resumption provides a mechanism to resume or share a
-- negotiated secret key between the control and data connection for an
-- FTPS session. @TlsSessionResumptionMode@ determines whether or not the
-- server resumes recent, negotiated sessions through a unique session ID.
-- This property is available during @CreateServer@ and @UpdateServer@
-- calls. If a @TlsSessionResumptionMode@ value is not specified during
-- @CreateServer@, it is set to @ENFORCED@ by default.
--
-- -   @DISABLED@: the server does not process TLS session resumption
--     client requests and creates a new TLS session for each request.
--
-- -   @ENABLED@: the server processes and accepts clients that are
--     performing TLS session resumption. The server doesn\'t reject client
--     data connections that do not perform the TLS session resumption
--     client processing.
--
-- -   @ENFORCED@: the server processes and accepts clients that are
--     performing TLS session resumption. The server rejects client data
--     connections that do not perform the TLS session resumption client
--     processing. Before you set the value to @ENFORCED@, test your
--     clients.
--
--     Not all FTPS clients perform TLS session resumption. So, if you
--     choose to enforce TLS session resumption, you prevent any
--     connections from FTPS clients that don\'t perform the protocol
--     negotiation. To determine whether or not you can use the @ENFORCED@
--     value, you need to test your clients.
protocolDetails_tlsSessionResumptionMode :: Lens.Lens' ProtocolDetails (Prelude.Maybe TlsSessionResumptionMode)
protocolDetails_tlsSessionResumptionMode :: Lens' ProtocolDetails (Maybe TlsSessionResumptionMode)
protocolDetails_tlsSessionResumptionMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolDetails' {Maybe TlsSessionResumptionMode
tlsSessionResumptionMode :: Maybe TlsSessionResumptionMode
$sel:tlsSessionResumptionMode:ProtocolDetails' :: ProtocolDetails -> Maybe TlsSessionResumptionMode
tlsSessionResumptionMode} -> Maybe TlsSessionResumptionMode
tlsSessionResumptionMode) (\s :: ProtocolDetails
s@ProtocolDetails' {} Maybe TlsSessionResumptionMode
a -> ProtocolDetails
s {$sel:tlsSessionResumptionMode:ProtocolDetails' :: Maybe TlsSessionResumptionMode
tlsSessionResumptionMode = Maybe TlsSessionResumptionMode
a} :: ProtocolDetails)

instance Data.FromJSON ProtocolDetails where
  parseJSON :: Value -> Parser ProtocolDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProtocolDetails"
      ( \Object
x ->
          Maybe (NonEmpty As2Transport)
-> Maybe Text
-> Maybe SetStatOption
-> Maybe TlsSessionResumptionMode
-> ProtocolDetails
ProtocolDetails'
            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
"As2Transports")
            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
"PassiveIp")
            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
"SetStatOption")
            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
"TlsSessionResumptionMode")
      )

instance Prelude.Hashable ProtocolDetails where
  hashWithSalt :: Int -> ProtocolDetails -> Int
hashWithSalt Int
_salt ProtocolDetails' {Maybe (NonEmpty As2Transport)
Maybe Text
Maybe SetStatOption
Maybe TlsSessionResumptionMode
tlsSessionResumptionMode :: Maybe TlsSessionResumptionMode
setStatOption :: Maybe SetStatOption
passiveIp :: Maybe Text
as2Transports :: Maybe (NonEmpty As2Transport)
$sel:tlsSessionResumptionMode:ProtocolDetails' :: ProtocolDetails -> Maybe TlsSessionResumptionMode
$sel:setStatOption:ProtocolDetails' :: ProtocolDetails -> Maybe SetStatOption
$sel:passiveIp:ProtocolDetails' :: ProtocolDetails -> Maybe Text
$sel:as2Transports:ProtocolDetails' :: ProtocolDetails -> Maybe (NonEmpty As2Transport)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty As2Transport)
as2Transports
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
passiveIp
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetStatOption
setStatOption
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TlsSessionResumptionMode
tlsSessionResumptionMode

instance Prelude.NFData ProtocolDetails where
  rnf :: ProtocolDetails -> ()
rnf ProtocolDetails' {Maybe (NonEmpty As2Transport)
Maybe Text
Maybe SetStatOption
Maybe TlsSessionResumptionMode
tlsSessionResumptionMode :: Maybe TlsSessionResumptionMode
setStatOption :: Maybe SetStatOption
passiveIp :: Maybe Text
as2Transports :: Maybe (NonEmpty As2Transport)
$sel:tlsSessionResumptionMode:ProtocolDetails' :: ProtocolDetails -> Maybe TlsSessionResumptionMode
$sel:setStatOption:ProtocolDetails' :: ProtocolDetails -> Maybe SetStatOption
$sel:passiveIp:ProtocolDetails' :: ProtocolDetails -> Maybe Text
$sel:as2Transports:ProtocolDetails' :: ProtocolDetails -> Maybe (NonEmpty As2Transport)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty As2Transport)
as2Transports
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
passiveIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SetStatOption
setStatOption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TlsSessionResumptionMode
tlsSessionResumptionMode

instance Data.ToJSON ProtocolDetails where
  toJSON :: ProtocolDetails -> Value
toJSON ProtocolDetails' {Maybe (NonEmpty As2Transport)
Maybe Text
Maybe SetStatOption
Maybe TlsSessionResumptionMode
tlsSessionResumptionMode :: Maybe TlsSessionResumptionMode
setStatOption :: Maybe SetStatOption
passiveIp :: Maybe Text
as2Transports :: Maybe (NonEmpty As2Transport)
$sel:tlsSessionResumptionMode:ProtocolDetails' :: ProtocolDetails -> Maybe TlsSessionResumptionMode
$sel:setStatOption:ProtocolDetails' :: ProtocolDetails -> Maybe SetStatOption
$sel:passiveIp:ProtocolDetails' :: ProtocolDetails -> Maybe Text
$sel:as2Transports:ProtocolDetails' :: ProtocolDetails -> Maybe (NonEmpty As2Transport)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"As2Transports" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty As2Transport)
as2Transports,
            (Key
"PassiveIp" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
passiveIp,
            (Key
"SetStatOption" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetStatOption
setStatOption,
            (Key
"TlsSessionResumptionMode" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TlsSessionResumptionMode
tlsSessionResumptionMode
          ]
      )