{-# 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.UpdateAgreement
-- 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 some of the parameters for an existing agreement. Provide the
-- @AgreementId@ and the @ServerId@ for the agreement that you want to
-- update, along with the new values for the parameters to update.
module Amazonka.Transfer.UpdateAgreement
  ( -- * Creating a Request
    UpdateAgreement (..),
    newUpdateAgreement,

    -- * Request Lenses
    updateAgreement_accessRole,
    updateAgreement_baseDirectory,
    updateAgreement_description,
    updateAgreement_localProfileId,
    updateAgreement_partnerProfileId,
    updateAgreement_status,
    updateAgreement_agreementId,
    updateAgreement_serverId,

    -- * Destructuring the Response
    UpdateAgreementResponse (..),
    newUpdateAgreementResponse,

    -- * Response Lenses
    updateAgreementResponse_httpStatus,
    updateAgreementResponse_agreementId,
  )
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:/ 'newUpdateAgreement' smart constructor.
data UpdateAgreement = UpdateAgreement'
  { -- | With AS2, you can send files by calling @StartFileTransfer@ and
    -- specifying the file paths in the request parameter, @SendFilePaths@. We
    -- use the file’s parent directory (for example, for
    -- @--send-file-paths \/bucket\/dir\/file.txt@, parent directory is
    -- @\/bucket\/dir\/@) to temporarily store a processed AS2 message file,
    -- store the MDN when we receive them from the partner, and write a final
    -- JSON file containing relevant metadata of the transmission. So, the
    -- @AccessRole@ needs to provide read and write access to the parent
    -- directory of the file location used in the @StartFileTransfer@ request.
    -- Additionally, you need to provide read and write access to the parent
    -- directory of the files that you intend to send with @StartFileTransfer@.
    UpdateAgreement -> Maybe Text
accessRole :: Prelude.Maybe Prelude.Text,
    -- | To change the landing directory (folder) for files that are transferred,
    -- provide the bucket folder that you want to use; for example,
    -- @\/@/@DOC-EXAMPLE-BUCKET@/@\/@/@home@/@\/@/@mydirectory@/@ @.
    UpdateAgreement -> Maybe Text
baseDirectory :: Prelude.Maybe Prelude.Text,
    -- | To replace the existing description, provide a short description for the
    -- agreement.
    UpdateAgreement -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the AS2 local profile.
    --
    -- To change the local profile identifier, provide a new value here.
    UpdateAgreement -> Maybe Text
localProfileId :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the partner profile. To change the partner
    -- profile identifier, provide a new value here.
    UpdateAgreement -> Maybe Text
partnerProfileId :: Prelude.Maybe Prelude.Text,
    -- | You can update the status for the agreement, either activating an
    -- inactive agreement or the reverse.
    UpdateAgreement -> Maybe AgreementStatusType
status :: Prelude.Maybe AgreementStatusType,
    -- | A unique identifier for the agreement. This identifier is returned when
    -- you create an agreement.
    UpdateAgreement -> Text
agreementId :: Prelude.Text,
    -- | A system-assigned unique identifier for a server instance. This is the
    -- specific server that the agreement uses.
    UpdateAgreement -> Text
serverId :: Prelude.Text
  }
  deriving (UpdateAgreement -> UpdateAgreement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAgreement -> UpdateAgreement -> Bool
$c/= :: UpdateAgreement -> UpdateAgreement -> Bool
== :: UpdateAgreement -> UpdateAgreement -> Bool
$c== :: UpdateAgreement -> UpdateAgreement -> Bool
Prelude.Eq, ReadPrec [UpdateAgreement]
ReadPrec UpdateAgreement
Int -> ReadS UpdateAgreement
ReadS [UpdateAgreement]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAgreement]
$creadListPrec :: ReadPrec [UpdateAgreement]
readPrec :: ReadPrec UpdateAgreement
$creadPrec :: ReadPrec UpdateAgreement
readList :: ReadS [UpdateAgreement]
$creadList :: ReadS [UpdateAgreement]
readsPrec :: Int -> ReadS UpdateAgreement
$creadsPrec :: Int -> ReadS UpdateAgreement
Prelude.Read, Int -> UpdateAgreement -> ShowS
[UpdateAgreement] -> ShowS
UpdateAgreement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAgreement] -> ShowS
$cshowList :: [UpdateAgreement] -> ShowS
show :: UpdateAgreement -> String
$cshow :: UpdateAgreement -> String
showsPrec :: Int -> UpdateAgreement -> ShowS
$cshowsPrec :: Int -> UpdateAgreement -> ShowS
Prelude.Show, forall x. Rep UpdateAgreement x -> UpdateAgreement
forall x. UpdateAgreement -> Rep UpdateAgreement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAgreement x -> UpdateAgreement
$cfrom :: forall x. UpdateAgreement -> Rep UpdateAgreement x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAgreement' 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:
--
-- 'accessRole', 'updateAgreement_accessRole' - With AS2, you can send files by calling @StartFileTransfer@ and
-- specifying the file paths in the request parameter, @SendFilePaths@. We
-- use the file’s parent directory (for example, for
-- @--send-file-paths \/bucket\/dir\/file.txt@, parent directory is
-- @\/bucket\/dir\/@) to temporarily store a processed AS2 message file,
-- store the MDN when we receive them from the partner, and write a final
-- JSON file containing relevant metadata of the transmission. So, the
-- @AccessRole@ needs to provide read and write access to the parent
-- directory of the file location used in the @StartFileTransfer@ request.
-- Additionally, you need to provide read and write access to the parent
-- directory of the files that you intend to send with @StartFileTransfer@.
--
-- 'baseDirectory', 'updateAgreement_baseDirectory' - To change the landing directory (folder) for files that are transferred,
-- provide the bucket folder that you want to use; for example,
-- @\/@/@DOC-EXAMPLE-BUCKET@/@\/@/@home@/@\/@/@mydirectory@/@ @.
--
-- 'description', 'updateAgreement_description' - To replace the existing description, provide a short description for the
-- agreement.
--
-- 'localProfileId', 'updateAgreement_localProfileId' - A unique identifier for the AS2 local profile.
--
-- To change the local profile identifier, provide a new value here.
--
-- 'partnerProfileId', 'updateAgreement_partnerProfileId' - A unique identifier for the partner profile. To change the partner
-- profile identifier, provide a new value here.
--
-- 'status', 'updateAgreement_status' - You can update the status for the agreement, either activating an
-- inactive agreement or the reverse.
--
-- 'agreementId', 'updateAgreement_agreementId' - A unique identifier for the agreement. This identifier is returned when
-- you create an agreement.
--
-- 'serverId', 'updateAgreement_serverId' - A system-assigned unique identifier for a server instance. This is the
-- specific server that the agreement uses.
newUpdateAgreement ::
  -- | 'agreementId'
  Prelude.Text ->
  -- | 'serverId'
  Prelude.Text ->
  UpdateAgreement
newUpdateAgreement :: Text -> Text -> UpdateAgreement
newUpdateAgreement Text
pAgreementId_ Text
pServerId_ =
  UpdateAgreement'
    { $sel:accessRole:UpdateAgreement' :: Maybe Text
accessRole = forall a. Maybe a
Prelude.Nothing,
      $sel:baseDirectory:UpdateAgreement' :: Maybe Text
baseDirectory = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateAgreement' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:localProfileId:UpdateAgreement' :: Maybe Text
localProfileId = forall a. Maybe a
Prelude.Nothing,
      $sel:partnerProfileId:UpdateAgreement' :: Maybe Text
partnerProfileId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateAgreement' :: Maybe AgreementStatusType
status = forall a. Maybe a
Prelude.Nothing,
      $sel:agreementId:UpdateAgreement' :: Text
agreementId = Text
pAgreementId_,
      $sel:serverId:UpdateAgreement' :: Text
serverId = Text
pServerId_
    }

-- | With AS2, you can send files by calling @StartFileTransfer@ and
-- specifying the file paths in the request parameter, @SendFilePaths@. We
-- use the file’s parent directory (for example, for
-- @--send-file-paths \/bucket\/dir\/file.txt@, parent directory is
-- @\/bucket\/dir\/@) to temporarily store a processed AS2 message file,
-- store the MDN when we receive them from the partner, and write a final
-- JSON file containing relevant metadata of the transmission. So, the
-- @AccessRole@ needs to provide read and write access to the parent
-- directory of the file location used in the @StartFileTransfer@ request.
-- Additionally, you need to provide read and write access to the parent
-- directory of the files that you intend to send with @StartFileTransfer@.
updateAgreement_accessRole :: Lens.Lens' UpdateAgreement (Prelude.Maybe Prelude.Text)
updateAgreement_accessRole :: Lens' UpdateAgreement (Maybe Text)
updateAgreement_accessRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Maybe Text
accessRole :: Maybe Text
$sel:accessRole:UpdateAgreement' :: UpdateAgreement -> Maybe Text
accessRole} -> Maybe Text
accessRole) (\s :: UpdateAgreement
s@UpdateAgreement' {} Maybe Text
a -> UpdateAgreement
s {$sel:accessRole:UpdateAgreement' :: Maybe Text
accessRole = Maybe Text
a} :: UpdateAgreement)

-- | To change the landing directory (folder) for files that are transferred,
-- provide the bucket folder that you want to use; for example,
-- @\/@/@DOC-EXAMPLE-BUCKET@/@\/@/@home@/@\/@/@mydirectory@/@ @.
updateAgreement_baseDirectory :: Lens.Lens' UpdateAgreement (Prelude.Maybe Prelude.Text)
updateAgreement_baseDirectory :: Lens' UpdateAgreement (Maybe Text)
updateAgreement_baseDirectory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Maybe Text
baseDirectory :: Maybe Text
$sel:baseDirectory:UpdateAgreement' :: UpdateAgreement -> Maybe Text
baseDirectory} -> Maybe Text
baseDirectory) (\s :: UpdateAgreement
s@UpdateAgreement' {} Maybe Text
a -> UpdateAgreement
s {$sel:baseDirectory:UpdateAgreement' :: Maybe Text
baseDirectory = Maybe Text
a} :: UpdateAgreement)

-- | To replace the existing description, provide a short description for the
-- agreement.
updateAgreement_description :: Lens.Lens' UpdateAgreement (Prelude.Maybe Prelude.Text)
updateAgreement_description :: Lens' UpdateAgreement (Maybe Text)
updateAgreement_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Maybe Text
description :: Maybe Text
$sel:description:UpdateAgreement' :: UpdateAgreement -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateAgreement
s@UpdateAgreement' {} Maybe Text
a -> UpdateAgreement
s {$sel:description:UpdateAgreement' :: Maybe Text
description = Maybe Text
a} :: UpdateAgreement)

-- | A unique identifier for the AS2 local profile.
--
-- To change the local profile identifier, provide a new value here.
updateAgreement_localProfileId :: Lens.Lens' UpdateAgreement (Prelude.Maybe Prelude.Text)
updateAgreement_localProfileId :: Lens' UpdateAgreement (Maybe Text)
updateAgreement_localProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Maybe Text
localProfileId :: Maybe Text
$sel:localProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
localProfileId} -> Maybe Text
localProfileId) (\s :: UpdateAgreement
s@UpdateAgreement' {} Maybe Text
a -> UpdateAgreement
s {$sel:localProfileId:UpdateAgreement' :: Maybe Text
localProfileId = Maybe Text
a} :: UpdateAgreement)

-- | A unique identifier for the partner profile. To change the partner
-- profile identifier, provide a new value here.
updateAgreement_partnerProfileId :: Lens.Lens' UpdateAgreement (Prelude.Maybe Prelude.Text)
updateAgreement_partnerProfileId :: Lens' UpdateAgreement (Maybe Text)
updateAgreement_partnerProfileId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Maybe Text
partnerProfileId :: Maybe Text
$sel:partnerProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
partnerProfileId} -> Maybe Text
partnerProfileId) (\s :: UpdateAgreement
s@UpdateAgreement' {} Maybe Text
a -> UpdateAgreement
s {$sel:partnerProfileId:UpdateAgreement' :: Maybe Text
partnerProfileId = Maybe Text
a} :: UpdateAgreement)

-- | You can update the status for the agreement, either activating an
-- inactive agreement or the reverse.
updateAgreement_status :: Lens.Lens' UpdateAgreement (Prelude.Maybe AgreementStatusType)
updateAgreement_status :: Lens' UpdateAgreement (Maybe AgreementStatusType)
updateAgreement_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Maybe AgreementStatusType
status :: Maybe AgreementStatusType
$sel:status:UpdateAgreement' :: UpdateAgreement -> Maybe AgreementStatusType
status} -> Maybe AgreementStatusType
status) (\s :: UpdateAgreement
s@UpdateAgreement' {} Maybe AgreementStatusType
a -> UpdateAgreement
s {$sel:status:UpdateAgreement' :: Maybe AgreementStatusType
status = Maybe AgreementStatusType
a} :: UpdateAgreement)

-- | A unique identifier for the agreement. This identifier is returned when
-- you create an agreement.
updateAgreement_agreementId :: Lens.Lens' UpdateAgreement Prelude.Text
updateAgreement_agreementId :: Lens' UpdateAgreement Text
updateAgreement_agreementId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Text
agreementId :: Text
$sel:agreementId:UpdateAgreement' :: UpdateAgreement -> Text
agreementId} -> Text
agreementId) (\s :: UpdateAgreement
s@UpdateAgreement' {} Text
a -> UpdateAgreement
s {$sel:agreementId:UpdateAgreement' :: Text
agreementId = Text
a} :: UpdateAgreement)

-- | A system-assigned unique identifier for a server instance. This is the
-- specific server that the agreement uses.
updateAgreement_serverId :: Lens.Lens' UpdateAgreement Prelude.Text
updateAgreement_serverId :: Lens' UpdateAgreement Text
updateAgreement_serverId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreement' {Text
serverId :: Text
$sel:serverId:UpdateAgreement' :: UpdateAgreement -> Text
serverId} -> Text
serverId) (\s :: UpdateAgreement
s@UpdateAgreement' {} Text
a -> UpdateAgreement
s {$sel:serverId:UpdateAgreement' :: Text
serverId = Text
a} :: UpdateAgreement)

instance Core.AWSRequest UpdateAgreement where
  type
    AWSResponse UpdateAgreement =
      UpdateAgreementResponse
  request :: (Service -> Service) -> UpdateAgreement -> Request UpdateAgreement
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 UpdateAgreement
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateAgreement)))
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 -> UpdateAgreementResponse
UpdateAgreementResponse'
            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
"AgreementId")
      )

instance Prelude.Hashable UpdateAgreement where
  hashWithSalt :: Int -> UpdateAgreement -> Int
hashWithSalt Int
_salt UpdateAgreement' {Maybe Text
Maybe AgreementStatusType
Text
serverId :: Text
agreementId :: Text
status :: Maybe AgreementStatusType
partnerProfileId :: Maybe Text
localProfileId :: Maybe Text
description :: Maybe Text
baseDirectory :: Maybe Text
accessRole :: Maybe Text
$sel:serverId:UpdateAgreement' :: UpdateAgreement -> Text
$sel:agreementId:UpdateAgreement' :: UpdateAgreement -> Text
$sel:status:UpdateAgreement' :: UpdateAgreement -> Maybe AgreementStatusType
$sel:partnerProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:localProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:description:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:baseDirectory:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:accessRole:UpdateAgreement' :: UpdateAgreement -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accessRole
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
baseDirectory
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
localProfileId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
partnerProfileId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AgreementStatusType
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
agreementId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverId

instance Prelude.NFData UpdateAgreement where
  rnf :: UpdateAgreement -> ()
rnf UpdateAgreement' {Maybe Text
Maybe AgreementStatusType
Text
serverId :: Text
agreementId :: Text
status :: Maybe AgreementStatusType
partnerProfileId :: Maybe Text
localProfileId :: Maybe Text
description :: Maybe Text
baseDirectory :: Maybe Text
accessRole :: Maybe Text
$sel:serverId:UpdateAgreement' :: UpdateAgreement -> Text
$sel:agreementId:UpdateAgreement' :: UpdateAgreement -> Text
$sel:status:UpdateAgreement' :: UpdateAgreement -> Maybe AgreementStatusType
$sel:partnerProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:localProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:description:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:baseDirectory:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:accessRole:UpdateAgreement' :: UpdateAgreement -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accessRole
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
baseDirectory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localProfileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
partnerProfileId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AgreementStatusType
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
agreementId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverId

instance Data.ToHeaders UpdateAgreement where
  toHeaders :: UpdateAgreement -> 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.UpdateAgreement" ::
                          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 UpdateAgreement where
  toJSON :: UpdateAgreement -> Value
toJSON UpdateAgreement' {Maybe Text
Maybe AgreementStatusType
Text
serverId :: Text
agreementId :: Text
status :: Maybe AgreementStatusType
partnerProfileId :: Maybe Text
localProfileId :: Maybe Text
description :: Maybe Text
baseDirectory :: Maybe Text
accessRole :: Maybe Text
$sel:serverId:UpdateAgreement' :: UpdateAgreement -> Text
$sel:agreementId:UpdateAgreement' :: UpdateAgreement -> Text
$sel:status:UpdateAgreement' :: UpdateAgreement -> Maybe AgreementStatusType
$sel:partnerProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:localProfileId:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:description:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:baseDirectory:UpdateAgreement' :: UpdateAgreement -> Maybe Text
$sel:accessRole:UpdateAgreement' :: UpdateAgreement -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AccessRole" 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
accessRole,
            (Key
"BaseDirectory" 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
baseDirectory,
            (Key
"Description" 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
description,
            (Key
"LocalProfileId" 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
localProfileId,
            (Key
"PartnerProfileId" 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
partnerProfileId,
            (Key
"Status" 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 AgreementStatusType
status,
            forall a. a -> Maybe a
Prelude.Just (Key
"AgreementId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
agreementId),
            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 UpdateAgreement where
  toPath :: UpdateAgreement -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateAgreementResponse' smart constructor.
data UpdateAgreementResponse = UpdateAgreementResponse'
  { -- | The response's http status code.
    UpdateAgreementResponse -> Int
httpStatus :: Prelude.Int,
    -- | A unique identifier for the agreement. This identifier is returned when
    -- you create an agreement.
    UpdateAgreementResponse -> Text
agreementId :: Prelude.Text
  }
  deriving (UpdateAgreementResponse -> UpdateAgreementResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAgreementResponse -> UpdateAgreementResponse -> Bool
$c/= :: UpdateAgreementResponse -> UpdateAgreementResponse -> Bool
== :: UpdateAgreementResponse -> UpdateAgreementResponse -> Bool
$c== :: UpdateAgreementResponse -> UpdateAgreementResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAgreementResponse]
ReadPrec UpdateAgreementResponse
Int -> ReadS UpdateAgreementResponse
ReadS [UpdateAgreementResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAgreementResponse]
$creadListPrec :: ReadPrec [UpdateAgreementResponse]
readPrec :: ReadPrec UpdateAgreementResponse
$creadPrec :: ReadPrec UpdateAgreementResponse
readList :: ReadS [UpdateAgreementResponse]
$creadList :: ReadS [UpdateAgreementResponse]
readsPrec :: Int -> ReadS UpdateAgreementResponse
$creadsPrec :: Int -> ReadS UpdateAgreementResponse
Prelude.Read, Int -> UpdateAgreementResponse -> ShowS
[UpdateAgreementResponse] -> ShowS
UpdateAgreementResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAgreementResponse] -> ShowS
$cshowList :: [UpdateAgreementResponse] -> ShowS
show :: UpdateAgreementResponse -> String
$cshow :: UpdateAgreementResponse -> String
showsPrec :: Int -> UpdateAgreementResponse -> ShowS
$cshowsPrec :: Int -> UpdateAgreementResponse -> ShowS
Prelude.Show, forall x. Rep UpdateAgreementResponse x -> UpdateAgreementResponse
forall x. UpdateAgreementResponse -> Rep UpdateAgreementResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAgreementResponse x -> UpdateAgreementResponse
$cfrom :: forall x. UpdateAgreementResponse -> Rep UpdateAgreementResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAgreementResponse' 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', 'updateAgreementResponse_httpStatus' - The response's http status code.
--
-- 'agreementId', 'updateAgreementResponse_agreementId' - A unique identifier for the agreement. This identifier is returned when
-- you create an agreement.
newUpdateAgreementResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'agreementId'
  Prelude.Text ->
  UpdateAgreementResponse
newUpdateAgreementResponse :: Int -> Text -> UpdateAgreementResponse
newUpdateAgreementResponse Int
pHttpStatus_ Text
pAgreementId_ =
  UpdateAgreementResponse'
    { $sel:httpStatus:UpdateAgreementResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:agreementId:UpdateAgreementResponse' :: Text
agreementId = Text
pAgreementId_
    }

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

-- | A unique identifier for the agreement. This identifier is returned when
-- you create an agreement.
updateAgreementResponse_agreementId :: Lens.Lens' UpdateAgreementResponse Prelude.Text
updateAgreementResponse_agreementId :: Lens' UpdateAgreementResponse Text
updateAgreementResponse_agreementId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAgreementResponse' {Text
agreementId :: Text
$sel:agreementId:UpdateAgreementResponse' :: UpdateAgreementResponse -> Text
agreementId} -> Text
agreementId) (\s :: UpdateAgreementResponse
s@UpdateAgreementResponse' {} Text
a -> UpdateAgreementResponse
s {$sel:agreementId:UpdateAgreementResponse' :: Text
agreementId = Text
a} :: UpdateAgreementResponse)

instance Prelude.NFData UpdateAgreementResponse where
  rnf :: UpdateAgreementResponse -> ()
rnf UpdateAgreementResponse' {Int
Text
agreementId :: Text
httpStatus :: Int
$sel:agreementId:UpdateAgreementResponse' :: UpdateAgreementResponse -> Text
$sel:httpStatus:UpdateAgreementResponse' :: UpdateAgreementResponse -> 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
agreementId