{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- 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_protocolDetails,
    updateServer_loggingRole,
    updateServer_hostKey,
    updateServer_protocols,
    updateServer_endpointType,
    updateServer_securityPolicyName,
    updateServer_certificate,
    updateServer_identityProviderDetails,
    updateServer_workflowDetails,
    updateServer_endpointDetails,
    updateServer_serverId,

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

    -- * Response Lenses
    updateServerResponse_httpStatus,
    updateServerResponse_serverId,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 protocol settings that are configured for your server.
    --
    -- Use the @PassiveIp@ parameter to indicate passive mode (for FTP and FTPS
    -- protocols). Enter a single dotted-quad IPv4 address, such as the
    -- external IP address of a firewall, router, or load balancer.
    UpdateServer -> Maybe ProtocolDetails
protocolDetails :: Prelude.Maybe ProtocolDetails,
    -- | Specifies the Amazon Resource Name (ARN) of the Amazon Web Services
    -- Identity and Access Management (IAM) role that allows a server to turn
    -- on Amazon CloudWatch logging for Amazon S3 or Amazon EFS events. When
    -- set, user activity can be viewed in your CloudWatch logs.
    UpdateServer -> Maybe Text
loggingRole :: Prelude.Maybe Prelude.Text,
    -- | The RSA private key as generated by
    -- @ssh-keygen -N \"\" -m PEM -f my-new-server-key@.
    --
    -- If you aren\'t planning to migrate existing users from an existing
    -- 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 Change the host key for your SFTP-enabled server>
    -- in the /Amazon Web ServicesTransfer Family User Guide/.
    UpdateServer -> Maybe (Sensitive Text)
hostKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | 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:
    --
    -- -   Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over
    --     SSH
    --
    -- -   File Transfer Protocol Secure (FTPS): File transfer with TLS
    --     encryption
    --
    -- -   File Transfer Protocol (FTP): Unencrypted file transfer
    --
    -- If you select @FTPS@, you must choose a certificate stored in Amazon Web
    -- ServicesCertificate Manager (ACM) which will be 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@.
    UpdateServer -> Maybe (NonEmpty Protocol)
protocols :: Prelude.Maybe (Prelude.NonEmpty Protocol),
    -- | 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,
    -- | Specifies the name of the security policy that is attached to the
    -- server.
    UpdateServer -> Maybe Text
securityPolicyName :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | An array containing all of the information required to call a
    -- customer\'s authentication API method.
    UpdateServer -> Maybe IdentityProviderDetails
identityProviderDetails :: Prelude.Maybe IdentityProviderDetails,
    -- | Specifies the workflow ID for the workflow to assign and the execution
    -- role used for executing the workflow.
    UpdateServer -> Maybe WorkflowDetails
workflowDetails :: Prelude.Maybe WorkflowDetails,
    -- | The virtual private cloud (VPC) endpoint settings that are configured
    -- for your server. When you host your endpoint within your VPC, you can
    -- make it accessible only to resources within your VPC, or you can attach
    -- Elastic IP addresses and make it 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,
    -- | 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
(UpdateServer -> UpdateServer -> Bool)
-> (UpdateServer -> UpdateServer -> Bool) -> Eq UpdateServer
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
(Int -> UpdateServer -> ShowS)
-> (UpdateServer -> String)
-> ([UpdateServer] -> ShowS)
-> Show UpdateServer
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. UpdateServer -> Rep UpdateServer x)
-> (forall x. Rep UpdateServer x -> UpdateServer)
-> Generic UpdateServer
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:
--
-- 'protocolDetails', 'updateServer_protocolDetails' - The protocol settings that are configured for your server.
--
-- Use the @PassiveIp@ parameter to indicate passive mode (for FTP and FTPS
-- protocols). Enter a single dotted-quad IPv4 address, such as the
-- external IP address of a firewall, router, or load balancer.
--
-- 'loggingRole', 'updateServer_loggingRole' - Specifies the Amazon Resource Name (ARN) of the Amazon Web Services
-- Identity and Access Management (IAM) role that allows a server to turn
-- on Amazon CloudWatch logging for Amazon S3 or Amazon EFS events. When
-- set, user activity can be viewed in your CloudWatch logs.
--
-- 'hostKey', 'updateServer_hostKey' - The RSA private key as generated by
-- @ssh-keygen -N \"\" -m PEM -f my-new-server-key@.
--
-- If you aren\'t planning to migrate existing users from an existing
-- 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 Change the host key for your SFTP-enabled server>
-- in the /Amazon Web ServicesTransfer Family User Guide/.
--
-- '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:
--
-- -   Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over
--     SSH
--
-- -   File Transfer Protocol Secure (FTPS): File transfer with TLS
--     encryption
--
-- -   File Transfer Protocol (FTP): Unencrypted file transfer
--
-- If you select @FTPS@, you must choose a certificate stored in Amazon Web
-- ServicesCertificate Manager (ACM) which will be 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@.
--
-- '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@.
--
-- 'securityPolicyName', 'updateServer_securityPolicyName' - Specifies the name of the security policy that is attached to the
-- server.
--
-- '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.
--
-- 'identityProviderDetails', 'updateServer_identityProviderDetails' - An array containing all of the information required to call a
-- customer\'s authentication API method.
--
-- 'workflowDetails', 'updateServer_workflowDetails' - Specifies the workflow ID for the workflow to assign and the execution
-- role used for executing the workflow.
--
-- '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 it accessible only to resources within your VPC, or you can attach
-- Elastic IP addresses and make it accessible to clients over the
-- internet. Your VPC\'s default security groups are automatically assigned
-- to your endpoint.
--
-- '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' :: Maybe ProtocolDetails
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe (NonEmpty Protocol)
-> Maybe EndpointType
-> Maybe Text
-> Maybe Text
-> Maybe IdentityProviderDetails
-> Maybe WorkflowDetails
-> Maybe EndpointDetails
-> Text
-> UpdateServer
UpdateServer'
    { $sel:protocolDetails:UpdateServer' :: Maybe ProtocolDetails
protocolDetails = Maybe ProtocolDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:loggingRole:UpdateServer' :: Maybe Text
loggingRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hostKey:UpdateServer' :: Maybe (Sensitive Text)
hostKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:protocols:UpdateServer' :: Maybe (NonEmpty Protocol)
protocols = Maybe (NonEmpty Protocol)
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointType:UpdateServer' :: Maybe EndpointType
endpointType = Maybe EndpointType
forall a. Maybe a
Prelude.Nothing,
      $sel:securityPolicyName:UpdateServer' :: Maybe Text
securityPolicyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificate:UpdateServer' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:identityProviderDetails:UpdateServer' :: Maybe IdentityProviderDetails
identityProviderDetails = Maybe IdentityProviderDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:workflowDetails:UpdateServer' :: Maybe WorkflowDetails
workflowDetails = Maybe WorkflowDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointDetails:UpdateServer' :: Maybe EndpointDetails
endpointDetails = Maybe EndpointDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:serverId:UpdateServer' :: Text
serverId = Text
pServerId_
    }

-- | The protocol settings that are configured for your server.
--
-- Use the @PassiveIp@ parameter to indicate passive mode (for FTP and FTPS
-- protocols). Enter a single dotted-quad IPv4 address, such as the
-- external IP address of a firewall, router, or load balancer.
updateServer_protocolDetails :: Lens.Lens' UpdateServer (Prelude.Maybe ProtocolDetails)
updateServer_protocolDetails :: (Maybe ProtocolDetails -> f (Maybe ProtocolDetails))
-> UpdateServer -> f UpdateServer
updateServer_protocolDetails = (UpdateServer -> Maybe ProtocolDetails)
-> (UpdateServer -> Maybe ProtocolDetails -> UpdateServer)
-> Lens
     UpdateServer
     UpdateServer
     (Maybe ProtocolDetails)
     (Maybe 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 Amazon Resource Name (ARN) of the Amazon Web Services
-- Identity and Access Management (IAM) role that allows a server to turn
-- on Amazon CloudWatch logging for Amazon S3 or Amazon EFS events. When
-- set, user activity can be viewed in your CloudWatch logs.
updateServer_loggingRole :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_loggingRole :: (Maybe Text -> f (Maybe Text)) -> UpdateServer -> f UpdateServer
updateServer_loggingRole = (UpdateServer -> Maybe Text)
-> (UpdateServer -> Maybe Text -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Text) (Maybe Text)
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)

-- | The RSA private key as generated by
-- @ssh-keygen -N \"\" -m PEM -f my-new-server-key@.
--
-- If you aren\'t planning to migrate existing users from an existing
-- 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 Change the host key for your SFTP-enabled server>
-- in the /Amazon Web ServicesTransfer Family User Guide/.
updateServer_hostKey :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_hostKey :: (Maybe Text -> f (Maybe Text)) -> UpdateServer -> f UpdateServer
updateServer_hostKey = (UpdateServer -> Maybe (Sensitive Text))
-> (UpdateServer -> Maybe (Sensitive Text) -> UpdateServer)
-> Lens
     UpdateServer
     UpdateServer
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateServer -> f UpdateServer)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateServer
-> f UpdateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | 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:
--
-- -   Secure Shell (SSH) File Transfer Protocol (SFTP): File transfer over
--     SSH
--
-- -   File Transfer Protocol Secure (FTPS): File transfer with TLS
--     encryption
--
-- -   File Transfer Protocol (FTP): Unencrypted file transfer
--
-- If you select @FTPS@, you must choose a certificate stored in Amazon Web
-- ServicesCertificate Manager (ACM) which will be 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@.
updateServer_protocols :: Lens.Lens' UpdateServer (Prelude.Maybe (Prelude.NonEmpty Protocol))
updateServer_protocols :: (Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> UpdateServer -> f UpdateServer
updateServer_protocols = (UpdateServer -> Maybe (NonEmpty Protocol))
-> (UpdateServer -> Maybe (NonEmpty Protocol) -> UpdateServer)
-> Lens
     UpdateServer
     UpdateServer
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
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) ((Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
 -> UpdateServer -> f UpdateServer)
-> ((Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
    -> Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> (Maybe (NonEmpty Protocol) -> f (Maybe (NonEmpty Protocol)))
-> UpdateServer
-> f UpdateServer
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
-> Iso
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
     (Maybe (NonEmpty Protocol))
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 AnIso
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
  (NonEmpty Protocol)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe EndpointType -> f (Maybe EndpointType))
-> UpdateServer -> f UpdateServer
updateServer_endpointType = (UpdateServer -> Maybe EndpointType)
-> (UpdateServer -> Maybe EndpointType -> UpdateServer)
-> Lens
     UpdateServer UpdateServer (Maybe EndpointType) (Maybe 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)

-- | Specifies the name of the security policy that is attached to the
-- server.
updateServer_securityPolicyName :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_securityPolicyName :: (Maybe Text -> f (Maybe Text)) -> UpdateServer -> f UpdateServer
updateServer_securityPolicyName = (UpdateServer -> Maybe Text)
-> (UpdateServer -> Maybe Text -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> UpdateServer -> f UpdateServer
updateServer_certificate = (UpdateServer -> Maybe Text)
-> (UpdateServer -> Maybe Text -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe IdentityProviderDetails
 -> f (Maybe IdentityProviderDetails))
-> UpdateServer -> f UpdateServer
updateServer_identityProviderDetails = (UpdateServer -> Maybe IdentityProviderDetails)
-> (UpdateServer -> Maybe IdentityProviderDetails -> UpdateServer)
-> Lens
     UpdateServer
     UpdateServer
     (Maybe IdentityProviderDetails)
     (Maybe 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)

-- | Specifies the workflow ID for the workflow to assign and the execution
-- role used for executing the workflow.
updateServer_workflowDetails :: Lens.Lens' UpdateServer (Prelude.Maybe WorkflowDetails)
updateServer_workflowDetails :: (Maybe WorkflowDetails -> f (Maybe WorkflowDetails))
-> UpdateServer -> f UpdateServer
updateServer_workflowDetails = (UpdateServer -> Maybe WorkflowDetails)
-> (UpdateServer -> Maybe WorkflowDetails -> UpdateServer)
-> Lens
     UpdateServer
     UpdateServer
     (Maybe WorkflowDetails)
     (Maybe 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)

-- | The virtual private cloud (VPC) endpoint settings that are configured
-- for your server. When you host your endpoint within your VPC, you can
-- make it accessible only to resources within your VPC, or you can attach
-- Elastic IP addresses and make it 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 :: (Maybe EndpointDetails -> f (Maybe EndpointDetails))
-> UpdateServer -> f UpdateServer
updateServer_endpointDetails = (UpdateServer -> Maybe EndpointDetails)
-> (UpdateServer -> Maybe EndpointDetails -> UpdateServer)
-> Lens
     UpdateServer
     UpdateServer
     (Maybe EndpointDetails)
     (Maybe 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)

-- | 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 :: (Text -> f Text) -> UpdateServer -> f UpdateServer
updateServer_serverId = (UpdateServer -> Text)
-> (UpdateServer -> Text -> UpdateServer)
-> Lens UpdateServer UpdateServer Text Text
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 :: UpdateServer -> Request UpdateServer
request = Service -> UpdateServer -> Request UpdateServer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateServer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateServer))
-> Logger
-> Service
-> Proxy UpdateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateServer)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> UpdateServerResponse
UpdateServerResponse'
            (Int -> Text -> UpdateServerResponse)
-> Either String Int
-> Either String (Text -> UpdateServerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either String (Text -> UpdateServerResponse)
-> Either String Text -> Either String UpdateServerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ServerId")
      )

instance Prelude.Hashable UpdateServer

instance Prelude.NFData UpdateServer

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

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

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

instance Core.ToQuery UpdateServer where
  toQuery :: UpdateServer -> QueryString
toQuery = QueryString -> UpdateServer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(UpdateServerResponse -> UpdateServerResponse -> Bool)
-> (UpdateServerResponse -> UpdateServerResponse -> Bool)
-> Eq UpdateServerResponse
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]
(Int -> ReadS UpdateServerResponse)
-> ReadS [UpdateServerResponse]
-> ReadPrec UpdateServerResponse
-> ReadPrec [UpdateServerResponse]
-> Read 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
(Int -> UpdateServerResponse -> ShowS)
-> (UpdateServerResponse -> String)
-> ([UpdateServerResponse] -> ShowS)
-> Show UpdateServerResponse
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. UpdateServerResponse -> Rep UpdateServerResponse x)
-> (forall x. Rep UpdateServerResponse x -> UpdateServerResponse)
-> Generic UpdateServerResponse
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' :: Int -> Text -> UpdateServerResponse
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 :: (Int -> f Int) -> UpdateServerResponse -> f UpdateServerResponse
updateServerResponse_httpStatus = (UpdateServerResponse -> Int)
-> (UpdateServerResponse -> Int -> UpdateServerResponse)
-> Lens UpdateServerResponse UpdateServerResponse Int Int
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 :: (Text -> f Text) -> UpdateServerResponse -> f UpdateServerResponse
updateServerResponse_serverId = (UpdateServerResponse -> Text)
-> (UpdateServerResponse -> Text -> UpdateServerResponse)
-> Lens UpdateServerResponse UpdateServerResponse Text Text
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