{-# 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.DataSync.UpdateLocationObjectStorage
-- 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 some of the parameters of a previously created location for
-- self-managed object storage server access. For information about
-- creating a self-managed object storage location, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-object-location.html Creating a location for object storage>.
module Amazonka.DataSync.UpdateLocationObjectStorage
  ( -- * Creating a Request
    UpdateLocationObjectStorage (..),
    newUpdateLocationObjectStorage,

    -- * Request Lenses
    updateLocationObjectStorage_serverPort,
    updateLocationObjectStorage_agentArns,
    updateLocationObjectStorage_serverProtocol,
    updateLocationObjectStorage_secretKey,
    updateLocationObjectStorage_subdirectory,
    updateLocationObjectStorage_accessKey,
    updateLocationObjectStorage_locationArn,

    -- * Destructuring the Response
    UpdateLocationObjectStorageResponse (..),
    newUpdateLocationObjectStorageResponse,

    -- * Response Lenses
    updateLocationObjectStorageResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataSync.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateLocationObjectStorage' smart constructor.
data UpdateLocationObjectStorage = UpdateLocationObjectStorage'
  { -- | The port that your self-managed object storage server accepts inbound
    -- network traffic on. The server port is set by default to TCP 80 (HTTP)
    -- or TCP 443 (HTTPS). You can specify a custom port if your self-managed
    -- object storage server requires one.
    UpdateLocationObjectStorage -> Maybe Natural
serverPort :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the agents associated with the
    -- self-managed object storage server location.
    UpdateLocationObjectStorage -> Maybe (NonEmpty Text)
agentArns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The protocol that the object storage server uses to communicate. Valid
    -- values are @HTTP@ or @HTTPS@.
    UpdateLocationObjectStorage -> Maybe ObjectStorageServerProtocol
serverProtocol :: Prelude.Maybe ObjectStorageServerProtocol,
    -- | Optional. The secret key is used if credentials are required to access
    -- the self-managed object storage server. If your object storage requires
    -- a user name and password to authenticate, use @AccessKey@ and
    -- @SecretKey@ to provide the user name and password, respectively.
    UpdateLocationObjectStorage -> Maybe (Sensitive Text)
secretKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The subdirectory in the self-managed object storage server that is used
    -- to read data from.
    UpdateLocationObjectStorage -> Maybe Text
subdirectory :: Prelude.Maybe Prelude.Text,
    -- | Optional. The access key is used if credentials are required to access
    -- the self-managed object storage server. If your object storage requires
    -- a user name and password to authenticate, use @AccessKey@ and
    -- @SecretKey@ to provide the user name and password, respectively.
    UpdateLocationObjectStorage -> Maybe Text
accessKey :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the self-managed object storage server
    -- location to be updated.
    UpdateLocationObjectStorage -> Text
locationArn :: Prelude.Text
  }
  deriving (UpdateLocationObjectStorage -> UpdateLocationObjectStorage -> Bool
(UpdateLocationObjectStorage
 -> UpdateLocationObjectStorage -> Bool)
-> (UpdateLocationObjectStorage
    -> UpdateLocationObjectStorage -> Bool)
-> Eq UpdateLocationObjectStorage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLocationObjectStorage -> UpdateLocationObjectStorage -> Bool
$c/= :: UpdateLocationObjectStorage -> UpdateLocationObjectStorage -> Bool
== :: UpdateLocationObjectStorage -> UpdateLocationObjectStorage -> Bool
$c== :: UpdateLocationObjectStorage -> UpdateLocationObjectStorage -> Bool
Prelude.Eq, Int -> UpdateLocationObjectStorage -> ShowS
[UpdateLocationObjectStorage] -> ShowS
UpdateLocationObjectStorage -> String
(Int -> UpdateLocationObjectStorage -> ShowS)
-> (UpdateLocationObjectStorage -> String)
-> ([UpdateLocationObjectStorage] -> ShowS)
-> Show UpdateLocationObjectStorage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLocationObjectStorage] -> ShowS
$cshowList :: [UpdateLocationObjectStorage] -> ShowS
show :: UpdateLocationObjectStorage -> String
$cshow :: UpdateLocationObjectStorage -> String
showsPrec :: Int -> UpdateLocationObjectStorage -> ShowS
$cshowsPrec :: Int -> UpdateLocationObjectStorage -> ShowS
Prelude.Show, (forall x.
 UpdateLocationObjectStorage -> Rep UpdateLocationObjectStorage x)
-> (forall x.
    Rep UpdateLocationObjectStorage x -> UpdateLocationObjectStorage)
-> Generic UpdateLocationObjectStorage
forall x.
Rep UpdateLocationObjectStorage x -> UpdateLocationObjectStorage
forall x.
UpdateLocationObjectStorage -> Rep UpdateLocationObjectStorage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLocationObjectStorage x -> UpdateLocationObjectStorage
$cfrom :: forall x.
UpdateLocationObjectStorage -> Rep UpdateLocationObjectStorage x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLocationObjectStorage' 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:
--
-- 'serverPort', 'updateLocationObjectStorage_serverPort' - The port that your self-managed object storage server accepts inbound
-- network traffic on. The server port is set by default to TCP 80 (HTTP)
-- or TCP 443 (HTTPS). You can specify a custom port if your self-managed
-- object storage server requires one.
--
-- 'agentArns', 'updateLocationObjectStorage_agentArns' - The Amazon Resource Name (ARN) of the agents associated with the
-- self-managed object storage server location.
--
-- 'serverProtocol', 'updateLocationObjectStorage_serverProtocol' - The protocol that the object storage server uses to communicate. Valid
-- values are @HTTP@ or @HTTPS@.
--
-- 'secretKey', 'updateLocationObjectStorage_secretKey' - Optional. The secret key is used if credentials are required to access
-- the self-managed object storage server. If your object storage requires
-- a user name and password to authenticate, use @AccessKey@ and
-- @SecretKey@ to provide the user name and password, respectively.
--
-- 'subdirectory', 'updateLocationObjectStorage_subdirectory' - The subdirectory in the self-managed object storage server that is used
-- to read data from.
--
-- 'accessKey', 'updateLocationObjectStorage_accessKey' - Optional. The access key is used if credentials are required to access
-- the self-managed object storage server. If your object storage requires
-- a user name and password to authenticate, use @AccessKey@ and
-- @SecretKey@ to provide the user name and password, respectively.
--
-- 'locationArn', 'updateLocationObjectStorage_locationArn' - The Amazon Resource Name (ARN) of the self-managed object storage server
-- location to be updated.
newUpdateLocationObjectStorage ::
  -- | 'locationArn'
  Prelude.Text ->
  UpdateLocationObjectStorage
newUpdateLocationObjectStorage :: Text -> UpdateLocationObjectStorage
newUpdateLocationObjectStorage Text
pLocationArn_ =
  UpdateLocationObjectStorage' :: Maybe Natural
-> Maybe (NonEmpty Text)
-> Maybe ObjectStorageServerProtocol
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Text
-> UpdateLocationObjectStorage
UpdateLocationObjectStorage'
    { $sel:serverPort:UpdateLocationObjectStorage' :: Maybe Natural
serverPort =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:agentArns:UpdateLocationObjectStorage' :: Maybe (NonEmpty Text)
agentArns = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:serverProtocol:UpdateLocationObjectStorage' :: Maybe ObjectStorageServerProtocol
serverProtocol = Maybe ObjectStorageServerProtocol
forall a. Maybe a
Prelude.Nothing,
      $sel:secretKey:UpdateLocationObjectStorage' :: Maybe (Sensitive Text)
secretKey = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:subdirectory:UpdateLocationObjectStorage' :: Maybe Text
subdirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accessKey:UpdateLocationObjectStorage' :: Maybe Text
accessKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:locationArn:UpdateLocationObjectStorage' :: Text
locationArn = Text
pLocationArn_
    }

-- | The port that your self-managed object storage server accepts inbound
-- network traffic on. The server port is set by default to TCP 80 (HTTP)
-- or TCP 443 (HTTPS). You can specify a custom port if your self-managed
-- object storage server requires one.
updateLocationObjectStorage_serverPort :: Lens.Lens' UpdateLocationObjectStorage (Prelude.Maybe Prelude.Natural)
updateLocationObjectStorage_serverPort :: (Maybe Natural -> f (Maybe Natural))
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_serverPort = (UpdateLocationObjectStorage -> Maybe Natural)
-> (UpdateLocationObjectStorage
    -> Maybe Natural -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage
     UpdateLocationObjectStorage
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Maybe Natural
serverPort :: Maybe Natural
$sel:serverPort:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe Natural
serverPort} -> Maybe Natural
serverPort) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Maybe Natural
a -> UpdateLocationObjectStorage
s {$sel:serverPort:UpdateLocationObjectStorage' :: Maybe Natural
serverPort = Maybe Natural
a} :: UpdateLocationObjectStorage)

-- | The Amazon Resource Name (ARN) of the agents associated with the
-- self-managed object storage server location.
updateLocationObjectStorage_agentArns :: Lens.Lens' UpdateLocationObjectStorage (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateLocationObjectStorage_agentArns :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_agentArns = (UpdateLocationObjectStorage -> Maybe (NonEmpty Text))
-> (UpdateLocationObjectStorage
    -> Maybe (NonEmpty Text) -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage
     UpdateLocationObjectStorage
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Maybe (NonEmpty Text)
agentArns :: Maybe (NonEmpty Text)
$sel:agentArns:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe (NonEmpty Text)
agentArns} -> Maybe (NonEmpty Text)
agentArns) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Maybe (NonEmpty Text)
a -> UpdateLocationObjectStorage
s {$sel:agentArns:UpdateLocationObjectStorage' :: Maybe (NonEmpty Text)
agentArns = Maybe (NonEmpty Text)
a} :: UpdateLocationObjectStorage) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateLocationObjectStorage
-> f UpdateLocationObjectStorage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The protocol that the object storage server uses to communicate. Valid
-- values are @HTTP@ or @HTTPS@.
updateLocationObjectStorage_serverProtocol :: Lens.Lens' UpdateLocationObjectStorage (Prelude.Maybe ObjectStorageServerProtocol)
updateLocationObjectStorage_serverProtocol :: (Maybe ObjectStorageServerProtocol
 -> f (Maybe ObjectStorageServerProtocol))
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_serverProtocol = (UpdateLocationObjectStorage -> Maybe ObjectStorageServerProtocol)
-> (UpdateLocationObjectStorage
    -> Maybe ObjectStorageServerProtocol
    -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage
     UpdateLocationObjectStorage
     (Maybe ObjectStorageServerProtocol)
     (Maybe ObjectStorageServerProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Maybe ObjectStorageServerProtocol
serverProtocol :: Maybe ObjectStorageServerProtocol
$sel:serverProtocol:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe ObjectStorageServerProtocol
serverProtocol} -> Maybe ObjectStorageServerProtocol
serverProtocol) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Maybe ObjectStorageServerProtocol
a -> UpdateLocationObjectStorage
s {$sel:serverProtocol:UpdateLocationObjectStorage' :: Maybe ObjectStorageServerProtocol
serverProtocol = Maybe ObjectStorageServerProtocol
a} :: UpdateLocationObjectStorage)

-- | Optional. The secret key is used if credentials are required to access
-- the self-managed object storage server. If your object storage requires
-- a user name and password to authenticate, use @AccessKey@ and
-- @SecretKey@ to provide the user name and password, respectively.
updateLocationObjectStorage_secretKey :: Lens.Lens' UpdateLocationObjectStorage (Prelude.Maybe Prelude.Text)
updateLocationObjectStorage_secretKey :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_secretKey = (UpdateLocationObjectStorage -> Maybe (Sensitive Text))
-> (UpdateLocationObjectStorage
    -> Maybe (Sensitive Text) -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage
     UpdateLocationObjectStorage
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Maybe (Sensitive Text)
secretKey :: Maybe (Sensitive Text)
$sel:secretKey:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe (Sensitive Text)
secretKey} -> Maybe (Sensitive Text)
secretKey) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Maybe (Sensitive Text)
a -> UpdateLocationObjectStorage
s {$sel:secretKey:UpdateLocationObjectStorage' :: Maybe (Sensitive Text)
secretKey = Maybe (Sensitive Text)
a} :: UpdateLocationObjectStorage) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateLocationObjectStorage
-> f UpdateLocationObjectStorage
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

-- | The subdirectory in the self-managed object storage server that is used
-- to read data from.
updateLocationObjectStorage_subdirectory :: Lens.Lens' UpdateLocationObjectStorage (Prelude.Maybe Prelude.Text)
updateLocationObjectStorage_subdirectory :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_subdirectory = (UpdateLocationObjectStorage -> Maybe Text)
-> (UpdateLocationObjectStorage
    -> Maybe Text -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage
     UpdateLocationObjectStorage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Maybe Text
subdirectory :: Maybe Text
$sel:subdirectory:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe Text
subdirectory} -> Maybe Text
subdirectory) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Maybe Text
a -> UpdateLocationObjectStorage
s {$sel:subdirectory:UpdateLocationObjectStorage' :: Maybe Text
subdirectory = Maybe Text
a} :: UpdateLocationObjectStorage)

-- | Optional. The access key is used if credentials are required to access
-- the self-managed object storage server. If your object storage requires
-- a user name and password to authenticate, use @AccessKey@ and
-- @SecretKey@ to provide the user name and password, respectively.
updateLocationObjectStorage_accessKey :: Lens.Lens' UpdateLocationObjectStorage (Prelude.Maybe Prelude.Text)
updateLocationObjectStorage_accessKey :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_accessKey = (UpdateLocationObjectStorage -> Maybe Text)
-> (UpdateLocationObjectStorage
    -> Maybe Text -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage
     UpdateLocationObjectStorage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Maybe Text
accessKey :: Maybe Text
$sel:accessKey:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe Text
accessKey} -> Maybe Text
accessKey) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Maybe Text
a -> UpdateLocationObjectStorage
s {$sel:accessKey:UpdateLocationObjectStorage' :: Maybe Text
accessKey = Maybe Text
a} :: UpdateLocationObjectStorage)

-- | The Amazon Resource Name (ARN) of the self-managed object storage server
-- location to be updated.
updateLocationObjectStorage_locationArn :: Lens.Lens' UpdateLocationObjectStorage Prelude.Text
updateLocationObjectStorage_locationArn :: (Text -> f Text)
-> UpdateLocationObjectStorage -> f UpdateLocationObjectStorage
updateLocationObjectStorage_locationArn = (UpdateLocationObjectStorage -> Text)
-> (UpdateLocationObjectStorage
    -> Text -> UpdateLocationObjectStorage)
-> Lens
     UpdateLocationObjectStorage UpdateLocationObjectStorage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationObjectStorage' {Text
locationArn :: Text
$sel:locationArn:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Text
locationArn} -> Text
locationArn) (\s :: UpdateLocationObjectStorage
s@UpdateLocationObjectStorage' {} Text
a -> UpdateLocationObjectStorage
s {$sel:locationArn:UpdateLocationObjectStorage' :: Text
locationArn = Text
a} :: UpdateLocationObjectStorage)

instance Core.AWSRequest UpdateLocationObjectStorage where
  type
    AWSResponse UpdateLocationObjectStorage =
      UpdateLocationObjectStorageResponse
  request :: UpdateLocationObjectStorage -> Request UpdateLocationObjectStorage
request = Service
-> UpdateLocationObjectStorage
-> Request UpdateLocationObjectStorage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLocationObjectStorage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLocationObjectStorage)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateLocationObjectStorage))
-> Logger
-> Service
-> Proxy UpdateLocationObjectStorage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLocationObjectStorage)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateLocationObjectStorageResponse
UpdateLocationObjectStorageResponse'
            (Int -> UpdateLocationObjectStorageResponse)
-> Either String Int
-> Either String UpdateLocationObjectStorageResponse
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))
      )

instance Prelude.Hashable UpdateLocationObjectStorage

instance Prelude.NFData UpdateLocationObjectStorage

instance Core.ToHeaders UpdateLocationObjectStorage where
  toHeaders :: UpdateLocationObjectStorage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateLocationObjectStorage -> 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
"FmrsService.UpdateLocationObjectStorage" ::
                          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 UpdateLocationObjectStorage where
  toJSON :: UpdateLocationObjectStorage -> Value
toJSON UpdateLocationObjectStorage' {Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Maybe ObjectStorageServerProtocol
Text
locationArn :: Text
accessKey :: Maybe Text
subdirectory :: Maybe Text
secretKey :: Maybe (Sensitive Text)
serverProtocol :: Maybe ObjectStorageServerProtocol
agentArns :: Maybe (NonEmpty Text)
serverPort :: Maybe Natural
$sel:locationArn:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Text
$sel:accessKey:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe Text
$sel:subdirectory:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe Text
$sel:secretKey:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe (Sensitive Text)
$sel:serverProtocol:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe ObjectStorageServerProtocol
$sel:agentArns:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe (NonEmpty Text)
$sel:serverPort:UpdateLocationObjectStorage' :: UpdateLocationObjectStorage -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServerPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
serverPort,
            (Text
"AgentArns" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
agentArns,
            (Text
"ServerProtocol" Text -> ObjectStorageServerProtocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ObjectStorageServerProtocol -> Pair)
-> Maybe ObjectStorageServerProtocol -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ObjectStorageServerProtocol
serverProtocol,
            (Text
"SecretKey" 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)
secretKey,
            (Text
"Subdirectory" 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
subdirectory,
            (Text
"AccessKey" 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
accessKey,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"LocationArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
locationArn)
          ]
      )

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

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

-- | /See:/ 'newUpdateLocationObjectStorageResponse' smart constructor.
data UpdateLocationObjectStorageResponse = UpdateLocationObjectStorageResponse'
  { -- | The response's http status code.
    UpdateLocationObjectStorageResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateLocationObjectStorageResponse
-> UpdateLocationObjectStorageResponse -> Bool
(UpdateLocationObjectStorageResponse
 -> UpdateLocationObjectStorageResponse -> Bool)
-> (UpdateLocationObjectStorageResponse
    -> UpdateLocationObjectStorageResponse -> Bool)
-> Eq UpdateLocationObjectStorageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLocationObjectStorageResponse
-> UpdateLocationObjectStorageResponse -> Bool
$c/= :: UpdateLocationObjectStorageResponse
-> UpdateLocationObjectStorageResponse -> Bool
== :: UpdateLocationObjectStorageResponse
-> UpdateLocationObjectStorageResponse -> Bool
$c== :: UpdateLocationObjectStorageResponse
-> UpdateLocationObjectStorageResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLocationObjectStorageResponse]
ReadPrec UpdateLocationObjectStorageResponse
Int -> ReadS UpdateLocationObjectStorageResponse
ReadS [UpdateLocationObjectStorageResponse]
(Int -> ReadS UpdateLocationObjectStorageResponse)
-> ReadS [UpdateLocationObjectStorageResponse]
-> ReadPrec UpdateLocationObjectStorageResponse
-> ReadPrec [UpdateLocationObjectStorageResponse]
-> Read UpdateLocationObjectStorageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLocationObjectStorageResponse]
$creadListPrec :: ReadPrec [UpdateLocationObjectStorageResponse]
readPrec :: ReadPrec UpdateLocationObjectStorageResponse
$creadPrec :: ReadPrec UpdateLocationObjectStorageResponse
readList :: ReadS [UpdateLocationObjectStorageResponse]
$creadList :: ReadS [UpdateLocationObjectStorageResponse]
readsPrec :: Int -> ReadS UpdateLocationObjectStorageResponse
$creadsPrec :: Int -> ReadS UpdateLocationObjectStorageResponse
Prelude.Read, Int -> UpdateLocationObjectStorageResponse -> ShowS
[UpdateLocationObjectStorageResponse] -> ShowS
UpdateLocationObjectStorageResponse -> String
(Int -> UpdateLocationObjectStorageResponse -> ShowS)
-> (UpdateLocationObjectStorageResponse -> String)
-> ([UpdateLocationObjectStorageResponse] -> ShowS)
-> Show UpdateLocationObjectStorageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLocationObjectStorageResponse] -> ShowS
$cshowList :: [UpdateLocationObjectStorageResponse] -> ShowS
show :: UpdateLocationObjectStorageResponse -> String
$cshow :: UpdateLocationObjectStorageResponse -> String
showsPrec :: Int -> UpdateLocationObjectStorageResponse -> ShowS
$cshowsPrec :: Int -> UpdateLocationObjectStorageResponse -> ShowS
Prelude.Show, (forall x.
 UpdateLocationObjectStorageResponse
 -> Rep UpdateLocationObjectStorageResponse x)
-> (forall x.
    Rep UpdateLocationObjectStorageResponse x
    -> UpdateLocationObjectStorageResponse)
-> Generic UpdateLocationObjectStorageResponse
forall x.
Rep UpdateLocationObjectStorageResponse x
-> UpdateLocationObjectStorageResponse
forall x.
UpdateLocationObjectStorageResponse
-> Rep UpdateLocationObjectStorageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLocationObjectStorageResponse x
-> UpdateLocationObjectStorageResponse
$cfrom :: forall x.
UpdateLocationObjectStorageResponse
-> Rep UpdateLocationObjectStorageResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLocationObjectStorageResponse' 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', 'updateLocationObjectStorageResponse_httpStatus' - The response's http status code.
newUpdateLocationObjectStorageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateLocationObjectStorageResponse
newUpdateLocationObjectStorageResponse :: Int -> UpdateLocationObjectStorageResponse
newUpdateLocationObjectStorageResponse Int
pHttpStatus_ =
  UpdateLocationObjectStorageResponse' :: Int -> UpdateLocationObjectStorageResponse
UpdateLocationObjectStorageResponse'
    { $sel:httpStatus:UpdateLocationObjectStorageResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    UpdateLocationObjectStorageResponse