{-# 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.UpdateLocationSmb
-- 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
-- Server Message Block (SMB) file system access. For information about
-- creating an SMB location, see
-- <https://docs.aws.amazon.com/datasync/latest/userguide/create-smb-location.html Creating a location for SMB>.
module Amazonka.DataSync.UpdateLocationSmb
  ( -- * Creating a Request
    UpdateLocationSmb (..),
    newUpdateLocationSmb,

    -- * Request Lenses
    updateLocationSmb_agentArns,
    updateLocationSmb_domain,
    updateLocationSmb_user,
    updateLocationSmb_password,
    updateLocationSmb_subdirectory,
    updateLocationSmb_mountOptions,
    updateLocationSmb_locationArn,

    -- * Destructuring the Response
    UpdateLocationSmbResponse (..),
    newUpdateLocationSmbResponse,

    -- * Response Lenses
    updateLocationSmbResponse_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:/ 'newUpdateLocationSmb' smart constructor.
data UpdateLocationSmb = UpdateLocationSmb'
  { -- | The Amazon Resource Names (ARNs) of agents to use for a Simple Message
    -- Block (SMB) location.
    UpdateLocationSmb -> Maybe (NonEmpty Text)
agentArns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The name of the Windows domain that the SMB server belongs to.
    UpdateLocationSmb -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
    -- | The user who can mount the share has the permissions to access files and
    -- folders in the SMB share.
    UpdateLocationSmb -> Maybe Text
user :: Prelude.Maybe Prelude.Text,
    -- | The password of the user who can mount the share has the permissions to
    -- access files and folders in the SMB share.
    UpdateLocationSmb -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The subdirectory in the SMB file system that is used to read data from
    -- the SMB source location or write data to the SMB destination. The SMB
    -- path should be a path that\'s exported by the SMB server, or a
    -- subdirectory of that path. The path should be such that it can be
    -- mounted by other SMB clients in your network.
    --
    -- @Subdirectory@ must be specified with forward slashes. For example,
    -- @\/path\/to\/folder@.
    --
    -- To transfer all the data in the folder that you specified, DataSync must
    -- have permissions to mount the SMB share and to access all the data in
    -- that share. To ensure this, do either of the following:
    --
    -- -   Ensure that the user\/password specified belongs to the user who can
    --     mount the share and who has the appropriate permissions for all of
    --     the files and directories that you want DataSync to access.
    --
    -- -   Use credentials of a member of the Backup Operators group to mount
    --     the share.
    --
    -- Doing either of these options enables the agent to access the data. For
    -- the agent to access directories, you must also enable all execute
    -- access.
    UpdateLocationSmb -> Maybe Text
subdirectory :: Prelude.Maybe Prelude.Text,
    UpdateLocationSmb -> Maybe SmbMountOptions
mountOptions :: Prelude.Maybe SmbMountOptions,
    -- | The Amazon Resource Name (ARN) of the SMB location to update.
    UpdateLocationSmb -> Text
locationArn :: Prelude.Text
  }
  deriving (UpdateLocationSmb -> UpdateLocationSmb -> Bool
(UpdateLocationSmb -> UpdateLocationSmb -> Bool)
-> (UpdateLocationSmb -> UpdateLocationSmb -> Bool)
-> Eq UpdateLocationSmb
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLocationSmb -> UpdateLocationSmb -> Bool
$c/= :: UpdateLocationSmb -> UpdateLocationSmb -> Bool
== :: UpdateLocationSmb -> UpdateLocationSmb -> Bool
$c== :: UpdateLocationSmb -> UpdateLocationSmb -> Bool
Prelude.Eq, Int -> UpdateLocationSmb -> ShowS
[UpdateLocationSmb] -> ShowS
UpdateLocationSmb -> String
(Int -> UpdateLocationSmb -> ShowS)
-> (UpdateLocationSmb -> String)
-> ([UpdateLocationSmb] -> ShowS)
-> Show UpdateLocationSmb
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLocationSmb] -> ShowS
$cshowList :: [UpdateLocationSmb] -> ShowS
show :: UpdateLocationSmb -> String
$cshow :: UpdateLocationSmb -> String
showsPrec :: Int -> UpdateLocationSmb -> ShowS
$cshowsPrec :: Int -> UpdateLocationSmb -> ShowS
Prelude.Show, (forall x. UpdateLocationSmb -> Rep UpdateLocationSmb x)
-> (forall x. Rep UpdateLocationSmb x -> UpdateLocationSmb)
-> Generic UpdateLocationSmb
forall x. Rep UpdateLocationSmb x -> UpdateLocationSmb
forall x. UpdateLocationSmb -> Rep UpdateLocationSmb x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateLocationSmb x -> UpdateLocationSmb
$cfrom :: forall x. UpdateLocationSmb -> Rep UpdateLocationSmb x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLocationSmb' 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:
--
-- 'agentArns', 'updateLocationSmb_agentArns' - The Amazon Resource Names (ARNs) of agents to use for a Simple Message
-- Block (SMB) location.
--
-- 'domain', 'updateLocationSmb_domain' - The name of the Windows domain that the SMB server belongs to.
--
-- 'user', 'updateLocationSmb_user' - The user who can mount the share has the permissions to access files and
-- folders in the SMB share.
--
-- 'password', 'updateLocationSmb_password' - The password of the user who can mount the share has the permissions to
-- access files and folders in the SMB share.
--
-- 'subdirectory', 'updateLocationSmb_subdirectory' - The subdirectory in the SMB file system that is used to read data from
-- the SMB source location or write data to the SMB destination. The SMB
-- path should be a path that\'s exported by the SMB server, or a
-- subdirectory of that path. The path should be such that it can be
-- mounted by other SMB clients in your network.
--
-- @Subdirectory@ must be specified with forward slashes. For example,
-- @\/path\/to\/folder@.
--
-- To transfer all the data in the folder that you specified, DataSync must
-- have permissions to mount the SMB share and to access all the data in
-- that share. To ensure this, do either of the following:
--
-- -   Ensure that the user\/password specified belongs to the user who can
--     mount the share and who has the appropriate permissions for all of
--     the files and directories that you want DataSync to access.
--
-- -   Use credentials of a member of the Backup Operators group to mount
--     the share.
--
-- Doing either of these options enables the agent to access the data. For
-- the agent to access directories, you must also enable all execute
-- access.
--
-- 'mountOptions', 'updateLocationSmb_mountOptions' - Undocumented member.
--
-- 'locationArn', 'updateLocationSmb_locationArn' - The Amazon Resource Name (ARN) of the SMB location to update.
newUpdateLocationSmb ::
  -- | 'locationArn'
  Prelude.Text ->
  UpdateLocationSmb
newUpdateLocationSmb :: Text -> UpdateLocationSmb
newUpdateLocationSmb Text
pLocationArn_ =
  UpdateLocationSmb' :: Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe SmbMountOptions
-> Text
-> UpdateLocationSmb
UpdateLocationSmb'
    { $sel:agentArns:UpdateLocationSmb' :: Maybe (NonEmpty Text)
agentArns = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:domain:UpdateLocationSmb' :: Maybe Text
domain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:user:UpdateLocationSmb' :: Maybe Text
user = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:password:UpdateLocationSmb' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:subdirectory:UpdateLocationSmb' :: Maybe Text
subdirectory = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:mountOptions:UpdateLocationSmb' :: Maybe SmbMountOptions
mountOptions = Maybe SmbMountOptions
forall a. Maybe a
Prelude.Nothing,
      $sel:locationArn:UpdateLocationSmb' :: Text
locationArn = Text
pLocationArn_
    }

-- | The Amazon Resource Names (ARNs) of agents to use for a Simple Message
-- Block (SMB) location.
updateLocationSmb_agentArns :: Lens.Lens' UpdateLocationSmb (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateLocationSmb_agentArns :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_agentArns = (UpdateLocationSmb -> Maybe (NonEmpty Text))
-> (UpdateLocationSmb
    -> Maybe (NonEmpty Text) -> UpdateLocationSmb)
-> Lens
     UpdateLocationSmb
     UpdateLocationSmb
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Maybe (NonEmpty Text)
agentArns :: Maybe (NonEmpty Text)
$sel:agentArns:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe (NonEmpty Text)
agentArns} -> Maybe (NonEmpty Text)
agentArns) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Maybe (NonEmpty Text)
a -> UpdateLocationSmb
s {$sel:agentArns:UpdateLocationSmb' :: Maybe (NonEmpty Text)
agentArns = Maybe (NonEmpty Text)
a} :: UpdateLocationSmb) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> UpdateLocationSmb -> f UpdateLocationSmb)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> UpdateLocationSmb
-> f UpdateLocationSmb
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 name of the Windows domain that the SMB server belongs to.
updateLocationSmb_domain :: Lens.Lens' UpdateLocationSmb (Prelude.Maybe Prelude.Text)
updateLocationSmb_domain :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_domain = (UpdateLocationSmb -> Maybe Text)
-> (UpdateLocationSmb -> Maybe Text -> UpdateLocationSmb)
-> Lens
     UpdateLocationSmb UpdateLocationSmb (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Maybe Text
domain :: Maybe Text
$sel:domain:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe Text
domain} -> Maybe Text
domain) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Maybe Text
a -> UpdateLocationSmb
s {$sel:domain:UpdateLocationSmb' :: Maybe Text
domain = Maybe Text
a} :: UpdateLocationSmb)

-- | The user who can mount the share has the permissions to access files and
-- folders in the SMB share.
updateLocationSmb_user :: Lens.Lens' UpdateLocationSmb (Prelude.Maybe Prelude.Text)
updateLocationSmb_user :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_user = (UpdateLocationSmb -> Maybe Text)
-> (UpdateLocationSmb -> Maybe Text -> UpdateLocationSmb)
-> Lens
     UpdateLocationSmb UpdateLocationSmb (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Maybe Text
user :: Maybe Text
$sel:user:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe Text
user} -> Maybe Text
user) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Maybe Text
a -> UpdateLocationSmb
s {$sel:user:UpdateLocationSmb' :: Maybe Text
user = Maybe Text
a} :: UpdateLocationSmb)

-- | The password of the user who can mount the share has the permissions to
-- access files and folders in the SMB share.
updateLocationSmb_password :: Lens.Lens' UpdateLocationSmb (Prelude.Maybe Prelude.Text)
updateLocationSmb_password :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_password = (UpdateLocationSmb -> Maybe (Sensitive Text))
-> (UpdateLocationSmb
    -> Maybe (Sensitive Text) -> UpdateLocationSmb)
-> Lens
     UpdateLocationSmb
     UpdateLocationSmb
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Maybe (Sensitive Text)
a -> UpdateLocationSmb
s {$sel:password:UpdateLocationSmb' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: UpdateLocationSmb) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> UpdateLocationSmb -> f UpdateLocationSmb)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateLocationSmb
-> f UpdateLocationSmb
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 SMB file system that is used to read data from
-- the SMB source location or write data to the SMB destination. The SMB
-- path should be a path that\'s exported by the SMB server, or a
-- subdirectory of that path. The path should be such that it can be
-- mounted by other SMB clients in your network.
--
-- @Subdirectory@ must be specified with forward slashes. For example,
-- @\/path\/to\/folder@.
--
-- To transfer all the data in the folder that you specified, DataSync must
-- have permissions to mount the SMB share and to access all the data in
-- that share. To ensure this, do either of the following:
--
-- -   Ensure that the user\/password specified belongs to the user who can
--     mount the share and who has the appropriate permissions for all of
--     the files and directories that you want DataSync to access.
--
-- -   Use credentials of a member of the Backup Operators group to mount
--     the share.
--
-- Doing either of these options enables the agent to access the data. For
-- the agent to access directories, you must also enable all execute
-- access.
updateLocationSmb_subdirectory :: Lens.Lens' UpdateLocationSmb (Prelude.Maybe Prelude.Text)
updateLocationSmb_subdirectory :: (Maybe Text -> f (Maybe Text))
-> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_subdirectory = (UpdateLocationSmb -> Maybe Text)
-> (UpdateLocationSmb -> Maybe Text -> UpdateLocationSmb)
-> Lens
     UpdateLocationSmb UpdateLocationSmb (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Maybe Text
subdirectory :: Maybe Text
$sel:subdirectory:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe Text
subdirectory} -> Maybe Text
subdirectory) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Maybe Text
a -> UpdateLocationSmb
s {$sel:subdirectory:UpdateLocationSmb' :: Maybe Text
subdirectory = Maybe Text
a} :: UpdateLocationSmb)

-- | Undocumented member.
updateLocationSmb_mountOptions :: Lens.Lens' UpdateLocationSmb (Prelude.Maybe SmbMountOptions)
updateLocationSmb_mountOptions :: (Maybe SmbMountOptions -> f (Maybe SmbMountOptions))
-> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_mountOptions = (UpdateLocationSmb -> Maybe SmbMountOptions)
-> (UpdateLocationSmb
    -> Maybe SmbMountOptions -> UpdateLocationSmb)
-> Lens
     UpdateLocationSmb
     UpdateLocationSmb
     (Maybe SmbMountOptions)
     (Maybe SmbMountOptions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Maybe SmbMountOptions
mountOptions :: Maybe SmbMountOptions
$sel:mountOptions:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe SmbMountOptions
mountOptions} -> Maybe SmbMountOptions
mountOptions) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Maybe SmbMountOptions
a -> UpdateLocationSmb
s {$sel:mountOptions:UpdateLocationSmb' :: Maybe SmbMountOptions
mountOptions = Maybe SmbMountOptions
a} :: UpdateLocationSmb)

-- | The Amazon Resource Name (ARN) of the SMB location to update.
updateLocationSmb_locationArn :: Lens.Lens' UpdateLocationSmb Prelude.Text
updateLocationSmb_locationArn :: (Text -> f Text) -> UpdateLocationSmb -> f UpdateLocationSmb
updateLocationSmb_locationArn = (UpdateLocationSmb -> Text)
-> (UpdateLocationSmb -> Text -> UpdateLocationSmb)
-> Lens UpdateLocationSmb UpdateLocationSmb Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLocationSmb' {Text
locationArn :: Text
$sel:locationArn:UpdateLocationSmb' :: UpdateLocationSmb -> Text
locationArn} -> Text
locationArn) (\s :: UpdateLocationSmb
s@UpdateLocationSmb' {} Text
a -> UpdateLocationSmb
s {$sel:locationArn:UpdateLocationSmb' :: Text
locationArn = Text
a} :: UpdateLocationSmb)

instance Core.AWSRequest UpdateLocationSmb where
  type
    AWSResponse UpdateLocationSmb =
      UpdateLocationSmbResponse
  request :: UpdateLocationSmb -> Request UpdateLocationSmb
request = Service -> UpdateLocationSmb -> Request UpdateLocationSmb
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLocationSmb
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLocationSmb)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateLocationSmb))
-> Logger
-> Service
-> Proxy UpdateLocationSmb
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLocationSmb)))
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 -> UpdateLocationSmbResponse
UpdateLocationSmbResponse'
            (Int -> UpdateLocationSmbResponse)
-> Either String Int -> Either String UpdateLocationSmbResponse
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 UpdateLocationSmb

instance Prelude.NFData UpdateLocationSmb

instance Core.ToHeaders UpdateLocationSmb where
  toHeaders :: UpdateLocationSmb -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateLocationSmb -> 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.UpdateLocationSmb" ::
                          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 UpdateLocationSmb where
  toJSON :: UpdateLocationSmb -> Value
toJSON UpdateLocationSmb' {Maybe (NonEmpty Text)
Maybe Text
Maybe (Sensitive Text)
Maybe SmbMountOptions
Text
locationArn :: Text
mountOptions :: Maybe SmbMountOptions
subdirectory :: Maybe Text
password :: Maybe (Sensitive Text)
user :: Maybe Text
domain :: Maybe Text
agentArns :: Maybe (NonEmpty Text)
$sel:locationArn:UpdateLocationSmb' :: UpdateLocationSmb -> Text
$sel:mountOptions:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe SmbMountOptions
$sel:subdirectory:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe Text
$sel:password:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe (Sensitive Text)
$sel:user:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe Text
$sel:domain:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe Text
$sel:agentArns:UpdateLocationSmb' :: UpdateLocationSmb -> Maybe (NonEmpty Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"Domain" 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
domain,
            (Text
"User" 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
user,
            (Text
"Password" 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)
password,
            (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
"MountOptions" Text -> SmbMountOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SmbMountOptions -> Pair) -> Maybe SmbMountOptions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SmbMountOptions
mountOptions,
            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 UpdateLocationSmb where
  toPath :: UpdateLocationSmb -> ByteString
toPath = ByteString -> UpdateLocationSmb -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance Prelude.NFData UpdateLocationSmbResponse