{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.UpdateServer
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the file transfer protocol-enabled server\'s properties after
-- that server has been created.
--
-- The @UpdateServer@ call returns the @ServerId@ of the server you
-- updated.
module Amazonka.Transfer.UpdateServer
  ( -- * Creating a Request
    UpdateServer (..),
    newUpdateServer,

    -- * Request Lenses
    updateServer_certificate,
    updateServer_endpointDetails,
    updateServer_endpointType,
    updateServer_hostKey,
    updateServer_identityProviderDetails,
    updateServer_loggingRole,
    updateServer_postAuthenticationLoginBanner,
    updateServer_preAuthenticationLoginBanner,
    updateServer_protocolDetails,
    updateServer_protocols,
    updateServer_securityPolicyName,
    updateServer_workflowDetails,
    updateServer_serverId,

    -- * Destructuring the Response
    UpdateServerResponse (..),
    newUpdateServerResponse,

    -- * Response Lenses
    updateServerResponse_httpStatus,
    updateServerResponse_serverId,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Transfer.Types

-- | /See:/ 'newUpdateServer' smart constructor.
data UpdateServer = UpdateServer'
  { -- | The Amazon Resource Name (ARN) of the Amazon Web ServicesCertificate
    -- Manager (ACM) certificate. Required when @Protocols@ is set to @FTPS@.
    --
    -- To request a new public certificate, see
    -- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html Request a public certificate>
    -- in the /Amazon Web ServicesCertificate Manager User Guide/.
    --
    -- To import an existing certificate into ACM, see
    -- <https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html Importing certificates into ACM>
    -- in the /Amazon Web ServicesCertificate Manager User Guide/.
    --
    -- To request a private certificate to use FTPS through private IP
    -- addresses, see
    -- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html Request a private certificate>
    -- in the /Amazon Web ServicesCertificate Manager User Guide/.
    --
    -- Certificates with the following cryptographic algorithms and key sizes
    -- are supported:
    --
    -- -   2048-bit RSA (RSA_2048)
    --
    -- -   4096-bit RSA (RSA_4096)
    --
    -- -   Elliptic Prime Curve 256 bit (EC_prime256v1)
    --
    -- -   Elliptic Prime Curve 384 bit (EC_secp384r1)
    --
    -- -   Elliptic Prime Curve 521 bit (EC_secp521r1)
    --
    -- The certificate must be a valid SSL\/TLS X.509 version 3 certificate
    -- with FQDN or IP address specified and information about the issuer.
    UpdateServer -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
    -- | The virtual private cloud (VPC) endpoint settings that are configured
    -- for your server. When you host your endpoint within your VPC, you can
    -- make your endpoint accessible only to resources within your VPC, or you
    -- can attach Elastic IP addresses and make your endpoint accessible to
    -- clients over the internet. Your VPC\'s default security groups are
    -- automatically assigned to your endpoint.
    UpdateServer -> Maybe EndpointDetails
endpointDetails :: Prelude.Maybe EndpointDetails,
    -- | The type of endpoint that you want your server to use. You can choose to
    -- make your server\'s endpoint publicly accessible (PUBLIC) or host it
    -- inside your VPC. With an endpoint that is hosted in a VPC, you can
    -- restrict access to your server and resources only within your VPC or
    -- choose to make it internet facing by attaching Elastic IP addresses
    -- directly to it.
    --
    -- After May 19, 2021, you won\'t be able to create a server using
    -- @EndpointType=VPC_ENDPOINT@ in your Amazon Web Servicesaccount if your
    -- account hasn\'t already done so before May 19, 2021. If you have already
    -- created servers with @EndpointType=VPC_ENDPOINT@ in your Amazon Web
    -- Servicesaccount on or before May 19, 2021, you will not be affected.
    -- After this date, use @EndpointType@=@VPC@.
    --
    -- For more information, see
    -- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
    --
    -- It is recommended that you use @VPC@ as the @EndpointType@. With this
    -- endpoint type, you have the option to directly associate up to three
    -- Elastic IPv4 addresses (BYO IP included) with your server\'s endpoint
    -- and use VPC security groups to restrict traffic by the client\'s public
    -- IP address. This is not possible with @EndpointType@ set to
    -- @VPC_ENDPOINT@.
    UpdateServer -> Maybe EndpointType
endpointType :: Prelude.Maybe EndpointType,
    -- | The RSA, ECDSA, or ED25519 private key to use for your SFTP-enabled
    -- server. You can add multiple host keys, in case you want to rotate keys,
    -- or have a set of active keys that use different algorithms.
    --
    -- Use the following command to generate an RSA 2048 bit key with no
    -- passphrase:
    --
    -- @ssh-keygen -t rsa -b 2048 -N \"\" -m PEM -f my-new-server-key@.
    --
    -- Use a minimum value of 2048 for the @-b@ option. You can create a
    -- stronger key by using 3072 or 4096.
    --
    -- Use the following command to generate an ECDSA 256 bit key with no
    -- passphrase:
    --
    -- @ssh-keygen -t ecdsa -b 256 -N \"\" -m PEM -f my-new-server-key@.
    --
    -- Valid values for the @-b@ option for ECDSA are 256, 384, and 521.
    --
    -- Use the following command to generate an ED25519 key with no passphrase:
    --
    -- @ssh-keygen -t ed25519 -N \"\" -f my-new-server-key@.
    --
    -- For all of these commands, you can replace /my-new-server-key/ with a
    -- string of your choice.
    --
    -- If you aren\'t planning to migrate existing users from an existing
    -- SFTP-enabled server to a new server, don\'t update the host key.
    -- Accidentally changing a server\'s host key can be disruptive.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key Update host keys for your SFTP-enabled server>
    -- in the /Transfer Family User Guide/.
    UpdateServer -> Maybe (Sensitive Text)
hostKey :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | An array containing all of the information required to call a
    -- customer\'s authentication API method.
    UpdateServer -> Maybe IdentityProviderDetails
identityProviderDetails :: Prelude.Maybe IdentityProviderDetails,
    -- | The Amazon Resource Name (ARN) of the Identity and Access Management
    -- (IAM) role that allows a server to turn on Amazon CloudWatch logging for
    -- Amazon S3 or Amazon EFSevents. When set, you can view user activity in
    -- your CloudWatch logs.
    UpdateServer -> Maybe Text
loggingRole :: Prelude.Maybe Prelude.Text,
    -- | Specifies a string to display when users connect to a server. This
    -- string is displayed after the user authenticates.
    --
    -- The SFTP protocol does not support post-authentication display banners.
    UpdateServer -> Maybe Text
postAuthenticationLoginBanner :: Prelude.Maybe Prelude.Text,
    -- | Specifies a string to display when users connect to a server. This
    -- string is displayed before the user authenticates. For example, the
    -- following banner displays details about using the system:
    --
    -- @This system is for the use of authorized users only. Individuals using this computer system without authority, or in excess of their authority, are subject to having all of their activities on this system monitored and recorded by system personnel.@
    UpdateServer -> Maybe Text
preAuthenticationLoginBanner :: Prelude.Maybe Prelude.Text,
    -- | The protocol settings that are configured for your server.
    --
    -- -   To indicate passive mode (for FTP and FTPS protocols), use the
    --     @PassiveIp@ parameter. Enter a single dotted-quad IPv4 address, such
    --     as the external IP address of a firewall, router, or load balancer.
    --
    -- -   To ignore the error that is generated when the client attempts to
    --     use the @SETSTAT@ command on a file that you are uploading to an
    --     Amazon S3 bucket, use the @SetStatOption@ parameter. To have the
    --     Transfer Family server ignore the @SETSTAT@ command and upload files
    --     without needing to make any changes to your SFTP client, set the
    --     value to @ENABLE_NO_OP@. If you set the @SetStatOption@ parameter to
    --     @ENABLE_NO_OP@, Transfer Family generates a log entry to Amazon
    --     CloudWatch Logs, so that you can determine when the client is making
    --     a @SETSTAT@ call.
    --
    -- -   To determine whether your Transfer Family server resumes recent,
    --     negotiated sessions through a unique session ID, use the
    --     @TlsSessionResumptionMode@ parameter.
    --
    -- -   @As2Transports@ indicates the transport method for the AS2 messages.
    --     Currently, only HTTP is supported.
    UpdateServer -> Maybe ProtocolDetails
protocolDetails :: Prelude.Maybe ProtocolDetails,
    -- | Specifies the file transfer protocol or protocols over which your file
    -- transfer protocol client can connect to your server\'s endpoint. The
    -- available protocols are:
    --
    -- -   @SFTP@ (Secure Shell (SSH) File Transfer Protocol): File transfer
    --     over SSH
    --
    -- -   @FTPS@ (File Transfer Protocol Secure): File transfer with TLS
    --     encryption
    --
    -- -   @FTP@ (File Transfer Protocol): Unencrypted file transfer
    --
    -- -   @AS2@ (Applicability Statement 2): used for transporting structured
    --     business-to-business data
    --
    -- -   If you select @FTPS@, you must choose a certificate stored in
    --     Certificate Manager (ACM) which is used to identify your server when
    --     clients connect to it over FTPS.
    --
    -- -   If @Protocol@ includes either @FTP@ or @FTPS@, then the
    --     @EndpointType@ must be @VPC@ and the @IdentityProviderType@ must be
    --     @AWS_DIRECTORY_SERVICE@ or @API_GATEWAY@.
    --
    -- -   If @Protocol@ includes @FTP@, then @AddressAllocationIds@ cannot be
    --     associated.
    --
    -- -   If @Protocol@ is set only to @SFTP@, the @EndpointType@ can be set
    --     to @PUBLIC@ and the @IdentityProviderType@ can be set to
    --     @SERVICE_MANAGED@.
    --
    -- -   If @Protocol@ includes @AS2@, then the @EndpointType@ must be @VPC@,
    --     and domain must be Amazon S3.
    UpdateServer -> Maybe (NonEmpty Protocol)
protocols :: Prelude.Maybe (Prelude.NonEmpty Protocol),
    -- | Specifies the name of the security policy that is attached to the
    -- server.
    UpdateServer -> Maybe Text
securityPolicyName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the workflow ID for the workflow to assign and the execution
    -- role that\'s used for executing the workflow.
    --
    -- In additon to a workflow to execute when a file is uploaded completely,
    -- @WorkflowDeatails@ can also contain a workflow ID (and execution role)
    -- for a workflow to execute on partial upload. A partial upload occurs
    -- when a file is open when the session disconnects.
    --
    -- To remove an associated workflow from a server, you can provide an empty
    -- @OnUpload@ object, as in the following example.
    --
    -- @aws transfer update-server --server-id s-01234567890abcdef --workflow-details \'{\"OnUpload\":[]}\'@
    UpdateServer -> Maybe WorkflowDetails
workflowDetails :: Prelude.Maybe WorkflowDetails,
    -- | A system-assigned unique identifier for a server instance that the user
    -- account is assigned to.
    UpdateServer -> Text
serverId :: Prelude.Text
  }
  deriving (UpdateServer -> UpdateServer -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServer -> UpdateServer -> Bool
$c/= :: UpdateServer -> UpdateServer -> Bool
== :: UpdateServer -> UpdateServer -> Bool
$c== :: UpdateServer -> UpdateServer -> Bool
Prelude.Eq, Int -> UpdateServer -> ShowS
[UpdateServer] -> ShowS
UpdateServer -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServer] -> ShowS
$cshowList :: [UpdateServer] -> ShowS
show :: UpdateServer -> String
$cshow :: UpdateServer -> String
showsPrec :: Int -> UpdateServer -> ShowS
$cshowsPrec :: Int -> UpdateServer -> ShowS
Prelude.Show, forall x. Rep UpdateServer x -> UpdateServer
forall x. UpdateServer -> Rep UpdateServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServer x -> UpdateServer
$cfrom :: forall x. UpdateServer -> Rep UpdateServer x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServer' 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:
--
-- 'certificate', 'updateServer_certificate' - The Amazon Resource Name (ARN) of the Amazon Web ServicesCertificate
-- Manager (ACM) certificate. Required when @Protocols@ is set to @FTPS@.
--
-- To request a new public certificate, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html Request a public certificate>
-- in the /Amazon Web ServicesCertificate Manager User Guide/.
--
-- To import an existing certificate into ACM, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html Importing certificates into ACM>
-- in the /Amazon Web ServicesCertificate Manager User Guide/.
--
-- To request a private certificate to use FTPS through private IP
-- addresses, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html Request a private certificate>
-- in the /Amazon Web ServicesCertificate Manager User Guide/.
--
-- Certificates with the following cryptographic algorithms and key sizes
-- are supported:
--
-- -   2048-bit RSA (RSA_2048)
--
-- -   4096-bit RSA (RSA_4096)
--
-- -   Elliptic Prime Curve 256 bit (EC_prime256v1)
--
-- -   Elliptic Prime Curve 384 bit (EC_secp384r1)
--
-- -   Elliptic Prime Curve 521 bit (EC_secp521r1)
--
-- The certificate must be a valid SSL\/TLS X.509 version 3 certificate
-- with FQDN or IP address specified and information about the issuer.
--
-- 'endpointDetails', 'updateServer_endpointDetails' - The virtual private cloud (VPC) endpoint settings that are configured
-- for your server. When you host your endpoint within your VPC, you can
-- make your endpoint accessible only to resources within your VPC, or you
-- can attach Elastic IP addresses and make your endpoint accessible to
-- clients over the internet. Your VPC\'s default security groups are
-- automatically assigned to your endpoint.
--
-- 'endpointType', 'updateServer_endpointType' - The type of endpoint that you want your server to use. You can choose to
-- make your server\'s endpoint publicly accessible (PUBLIC) or host it
-- inside your VPC. With an endpoint that is hosted in a VPC, you can
-- restrict access to your server and resources only within your VPC or
-- choose to make it internet facing by attaching Elastic IP addresses
-- directly to it.
--
-- After May 19, 2021, you won\'t be able to create a server using
-- @EndpointType=VPC_ENDPOINT@ in your Amazon Web Servicesaccount if your
-- account hasn\'t already done so before May 19, 2021. If you have already
-- created servers with @EndpointType=VPC_ENDPOINT@ in your Amazon Web
-- Servicesaccount on or before May 19, 2021, you will not be affected.
-- After this date, use @EndpointType@=@VPC@.
--
-- For more information, see
-- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
--
-- It is recommended that you use @VPC@ as the @EndpointType@. With this
-- endpoint type, you have the option to directly associate up to three
-- Elastic IPv4 addresses (BYO IP included) with your server\'s endpoint
-- and use VPC security groups to restrict traffic by the client\'s public
-- IP address. This is not possible with @EndpointType@ set to
-- @VPC_ENDPOINT@.
--
-- 'hostKey', 'updateServer_hostKey' - The RSA, ECDSA, or ED25519 private key to use for your SFTP-enabled
-- server. You can add multiple host keys, in case you want to rotate keys,
-- or have a set of active keys that use different algorithms.
--
-- Use the following command to generate an RSA 2048 bit key with no
-- passphrase:
--
-- @ssh-keygen -t rsa -b 2048 -N \"\" -m PEM -f my-new-server-key@.
--
-- Use a minimum value of 2048 for the @-b@ option. You can create a
-- stronger key by using 3072 or 4096.
--
-- Use the following command to generate an ECDSA 256 bit key with no
-- passphrase:
--
-- @ssh-keygen -t ecdsa -b 256 -N \"\" -m PEM -f my-new-server-key@.
--
-- Valid values for the @-b@ option for ECDSA are 256, 384, and 521.
--
-- Use the following command to generate an ED25519 key with no passphrase:
--
-- @ssh-keygen -t ed25519 -N \"\" -f my-new-server-key@.
--
-- For all of these commands, you can replace /my-new-server-key/ with a
-- string of your choice.
--
-- If you aren\'t planning to migrate existing users from an existing
-- SFTP-enabled server to a new server, don\'t update the host key.
-- Accidentally changing a server\'s host key can be disruptive.
--
-- For more information, see
-- <https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key Update host keys for your SFTP-enabled server>
-- in the /Transfer Family User Guide/.
--
-- 'identityProviderDetails', 'updateServer_identityProviderDetails' - An array containing all of the information required to call a
-- customer\'s authentication API method.
--
-- 'loggingRole', 'updateServer_loggingRole' - The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role that allows a server to turn on Amazon CloudWatch logging for
-- Amazon S3 or Amazon EFSevents. When set, you can view user activity in
-- your CloudWatch logs.
--
-- 'postAuthenticationLoginBanner', 'updateServer_postAuthenticationLoginBanner' - Specifies a string to display when users connect to a server. This
-- string is displayed after the user authenticates.
--
-- The SFTP protocol does not support post-authentication display banners.
--
-- 'preAuthenticationLoginBanner', 'updateServer_preAuthenticationLoginBanner' - Specifies a string to display when users connect to a server. This
-- string is displayed before the user authenticates. For example, the
-- following banner displays details about using the system:
--
-- @This system is for the use of authorized users only. Individuals using this computer system without authority, or in excess of their authority, are subject to having all of their activities on this system monitored and recorded by system personnel.@
--
-- 'protocolDetails', 'updateServer_protocolDetails' - The protocol settings that are configured for your server.
--
-- -   To indicate passive mode (for FTP and FTPS protocols), use the
--     @PassiveIp@ parameter. Enter a single dotted-quad IPv4 address, such
--     as the external IP address of a firewall, router, or load balancer.
--
-- -   To ignore the error that is generated when the client attempts to
--     use the @SETSTAT@ command on a file that you are uploading to an
--     Amazon S3 bucket, use the @SetStatOption@ parameter. To have the
--     Transfer Family server ignore the @SETSTAT@ command and upload files
--     without needing to make any changes to your SFTP client, set the
--     value to @ENABLE_NO_OP@. If you set the @SetStatOption@ parameter to
--     @ENABLE_NO_OP@, Transfer Family generates a log entry to Amazon
--     CloudWatch Logs, so that you can determine when the client is making
--     a @SETSTAT@ call.
--
-- -   To determine whether your Transfer Family server resumes recent,
--     negotiated sessions through a unique session ID, use the
--     @TlsSessionResumptionMode@ parameter.
--
-- -   @As2Transports@ indicates the transport method for the AS2 messages.
--     Currently, only HTTP is supported.
--
-- 'protocols', 'updateServer_protocols' - Specifies the file transfer protocol or protocols over which your file
-- transfer protocol client can connect to your server\'s endpoint. The
-- available protocols are:
--
-- -   @SFTP@ (Secure Shell (SSH) File Transfer Protocol): File transfer
--     over SSH
--
-- -   @FTPS@ (File Transfer Protocol Secure): File transfer with TLS
--     encryption
--
-- -   @FTP@ (File Transfer Protocol): Unencrypted file transfer
--
-- -   @AS2@ (Applicability Statement 2): used for transporting structured
--     business-to-business data
--
-- -   If you select @FTPS@, you must choose a certificate stored in
--     Certificate Manager (ACM) which is used to identify your server when
--     clients connect to it over FTPS.
--
-- -   If @Protocol@ includes either @FTP@ or @FTPS@, then the
--     @EndpointType@ must be @VPC@ and the @IdentityProviderType@ must be
--     @AWS_DIRECTORY_SERVICE@ or @API_GATEWAY@.
--
-- -   If @Protocol@ includes @FTP@, then @AddressAllocationIds@ cannot be
--     associated.
--
-- -   If @Protocol@ is set only to @SFTP@, the @EndpointType@ can be set
--     to @PUBLIC@ and the @IdentityProviderType@ can be set to
--     @SERVICE_MANAGED@.
--
-- -   If @Protocol@ includes @AS2@, then the @EndpointType@ must be @VPC@,
--     and domain must be Amazon S3.
--
-- 'securityPolicyName', 'updateServer_securityPolicyName' - Specifies the name of the security policy that is attached to the
-- server.
--
-- 'workflowDetails', 'updateServer_workflowDetails' - Specifies the workflow ID for the workflow to assign and the execution
-- role that\'s used for executing the workflow.
--
-- In additon to a workflow to execute when a file is uploaded completely,
-- @WorkflowDeatails@ can also contain a workflow ID (and execution role)
-- for a workflow to execute on partial upload. A partial upload occurs
-- when a file is open when the session disconnects.
--
-- To remove an associated workflow from a server, you can provide an empty
-- @OnUpload@ object, as in the following example.
--
-- @aws transfer update-server --server-id s-01234567890abcdef --workflow-details \'{\"OnUpload\":[]}\'@
--
-- 'serverId', 'updateServer_serverId' - A system-assigned unique identifier for a server instance that the user
-- account is assigned to.
newUpdateServer ::
  -- | 'serverId'
  Prelude.Text ->
  UpdateServer
newUpdateServer :: Text -> UpdateServer
newUpdateServer Text
pServerId_ =
  UpdateServer'
    { $sel:certificate:UpdateServer' :: Maybe Text
certificate = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointDetails:UpdateServer' :: Maybe EndpointDetails
endpointDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:UpdateServer' :: Maybe EndpointType
endpointType = forall a. Maybe a
Prelude.Nothing,
      $sel:hostKey:UpdateServer' :: Maybe (Sensitive Text)
hostKey = forall a. Maybe a
Prelude.Nothing,
      $sel:identityProviderDetails:UpdateServer' :: Maybe IdentityProviderDetails
identityProviderDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:loggingRole:UpdateServer' :: Maybe Text
loggingRole = forall a. Maybe a
Prelude.Nothing,
      $sel:postAuthenticationLoginBanner:UpdateServer' :: Maybe Text
postAuthenticationLoginBanner = forall a. Maybe a
Prelude.Nothing,
      $sel:preAuthenticationLoginBanner:UpdateServer' :: Maybe Text
preAuthenticationLoginBanner = forall a. Maybe a
Prelude.Nothing,
      $sel:protocolDetails:UpdateServer' :: Maybe ProtocolDetails
protocolDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:protocols:UpdateServer' :: Maybe (NonEmpty Protocol)
protocols = forall a. Maybe a
Prelude.Nothing,
      $sel:securityPolicyName:UpdateServer' :: Maybe Text
securityPolicyName = forall a. Maybe a
Prelude.Nothing,
      $sel:workflowDetails:UpdateServer' :: Maybe WorkflowDetails
workflowDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:serverId:UpdateServer' :: Text
serverId = Text
pServerId_
    }

-- | The Amazon Resource Name (ARN) of the Amazon Web ServicesCertificate
-- Manager (ACM) certificate. Required when @Protocols@ is set to @FTPS@.
--
-- To request a new public certificate, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html Request a public certificate>
-- in the /Amazon Web ServicesCertificate Manager User Guide/.
--
-- To import an existing certificate into ACM, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html Importing certificates into ACM>
-- in the /Amazon Web ServicesCertificate Manager User Guide/.
--
-- To request a private certificate to use FTPS through private IP
-- addresses, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-private.html Request a private certificate>
-- in the /Amazon Web ServicesCertificate Manager User Guide/.
--
-- Certificates with the following cryptographic algorithms and key sizes
-- are supported:
--
-- -   2048-bit RSA (RSA_2048)
--
-- -   4096-bit RSA (RSA_4096)
--
-- -   Elliptic Prime Curve 256 bit (EC_prime256v1)
--
-- -   Elliptic Prime Curve 384 bit (EC_secp384r1)
--
-- -   Elliptic Prime Curve 521 bit (EC_secp521r1)
--
-- The certificate must be a valid SSL\/TLS X.509 version 3 certificate
-- with FQDN or IP address specified and information about the issuer.
updateServer_certificate :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_certificate :: Lens' UpdateServer (Maybe Text)
updateServer_certificate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
certificate :: Maybe Text
$sel:certificate:UpdateServer' :: UpdateServer -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:certificate:UpdateServer' :: Maybe Text
certificate = Maybe Text
a} :: UpdateServer)

-- | The virtual private cloud (VPC) endpoint settings that are configured
-- for your server. When you host your endpoint within your VPC, you can
-- make your endpoint accessible only to resources within your VPC, or you
-- can attach Elastic IP addresses and make your endpoint accessible to
-- clients over the internet. Your VPC\'s default security groups are
-- automatically assigned to your endpoint.
updateServer_endpointDetails :: Lens.Lens' UpdateServer (Prelude.Maybe EndpointDetails)
updateServer_endpointDetails :: Lens' UpdateServer (Maybe EndpointDetails)
updateServer_endpointDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe EndpointDetails
endpointDetails :: Maybe EndpointDetails
$sel:endpointDetails:UpdateServer' :: UpdateServer -> Maybe EndpointDetails
endpointDetails} -> Maybe EndpointDetails
endpointDetails) (\s :: UpdateServer
s@UpdateServer' {} Maybe EndpointDetails
a -> UpdateServer
s {$sel:endpointDetails:UpdateServer' :: Maybe EndpointDetails
endpointDetails = Maybe EndpointDetails
a} :: UpdateServer)

-- | The type of endpoint that you want your server to use. You can choose to
-- make your server\'s endpoint publicly accessible (PUBLIC) or host it
-- inside your VPC. With an endpoint that is hosted in a VPC, you can
-- restrict access to your server and resources only within your VPC or
-- choose to make it internet facing by attaching Elastic IP addresses
-- directly to it.
--
-- After May 19, 2021, you won\'t be able to create a server using
-- @EndpointType=VPC_ENDPOINT@ in your Amazon Web Servicesaccount if your
-- account hasn\'t already done so before May 19, 2021. If you have already
-- created servers with @EndpointType=VPC_ENDPOINT@ in your Amazon Web
-- Servicesaccount on or before May 19, 2021, you will not be affected.
-- After this date, use @EndpointType@=@VPC@.
--
-- For more information, see
-- https:\/\/docs.aws.amazon.com\/transfer\/latest\/userguide\/create-server-in-vpc.html#deprecate-vpc-endpoint.
--
-- It is recommended that you use @VPC@ as the @EndpointType@. With this
-- endpoint type, you have the option to directly associate up to three
-- Elastic IPv4 addresses (BYO IP included) with your server\'s endpoint
-- and use VPC security groups to restrict traffic by the client\'s public
-- IP address. This is not possible with @EndpointType@ set to
-- @VPC_ENDPOINT@.
updateServer_endpointType :: Lens.Lens' UpdateServer (Prelude.Maybe EndpointType)
updateServer_endpointType :: Lens' UpdateServer (Maybe EndpointType)
updateServer_endpointType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe EndpointType
endpointType :: Maybe EndpointType
$sel:endpointType:UpdateServer' :: UpdateServer -> Maybe EndpointType
endpointType} -> Maybe EndpointType
endpointType) (\s :: UpdateServer
s@UpdateServer' {} Maybe EndpointType
a -> UpdateServer
s {$sel:endpointType:UpdateServer' :: Maybe EndpointType
endpointType = Maybe EndpointType
a} :: UpdateServer)

-- | The RSA, ECDSA, or ED25519 private key to use for your SFTP-enabled
-- server. You can add multiple host keys, in case you want to rotate keys,
-- or have a set of active keys that use different algorithms.
--
-- Use the following command to generate an RSA 2048 bit key with no
-- passphrase:
--
-- @ssh-keygen -t rsa -b 2048 -N \"\" -m PEM -f my-new-server-key@.
--
-- Use a minimum value of 2048 for the @-b@ option. You can create a
-- stronger key by using 3072 or 4096.
--
-- Use the following command to generate an ECDSA 256 bit key with no
-- passphrase:
--
-- @ssh-keygen -t ecdsa -b 256 -N \"\" -m PEM -f my-new-server-key@.
--
-- Valid values for the @-b@ option for ECDSA are 256, 384, and 521.
--
-- Use the following command to generate an ED25519 key with no passphrase:
--
-- @ssh-keygen -t ed25519 -N \"\" -f my-new-server-key@.
--
-- For all of these commands, you can replace /my-new-server-key/ with a
-- string of your choice.
--
-- If you aren\'t planning to migrate existing users from an existing
-- SFTP-enabled server to a new server, don\'t update the host key.
-- Accidentally changing a server\'s host key can be disruptive.
--
-- For more information, see
-- <https://docs.aws.amazon.com/transfer/latest/userguide/edit-server-config.html#configuring-servers-change-host-key Update host keys for your SFTP-enabled server>
-- in the /Transfer Family User Guide/.
updateServer_hostKey :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_hostKey :: Lens' UpdateServer (Maybe Text)
updateServer_hostKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe (Sensitive Text)
hostKey :: Maybe (Sensitive Text)
$sel:hostKey:UpdateServer' :: UpdateServer -> Maybe (Sensitive Text)
hostKey} -> Maybe (Sensitive Text)
hostKey) (\s :: UpdateServer
s@UpdateServer' {} Maybe (Sensitive Text)
a -> UpdateServer
s {$sel:hostKey:UpdateServer' :: Maybe (Sensitive Text)
hostKey = Maybe (Sensitive Text)
a} :: UpdateServer) 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

-- | An array containing all of the information required to call a
-- customer\'s authentication API method.
updateServer_identityProviderDetails :: Lens.Lens' UpdateServer (Prelude.Maybe IdentityProviderDetails)
updateServer_identityProviderDetails :: Lens' UpdateServer (Maybe IdentityProviderDetails)
updateServer_identityProviderDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe IdentityProviderDetails
identityProviderDetails :: Maybe IdentityProviderDetails
$sel:identityProviderDetails:UpdateServer' :: UpdateServer -> Maybe IdentityProviderDetails
identityProviderDetails} -> Maybe IdentityProviderDetails
identityProviderDetails) (\s :: UpdateServer
s@UpdateServer' {} Maybe IdentityProviderDetails
a -> UpdateServer
s {$sel:identityProviderDetails:UpdateServer' :: Maybe IdentityProviderDetails
identityProviderDetails = Maybe IdentityProviderDetails
a} :: UpdateServer)

-- | The Amazon Resource Name (ARN) of the Identity and Access Management
-- (IAM) role that allows a server to turn on Amazon CloudWatch logging for
-- Amazon S3 or Amazon EFSevents. When set, you can view user activity in
-- your CloudWatch logs.
updateServer_loggingRole :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_loggingRole :: Lens' UpdateServer (Maybe Text)
updateServer_loggingRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
loggingRole :: Maybe Text
$sel:loggingRole:UpdateServer' :: UpdateServer -> Maybe Text
loggingRole} -> Maybe Text
loggingRole) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:loggingRole:UpdateServer' :: Maybe Text
loggingRole = Maybe Text
a} :: UpdateServer)

-- | Specifies a string to display when users connect to a server. This
-- string is displayed after the user authenticates.
--
-- The SFTP protocol does not support post-authentication display banners.
updateServer_postAuthenticationLoginBanner :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_postAuthenticationLoginBanner :: Lens' UpdateServer (Maybe Text)
updateServer_postAuthenticationLoginBanner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
postAuthenticationLoginBanner :: Maybe Text
$sel:postAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
postAuthenticationLoginBanner} -> Maybe Text
postAuthenticationLoginBanner) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:postAuthenticationLoginBanner:UpdateServer' :: Maybe Text
postAuthenticationLoginBanner = Maybe Text
a} :: UpdateServer)

-- | Specifies a string to display when users connect to a server. This
-- string is displayed before the user authenticates. For example, the
-- following banner displays details about using the system:
--
-- @This system is for the use of authorized users only. Individuals using this computer system without authority, or in excess of their authority, are subject to having all of their activities on this system monitored and recorded by system personnel.@
updateServer_preAuthenticationLoginBanner :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_preAuthenticationLoginBanner :: Lens' UpdateServer (Maybe Text)
updateServer_preAuthenticationLoginBanner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
preAuthenticationLoginBanner :: Maybe Text
$sel:preAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
preAuthenticationLoginBanner} -> Maybe Text
preAuthenticationLoginBanner) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:preAuthenticationLoginBanner:UpdateServer' :: Maybe Text
preAuthenticationLoginBanner = Maybe Text
a} :: UpdateServer)

-- | The protocol settings that are configured for your server.
--
-- -   To indicate passive mode (for FTP and FTPS protocols), use the
--     @PassiveIp@ parameter. Enter a single dotted-quad IPv4 address, such
--     as the external IP address of a firewall, router, or load balancer.
--
-- -   To ignore the error that is generated when the client attempts to
--     use the @SETSTAT@ command on a file that you are uploading to an
--     Amazon S3 bucket, use the @SetStatOption@ parameter. To have the
--     Transfer Family server ignore the @SETSTAT@ command and upload files
--     without needing to make any changes to your SFTP client, set the
--     value to @ENABLE_NO_OP@. If you set the @SetStatOption@ parameter to
--     @ENABLE_NO_OP@, Transfer Family generates a log entry to Amazon
--     CloudWatch Logs, so that you can determine when the client is making
--     a @SETSTAT@ call.
--
-- -   To determine whether your Transfer Family server resumes recent,
--     negotiated sessions through a unique session ID, use the
--     @TlsSessionResumptionMode@ parameter.
--
-- -   @As2Transports@ indicates the transport method for the AS2 messages.
--     Currently, only HTTP is supported.
updateServer_protocolDetails :: Lens.Lens' UpdateServer (Prelude.Maybe ProtocolDetails)
updateServer_protocolDetails :: Lens' UpdateServer (Maybe ProtocolDetails)
updateServer_protocolDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe ProtocolDetails
protocolDetails :: Maybe ProtocolDetails
$sel:protocolDetails:UpdateServer' :: UpdateServer -> Maybe ProtocolDetails
protocolDetails} -> Maybe ProtocolDetails
protocolDetails) (\s :: UpdateServer
s@UpdateServer' {} Maybe ProtocolDetails
a -> UpdateServer
s {$sel:protocolDetails:UpdateServer' :: Maybe ProtocolDetails
protocolDetails = Maybe ProtocolDetails
a} :: UpdateServer)

-- | Specifies the file transfer protocol or protocols over which your file
-- transfer protocol client can connect to your server\'s endpoint. The
-- available protocols are:
--
-- -   @SFTP@ (Secure Shell (SSH) File Transfer Protocol): File transfer
--     over SSH
--
-- -   @FTPS@ (File Transfer Protocol Secure): File transfer with TLS
--     encryption
--
-- -   @FTP@ (File Transfer Protocol): Unencrypted file transfer
--
-- -   @AS2@ (Applicability Statement 2): used for transporting structured
--     business-to-business data
--
-- -   If you select @FTPS@, you must choose a certificate stored in
--     Certificate Manager (ACM) which is used to identify your server when
--     clients connect to it over FTPS.
--
-- -   If @Protocol@ includes either @FTP@ or @FTPS@, then the
--     @EndpointType@ must be @VPC@ and the @IdentityProviderType@ must be
--     @AWS_DIRECTORY_SERVICE@ or @API_GATEWAY@.
--
-- -   If @Protocol@ includes @FTP@, then @AddressAllocationIds@ cannot be
--     associated.
--
-- -   If @Protocol@ is set only to @SFTP@, the @EndpointType@ can be set
--     to @PUBLIC@ and the @IdentityProviderType@ can be set to
--     @SERVICE_MANAGED@.
--
-- -   If @Protocol@ includes @AS2@, then the @EndpointType@ must be @VPC@,
--     and domain must be Amazon S3.
updateServer_protocols :: Lens.Lens' UpdateServer (Prelude.Maybe (Prelude.NonEmpty Protocol))
updateServer_protocols :: Lens' UpdateServer (Maybe (NonEmpty Protocol))
updateServer_protocols = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe (NonEmpty Protocol)
protocols :: Maybe (NonEmpty Protocol)
$sel:protocols:UpdateServer' :: UpdateServer -> Maybe (NonEmpty Protocol)
protocols} -> Maybe (NonEmpty Protocol)
protocols) (\s :: UpdateServer
s@UpdateServer' {} Maybe (NonEmpty Protocol)
a -> UpdateServer
s {$sel:protocols:UpdateServer' :: Maybe (NonEmpty Protocol)
protocols = Maybe (NonEmpty Protocol)
a} :: UpdateServer) 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

-- | Specifies the name of the security policy that is attached to the
-- server.
updateServer_securityPolicyName :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_securityPolicyName :: Lens' UpdateServer (Maybe Text)
updateServer_securityPolicyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
securityPolicyName :: Maybe Text
$sel:securityPolicyName:UpdateServer' :: UpdateServer -> Maybe Text
securityPolicyName} -> Maybe Text
securityPolicyName) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:securityPolicyName:UpdateServer' :: Maybe Text
securityPolicyName = Maybe Text
a} :: UpdateServer)

-- | Specifies the workflow ID for the workflow to assign and the execution
-- role that\'s used for executing the workflow.
--
-- In additon to a workflow to execute when a file is uploaded completely,
-- @WorkflowDeatails@ can also contain a workflow ID (and execution role)
-- for a workflow to execute on partial upload. A partial upload occurs
-- when a file is open when the session disconnects.
--
-- To remove an associated workflow from a server, you can provide an empty
-- @OnUpload@ object, as in the following example.
--
-- @aws transfer update-server --server-id s-01234567890abcdef --workflow-details \'{\"OnUpload\":[]}\'@
updateServer_workflowDetails :: Lens.Lens' UpdateServer (Prelude.Maybe WorkflowDetails)
updateServer_workflowDetails :: Lens' UpdateServer (Maybe WorkflowDetails)
updateServer_workflowDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe WorkflowDetails
workflowDetails :: Maybe WorkflowDetails
$sel:workflowDetails:UpdateServer' :: UpdateServer -> Maybe WorkflowDetails
workflowDetails} -> Maybe WorkflowDetails
workflowDetails) (\s :: UpdateServer
s@UpdateServer' {} Maybe WorkflowDetails
a -> UpdateServer
s {$sel:workflowDetails:UpdateServer' :: Maybe WorkflowDetails
workflowDetails = Maybe WorkflowDetails
a} :: UpdateServer)

-- | A system-assigned unique identifier for a server instance that the user
-- account is assigned to.
updateServer_serverId :: Lens.Lens' UpdateServer Prelude.Text
updateServer_serverId :: Lens' UpdateServer Text
updateServer_serverId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Text
serverId :: Text
$sel:serverId:UpdateServer' :: UpdateServer -> Text
serverId} -> Text
serverId) (\s :: UpdateServer
s@UpdateServer' {} Text
a -> UpdateServer
s {$sel:serverId:UpdateServer' :: Text
serverId = Text
a} :: UpdateServer)

instance Core.AWSRequest UpdateServer where
  type AWSResponse UpdateServer = UpdateServerResponse
  request :: (Service -> Service) -> UpdateServer -> Request UpdateServer
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateServer)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> UpdateServerResponse
UpdateServerResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"ServerId")
      )

instance Prelude.Hashable UpdateServer where
  hashWithSalt :: Int -> UpdateServer -> Int
hashWithSalt Int
_salt UpdateServer' {Maybe (NonEmpty Protocol)
Maybe Text
Maybe (Sensitive Text)
Maybe EndpointDetails
Maybe EndpointType
Maybe IdentityProviderDetails
Maybe ProtocolDetails
Maybe WorkflowDetails
Text
serverId :: Text
workflowDetails :: Maybe WorkflowDetails
securityPolicyName :: Maybe Text
protocols :: Maybe (NonEmpty Protocol)
protocolDetails :: Maybe ProtocolDetails
preAuthenticationLoginBanner :: Maybe Text
postAuthenticationLoginBanner :: Maybe Text
loggingRole :: Maybe Text
identityProviderDetails :: Maybe IdentityProviderDetails
hostKey :: Maybe (Sensitive Text)
endpointType :: Maybe EndpointType
endpointDetails :: Maybe EndpointDetails
certificate :: Maybe Text
$sel:serverId:UpdateServer' :: UpdateServer -> Text
$sel:workflowDetails:UpdateServer' :: UpdateServer -> Maybe WorkflowDetails
$sel:securityPolicyName:UpdateServer' :: UpdateServer -> Maybe Text
$sel:protocols:UpdateServer' :: UpdateServer -> Maybe (NonEmpty Protocol)
$sel:protocolDetails:UpdateServer' :: UpdateServer -> Maybe ProtocolDetails
$sel:preAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
$sel:postAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
$sel:loggingRole:UpdateServer' :: UpdateServer -> Maybe Text
$sel:identityProviderDetails:UpdateServer' :: UpdateServer -> Maybe IdentityProviderDetails
$sel:hostKey:UpdateServer' :: UpdateServer -> Maybe (Sensitive Text)
$sel:endpointType:UpdateServer' :: UpdateServer -> Maybe EndpointType
$sel:endpointDetails:UpdateServer' :: UpdateServer -> Maybe EndpointDetails
$sel:certificate:UpdateServer' :: UpdateServer -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointDetails
endpointDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointType
endpointType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
hostKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IdentityProviderDetails
identityProviderDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
loggingRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
postAuthenticationLoginBanner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
preAuthenticationLoginBanner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProtocolDetails
protocolDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Protocol)
protocols
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
securityPolicyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkflowDetails
workflowDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverId

instance Prelude.NFData UpdateServer where
  rnf :: UpdateServer -> ()
rnf UpdateServer' {Maybe (NonEmpty Protocol)
Maybe Text
Maybe (Sensitive Text)
Maybe EndpointDetails
Maybe EndpointType
Maybe IdentityProviderDetails
Maybe ProtocolDetails
Maybe WorkflowDetails
Text
serverId :: Text
workflowDetails :: Maybe WorkflowDetails
securityPolicyName :: Maybe Text
protocols :: Maybe (NonEmpty Protocol)
protocolDetails :: Maybe ProtocolDetails
preAuthenticationLoginBanner :: Maybe Text
postAuthenticationLoginBanner :: Maybe Text
loggingRole :: Maybe Text
identityProviderDetails :: Maybe IdentityProviderDetails
hostKey :: Maybe (Sensitive Text)
endpointType :: Maybe EndpointType
endpointDetails :: Maybe EndpointDetails
certificate :: Maybe Text
$sel:serverId:UpdateServer' :: UpdateServer -> Text
$sel:workflowDetails:UpdateServer' :: UpdateServer -> Maybe WorkflowDetails
$sel:securityPolicyName:UpdateServer' :: UpdateServer -> Maybe Text
$sel:protocols:UpdateServer' :: UpdateServer -> Maybe (NonEmpty Protocol)
$sel:protocolDetails:UpdateServer' :: UpdateServer -> Maybe ProtocolDetails
$sel:preAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
$sel:postAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
$sel:loggingRole:UpdateServer' :: UpdateServer -> Maybe Text
$sel:identityProviderDetails:UpdateServer' :: UpdateServer -> Maybe IdentityProviderDetails
$sel:hostKey:UpdateServer' :: UpdateServer -> Maybe (Sensitive Text)
$sel:endpointType:UpdateServer' :: UpdateServer -> Maybe EndpointType
$sel:endpointDetails:UpdateServer' :: UpdateServer -> Maybe EndpointDetails
$sel:certificate:UpdateServer' :: UpdateServer -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointDetails
endpointDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointType
endpointType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
hostKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IdentityProviderDetails
identityProviderDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
loggingRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
postAuthenticationLoginBanner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
preAuthenticationLoginBanner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProtocolDetails
protocolDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Protocol)
protocols
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityPolicyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkflowDetails
workflowDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverId

instance Data.ToHeaders UpdateServer where
  toHeaders :: UpdateServer -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"TransferService.UpdateServer" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateServer where
  toJSON :: UpdateServer -> Value
toJSON UpdateServer' {Maybe (NonEmpty Protocol)
Maybe Text
Maybe (Sensitive Text)
Maybe EndpointDetails
Maybe EndpointType
Maybe IdentityProviderDetails
Maybe ProtocolDetails
Maybe WorkflowDetails
Text
serverId :: Text
workflowDetails :: Maybe WorkflowDetails
securityPolicyName :: Maybe Text
protocols :: Maybe (NonEmpty Protocol)
protocolDetails :: Maybe ProtocolDetails
preAuthenticationLoginBanner :: Maybe Text
postAuthenticationLoginBanner :: Maybe Text
loggingRole :: Maybe Text
identityProviderDetails :: Maybe IdentityProviderDetails
hostKey :: Maybe (Sensitive Text)
endpointType :: Maybe EndpointType
endpointDetails :: Maybe EndpointDetails
certificate :: Maybe Text
$sel:serverId:UpdateServer' :: UpdateServer -> Text
$sel:workflowDetails:UpdateServer' :: UpdateServer -> Maybe WorkflowDetails
$sel:securityPolicyName:UpdateServer' :: UpdateServer -> Maybe Text
$sel:protocols:UpdateServer' :: UpdateServer -> Maybe (NonEmpty Protocol)
$sel:protocolDetails:UpdateServer' :: UpdateServer -> Maybe ProtocolDetails
$sel:preAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
$sel:postAuthenticationLoginBanner:UpdateServer' :: UpdateServer -> Maybe Text
$sel:loggingRole:UpdateServer' :: UpdateServer -> Maybe Text
$sel:identityProviderDetails:UpdateServer' :: UpdateServer -> Maybe IdentityProviderDetails
$sel:hostKey:UpdateServer' :: UpdateServer -> Maybe (Sensitive Text)
$sel:endpointType:UpdateServer' :: UpdateServer -> Maybe EndpointType
$sel:endpointDetails:UpdateServer' :: UpdateServer -> Maybe EndpointDetails
$sel:certificate:UpdateServer' :: UpdateServer -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Certificate" 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
certificate,
            (Key
"EndpointDetails" 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 EndpointDetails
endpointDetails,
            (Key
"EndpointType" 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 EndpointType
endpointType,
            (Key
"HostKey" 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 (Sensitive Text)
hostKey,
            (Key
"IdentityProviderDetails" 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 IdentityProviderDetails
identityProviderDetails,
            (Key
"LoggingRole" 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
loggingRole,
            (Key
"PostAuthenticationLoginBanner" 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
postAuthenticationLoginBanner,
            (Key
"PreAuthenticationLoginBanner" 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
preAuthenticationLoginBanner,
            (Key
"ProtocolDetails" 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 ProtocolDetails
protocolDetails,
            (Key
"Protocols" 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 Protocol)
protocols,
            (Key
"SecurityPolicyName" 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
securityPolicyName,
            (Key
"WorkflowDetails" 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 WorkflowDetails
workflowDetails,
            forall a. a -> Maybe a
Prelude.Just (Key
"ServerId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverId)
          ]
      )

instance Data.ToPath UpdateServer where
  toPath :: UpdateServer -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery UpdateServer where
  toQuery :: UpdateServer -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateServerResponse' smart constructor.
data UpdateServerResponse = UpdateServerResponse'
  { -- | The response's http status code.
    UpdateServerResponse -> Int
httpStatus :: Prelude.Int,
    -- | A system-assigned unique identifier for a server that the user account
    -- is assigned to.
    UpdateServerResponse -> Text
serverId :: Prelude.Text
  }
  deriving (UpdateServerResponse -> UpdateServerResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServerResponse -> UpdateServerResponse -> Bool
$c/= :: UpdateServerResponse -> UpdateServerResponse -> Bool
== :: UpdateServerResponse -> UpdateServerResponse -> Bool
$c== :: UpdateServerResponse -> UpdateServerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServerResponse]
ReadPrec UpdateServerResponse
Int -> ReadS UpdateServerResponse
ReadS [UpdateServerResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServerResponse]
$creadListPrec :: ReadPrec [UpdateServerResponse]
readPrec :: ReadPrec UpdateServerResponse
$creadPrec :: ReadPrec UpdateServerResponse
readList :: ReadS [UpdateServerResponse]
$creadList :: ReadS [UpdateServerResponse]
readsPrec :: Int -> ReadS UpdateServerResponse
$creadsPrec :: Int -> ReadS UpdateServerResponse
Prelude.Read, Int -> UpdateServerResponse -> ShowS
[UpdateServerResponse] -> ShowS
UpdateServerResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServerResponse] -> ShowS
$cshowList :: [UpdateServerResponse] -> ShowS
show :: UpdateServerResponse -> String
$cshow :: UpdateServerResponse -> String
showsPrec :: Int -> UpdateServerResponse -> ShowS
$cshowsPrec :: Int -> UpdateServerResponse -> ShowS
Prelude.Show, forall x. Rep UpdateServerResponse x -> UpdateServerResponse
forall x. UpdateServerResponse -> Rep UpdateServerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServerResponse x -> UpdateServerResponse
$cfrom :: forall x. UpdateServerResponse -> Rep UpdateServerResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServerResponse' 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:
--
-- 'httpStatus', 'updateServerResponse_httpStatus' - The response's http status code.
--
-- 'serverId', 'updateServerResponse_serverId' - A system-assigned unique identifier for a server that the user account
-- is assigned to.
newUpdateServerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'serverId'
  Prelude.Text ->
  UpdateServerResponse
newUpdateServerResponse :: Int -> Text -> UpdateServerResponse
newUpdateServerResponse Int
pHttpStatus_ Text
pServerId_ =
  UpdateServerResponse'
    { $sel:httpStatus:UpdateServerResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:serverId:UpdateServerResponse' :: Text
serverId = Text
pServerId_
    }

-- | The response's http status code.
updateServerResponse_httpStatus :: Lens.Lens' UpdateServerResponse Prelude.Int
updateServerResponse_httpStatus :: Lens' UpdateServerResponse Int
updateServerResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateServerResponse' :: UpdateServerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateServerResponse
s@UpdateServerResponse' {} Int
a -> UpdateServerResponse
s {$sel:httpStatus:UpdateServerResponse' :: Int
httpStatus = Int
a} :: UpdateServerResponse)

-- | A system-assigned unique identifier for a server that the user account
-- is assigned to.
updateServerResponse_serverId :: Lens.Lens' UpdateServerResponse Prelude.Text
updateServerResponse_serverId :: Lens' UpdateServerResponse Text
updateServerResponse_serverId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerResponse' {Text
serverId :: Text
$sel:serverId:UpdateServerResponse' :: UpdateServerResponse -> Text
serverId} -> Text
serverId) (\s :: UpdateServerResponse
s@UpdateServerResponse' {} Text
a -> UpdateServerResponse
s {$sel:serverId:UpdateServerResponse' :: Text
serverId = Text
a} :: UpdateServerResponse)

instance Prelude.NFData UpdateServerResponse where
  rnf :: UpdateServerResponse -> ()
rnf UpdateServerResponse' {Int
Text
serverId :: Text
httpStatus :: Int
$sel:serverId:UpdateServerResponse' :: UpdateServerResponse -> Text
$sel:httpStatus:UpdateServerResponse' :: UpdateServerResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverId