{-# 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.CreateLocationSmb
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Defines a file system on a Server Message Block (SMB) server that can be
-- read from or written to.
module Amazonka.DataSync.CreateLocationSmb
  ( -- * Creating a Request
    CreateLocationSmb (..),
    newCreateLocationSmb,

    -- * Request Lenses
    createLocationSmb_domain,
    createLocationSmb_mountOptions,
    createLocationSmb_tags,
    createLocationSmb_subdirectory,
    createLocationSmb_serverHostname,
    createLocationSmb_user,
    createLocationSmb_password,
    createLocationSmb_agentArns,

    -- * Destructuring the Response
    CreateLocationSmbResponse (..),
    newCreateLocationSmbResponse,

    -- * Response Lenses
    createLocationSmbResponse_locationArn,
    createLocationSmbResponse_httpStatus,
  )
where

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

-- | CreateLocationSmbRequest
--
-- /See:/ 'newCreateLocationSmb' smart constructor.
data CreateLocationSmb = CreateLocationSmb'
  { -- | The name of the Windows domain that the SMB server belongs to.
    CreateLocationSmb -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
    -- | The mount options used by DataSync to access the SMB server.
    CreateLocationSmb -> Maybe SmbMountOptions
mountOptions :: Prelude.Maybe SmbMountOptions,
    -- | The key-value pair that represents the tag that you want to add to the
    -- location. The value can be an empty string. We recommend using tags to
    -- name your resources.
    CreateLocationSmb -> Maybe [TagListEntry]
tags :: Prelude.Maybe [TagListEntry],
    -- | 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 you specified, DataSync needs to
    -- have permissions to mount the SMB share, as well as to access all the
    -- data in that share. To ensure this, either 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, or use credentials of a
    -- member of the Backup Operators group to mount the share. Doing either
    -- enables the agent to access the data. For the agent to access
    -- directories, you must additionally enable all execute access.
    CreateLocationSmb -> Text
subdirectory :: Prelude.Text,
    -- | The name of the SMB server. This value is the IP address or Domain Name
    -- Service (DNS) name of the SMB server. An agent that is installed
    -- on-premises uses this hostname to mount the SMB server in a network.
    --
    -- This name must either be DNS-compliant or must be an IP version 4 (IPv4)
    -- address.
    CreateLocationSmb -> Text
serverHostname :: Prelude.Text,
    -- | The user who can mount the share, has the permissions to access files
    -- and folders in the SMB share.
    --
    -- For information about choosing a user name that ensures sufficient
    -- permissions to files, folders, and metadata, see the
    -- <create-smb-location.html#SMBuser User setting> for SMB locations.
    CreateLocationSmb -> Text
user :: Prelude.Text,
    -- | The password of the user who can mount the share, has the permissions to
    -- access files and folders in the SMB share.
    CreateLocationSmb -> Sensitive Text
password :: Data.Sensitive Prelude.Text,
    -- | The Amazon Resource Names (ARNs) of agents to use for a Simple Message
    -- Block (SMB) location.
    CreateLocationSmb -> NonEmpty Text
agentArns :: Prelude.NonEmpty Prelude.Text
  }
  deriving (CreateLocationSmb -> CreateLocationSmb -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocationSmb -> CreateLocationSmb -> Bool
$c/= :: CreateLocationSmb -> CreateLocationSmb -> Bool
== :: CreateLocationSmb -> CreateLocationSmb -> Bool
$c== :: CreateLocationSmb -> CreateLocationSmb -> Bool
Prelude.Eq, Int -> CreateLocationSmb -> ShowS
[CreateLocationSmb] -> ShowS
CreateLocationSmb -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocationSmb] -> ShowS
$cshowList :: [CreateLocationSmb] -> ShowS
show :: CreateLocationSmb -> String
$cshow :: CreateLocationSmb -> String
showsPrec :: Int -> CreateLocationSmb -> ShowS
$cshowsPrec :: Int -> CreateLocationSmb -> ShowS
Prelude.Show, forall x. Rep CreateLocationSmb x -> CreateLocationSmb
forall x. CreateLocationSmb -> Rep CreateLocationSmb x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLocationSmb x -> CreateLocationSmb
$cfrom :: forall x. CreateLocationSmb -> Rep CreateLocationSmb x
Prelude.Generic)

-- |
-- Create a value of 'CreateLocationSmb' 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:
--
-- 'domain', 'createLocationSmb_domain' - The name of the Windows domain that the SMB server belongs to.
--
-- 'mountOptions', 'createLocationSmb_mountOptions' - The mount options used by DataSync to access the SMB server.
--
-- 'tags', 'createLocationSmb_tags' - The key-value pair that represents the tag that you want to add to the
-- location. The value can be an empty string. We recommend using tags to
-- name your resources.
--
-- 'subdirectory', 'createLocationSmb_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 you specified, DataSync needs to
-- have permissions to mount the SMB share, as well as to access all the
-- data in that share. To ensure this, either 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, or use credentials of a
-- member of the Backup Operators group to mount the share. Doing either
-- enables the agent to access the data. For the agent to access
-- directories, you must additionally enable all execute access.
--
-- 'serverHostname', 'createLocationSmb_serverHostname' - The name of the SMB server. This value is the IP address or Domain Name
-- Service (DNS) name of the SMB server. An agent that is installed
-- on-premises uses this hostname to mount the SMB server in a network.
--
-- This name must either be DNS-compliant or must be an IP version 4 (IPv4)
-- address.
--
-- 'user', 'createLocationSmb_user' - The user who can mount the share, has the permissions to access files
-- and folders in the SMB share.
--
-- For information about choosing a user name that ensures sufficient
-- permissions to files, folders, and metadata, see the
-- <create-smb-location.html#SMBuser User setting> for SMB locations.
--
-- 'password', 'createLocationSmb_password' - The password of the user who can mount the share, has the permissions to
-- access files and folders in the SMB share.
--
-- 'agentArns', 'createLocationSmb_agentArns' - The Amazon Resource Names (ARNs) of agents to use for a Simple Message
-- Block (SMB) location.
newCreateLocationSmb ::
  -- | 'subdirectory'
  Prelude.Text ->
  -- | 'serverHostname'
  Prelude.Text ->
  -- | 'user'
  Prelude.Text ->
  -- | 'password'
  Prelude.Text ->
  -- | 'agentArns'
  Prelude.NonEmpty Prelude.Text ->
  CreateLocationSmb
newCreateLocationSmb :: Text -> Text -> Text -> Text -> NonEmpty Text -> CreateLocationSmb
newCreateLocationSmb
  Text
pSubdirectory_
  Text
pServerHostname_
  Text
pUser_
  Text
pPassword_
  NonEmpty Text
pAgentArns_ =
    CreateLocationSmb'
      { $sel:domain:CreateLocationSmb' :: Maybe Text
domain = forall a. Maybe a
Prelude.Nothing,
        $sel:mountOptions:CreateLocationSmb' :: Maybe SmbMountOptions
mountOptions = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateLocationSmb' :: Maybe [TagListEntry]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:subdirectory:CreateLocationSmb' :: Text
subdirectory = Text
pSubdirectory_,
        $sel:serverHostname:CreateLocationSmb' :: Text
serverHostname = Text
pServerHostname_,
        $sel:user:CreateLocationSmb' :: Text
user = Text
pUser_,
        $sel:password:CreateLocationSmb' :: Sensitive Text
password = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pPassword_,
        $sel:agentArns:CreateLocationSmb' :: NonEmpty Text
agentArns = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pAgentArns_
      }

-- | The name of the Windows domain that the SMB server belongs to.
createLocationSmb_domain :: Lens.Lens' CreateLocationSmb (Prelude.Maybe Prelude.Text)
createLocationSmb_domain :: Lens' CreateLocationSmb (Maybe Text)
createLocationSmb_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Maybe Text
domain :: Maybe Text
$sel:domain:CreateLocationSmb' :: CreateLocationSmb -> Maybe Text
domain} -> Maybe Text
domain) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Maybe Text
a -> CreateLocationSmb
s {$sel:domain:CreateLocationSmb' :: Maybe Text
domain = Maybe Text
a} :: CreateLocationSmb)

-- | The mount options used by DataSync to access the SMB server.
createLocationSmb_mountOptions :: Lens.Lens' CreateLocationSmb (Prelude.Maybe SmbMountOptions)
createLocationSmb_mountOptions :: Lens' CreateLocationSmb (Maybe SmbMountOptions)
createLocationSmb_mountOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Maybe SmbMountOptions
mountOptions :: Maybe SmbMountOptions
$sel:mountOptions:CreateLocationSmb' :: CreateLocationSmb -> Maybe SmbMountOptions
mountOptions} -> Maybe SmbMountOptions
mountOptions) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Maybe SmbMountOptions
a -> CreateLocationSmb
s {$sel:mountOptions:CreateLocationSmb' :: Maybe SmbMountOptions
mountOptions = Maybe SmbMountOptions
a} :: CreateLocationSmb)

-- | The key-value pair that represents the tag that you want to add to the
-- location. The value can be an empty string. We recommend using tags to
-- name your resources.
createLocationSmb_tags :: Lens.Lens' CreateLocationSmb (Prelude.Maybe [TagListEntry])
createLocationSmb_tags :: Lens' CreateLocationSmb (Maybe [TagListEntry])
createLocationSmb_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Maybe [TagListEntry]
tags :: Maybe [TagListEntry]
$sel:tags:CreateLocationSmb' :: CreateLocationSmb -> Maybe [TagListEntry]
tags} -> Maybe [TagListEntry]
tags) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Maybe [TagListEntry]
a -> CreateLocationSmb
s {$sel:tags:CreateLocationSmb' :: Maybe [TagListEntry]
tags = Maybe [TagListEntry]
a} :: CreateLocationSmb) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 you specified, DataSync needs to
-- have permissions to mount the SMB share, as well as to access all the
-- data in that share. To ensure this, either 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, or use credentials of a
-- member of the Backup Operators group to mount the share. Doing either
-- enables the agent to access the data. For the agent to access
-- directories, you must additionally enable all execute access.
createLocationSmb_subdirectory :: Lens.Lens' CreateLocationSmb Prelude.Text
createLocationSmb_subdirectory :: Lens' CreateLocationSmb Text
createLocationSmb_subdirectory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Text
subdirectory :: Text
$sel:subdirectory:CreateLocationSmb' :: CreateLocationSmb -> Text
subdirectory} -> Text
subdirectory) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Text
a -> CreateLocationSmb
s {$sel:subdirectory:CreateLocationSmb' :: Text
subdirectory = Text
a} :: CreateLocationSmb)

-- | The name of the SMB server. This value is the IP address or Domain Name
-- Service (DNS) name of the SMB server. An agent that is installed
-- on-premises uses this hostname to mount the SMB server in a network.
--
-- This name must either be DNS-compliant or must be an IP version 4 (IPv4)
-- address.
createLocationSmb_serverHostname :: Lens.Lens' CreateLocationSmb Prelude.Text
createLocationSmb_serverHostname :: Lens' CreateLocationSmb Text
createLocationSmb_serverHostname = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Text
serverHostname :: Text
$sel:serverHostname:CreateLocationSmb' :: CreateLocationSmb -> Text
serverHostname} -> Text
serverHostname) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Text
a -> CreateLocationSmb
s {$sel:serverHostname:CreateLocationSmb' :: Text
serverHostname = Text
a} :: CreateLocationSmb)

-- | The user who can mount the share, has the permissions to access files
-- and folders in the SMB share.
--
-- For information about choosing a user name that ensures sufficient
-- permissions to files, folders, and metadata, see the
-- <create-smb-location.html#SMBuser User setting> for SMB locations.
createLocationSmb_user :: Lens.Lens' CreateLocationSmb Prelude.Text
createLocationSmb_user :: Lens' CreateLocationSmb Text
createLocationSmb_user = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Text
user :: Text
$sel:user:CreateLocationSmb' :: CreateLocationSmb -> Text
user} -> Text
user) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Text
a -> CreateLocationSmb
s {$sel:user:CreateLocationSmb' :: Text
user = Text
a} :: CreateLocationSmb)

-- | The password of the user who can mount the share, has the permissions to
-- access files and folders in the SMB share.
createLocationSmb_password :: Lens.Lens' CreateLocationSmb Prelude.Text
createLocationSmb_password :: Lens' CreateLocationSmb Text
createLocationSmb_password = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {Sensitive Text
password :: Sensitive Text
$sel:password:CreateLocationSmb' :: CreateLocationSmb -> Sensitive Text
password} -> Sensitive Text
password) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} Sensitive Text
a -> CreateLocationSmb
s {$sel:password:CreateLocationSmb' :: Sensitive Text
password = Sensitive Text
a} :: CreateLocationSmb) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The Amazon Resource Names (ARNs) of agents to use for a Simple Message
-- Block (SMB) location.
createLocationSmb_agentArns :: Lens.Lens' CreateLocationSmb (Prelude.NonEmpty Prelude.Text)
createLocationSmb_agentArns :: Lens' CreateLocationSmb (NonEmpty Text)
createLocationSmb_agentArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmb' {NonEmpty Text
agentArns :: NonEmpty Text
$sel:agentArns:CreateLocationSmb' :: CreateLocationSmb -> NonEmpty Text
agentArns} -> NonEmpty Text
agentArns) (\s :: CreateLocationSmb
s@CreateLocationSmb' {} NonEmpty Text
a -> CreateLocationSmb
s {$sel:agentArns:CreateLocationSmb' :: NonEmpty Text
agentArns = NonEmpty Text
a} :: CreateLocationSmb) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateLocationSmb where
  type
    AWSResponse CreateLocationSmb =
      CreateLocationSmbResponse
  request :: (Service -> Service)
-> CreateLocationSmb -> Request CreateLocationSmb
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 CreateLocationSmb
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateLocationSmb)))
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 ->
          Maybe Text -> Int -> CreateLocationSmbResponse
CreateLocationSmbResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LocationArn")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable CreateLocationSmb where
  hashWithSalt :: Int -> CreateLocationSmb -> Int
hashWithSalt Int
_salt CreateLocationSmb' {Maybe [TagListEntry]
Maybe Text
Maybe SmbMountOptions
NonEmpty Text
Text
Sensitive Text
agentArns :: NonEmpty Text
password :: Sensitive Text
user :: Text
serverHostname :: Text
subdirectory :: Text
tags :: Maybe [TagListEntry]
mountOptions :: Maybe SmbMountOptions
domain :: Maybe Text
$sel:agentArns:CreateLocationSmb' :: CreateLocationSmb -> NonEmpty Text
$sel:password:CreateLocationSmb' :: CreateLocationSmb -> Sensitive Text
$sel:user:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:serverHostname:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:subdirectory:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:tags:CreateLocationSmb' :: CreateLocationSmb -> Maybe [TagListEntry]
$sel:mountOptions:CreateLocationSmb' :: CreateLocationSmb -> Maybe SmbMountOptions
$sel:domain:CreateLocationSmb' :: CreateLocationSmb -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domain
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SmbMountOptions
mountOptions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagListEntry]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subdirectory
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serverHostname
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
user
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
password
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
agentArns

instance Prelude.NFData CreateLocationSmb where
  rnf :: CreateLocationSmb -> ()
rnf CreateLocationSmb' {Maybe [TagListEntry]
Maybe Text
Maybe SmbMountOptions
NonEmpty Text
Text
Sensitive Text
agentArns :: NonEmpty Text
password :: Sensitive Text
user :: Text
serverHostname :: Text
subdirectory :: Text
tags :: Maybe [TagListEntry]
mountOptions :: Maybe SmbMountOptions
domain :: Maybe Text
$sel:agentArns:CreateLocationSmb' :: CreateLocationSmb -> NonEmpty Text
$sel:password:CreateLocationSmb' :: CreateLocationSmb -> Sensitive Text
$sel:user:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:serverHostname:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:subdirectory:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:tags:CreateLocationSmb' :: CreateLocationSmb -> Maybe [TagListEntry]
$sel:mountOptions:CreateLocationSmb' :: CreateLocationSmb -> Maybe SmbMountOptions
$sel:domain:CreateLocationSmb' :: CreateLocationSmb -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SmbMountOptions
mountOptions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagListEntry]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
subdirectory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serverHostname
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
user
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
password
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
agentArns

instance Data.ToHeaders CreateLocationSmb where
  toHeaders :: CreateLocationSmb -> 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
"FmrsService.CreateLocationSmb" ::
                          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 CreateLocationSmb where
  toJSON :: CreateLocationSmb -> Value
toJSON CreateLocationSmb' {Maybe [TagListEntry]
Maybe Text
Maybe SmbMountOptions
NonEmpty Text
Text
Sensitive Text
agentArns :: NonEmpty Text
password :: Sensitive Text
user :: Text
serverHostname :: Text
subdirectory :: Text
tags :: Maybe [TagListEntry]
mountOptions :: Maybe SmbMountOptions
domain :: Maybe Text
$sel:agentArns:CreateLocationSmb' :: CreateLocationSmb -> NonEmpty Text
$sel:password:CreateLocationSmb' :: CreateLocationSmb -> Sensitive Text
$sel:user:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:serverHostname:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:subdirectory:CreateLocationSmb' :: CreateLocationSmb -> Text
$sel:tags:CreateLocationSmb' :: CreateLocationSmb -> Maybe [TagListEntry]
$sel:mountOptions:CreateLocationSmb' :: CreateLocationSmb -> Maybe SmbMountOptions
$sel:domain:CreateLocationSmb' :: CreateLocationSmb -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Domain" 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
domain,
            (Key
"MountOptions" 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 SmbMountOptions
mountOptions,
            (Key
"Tags" 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 [TagListEntry]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Subdirectory" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
subdirectory),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ServerHostname" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serverHostname),
            forall a. a -> Maybe a
Prelude.Just (Key
"User" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
user),
            forall a. a -> Maybe a
Prelude.Just (Key
"Password" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
password),
            forall a. a -> Maybe a
Prelude.Just (Key
"AgentArns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
agentArns)
          ]
      )

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

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

-- | CreateLocationSmbResponse
--
-- /See:/ 'newCreateLocationSmbResponse' smart constructor.
data CreateLocationSmbResponse = CreateLocationSmbResponse'
  { -- | The Amazon Resource Name (ARN) of the source SMB file system location
    -- that is created.
    CreateLocationSmbResponse -> Maybe Text
locationArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateLocationSmbResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLocationSmbResponse -> CreateLocationSmbResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLocationSmbResponse -> CreateLocationSmbResponse -> Bool
$c/= :: CreateLocationSmbResponse -> CreateLocationSmbResponse -> Bool
== :: CreateLocationSmbResponse -> CreateLocationSmbResponse -> Bool
$c== :: CreateLocationSmbResponse -> CreateLocationSmbResponse -> Bool
Prelude.Eq, ReadPrec [CreateLocationSmbResponse]
ReadPrec CreateLocationSmbResponse
Int -> ReadS CreateLocationSmbResponse
ReadS [CreateLocationSmbResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLocationSmbResponse]
$creadListPrec :: ReadPrec [CreateLocationSmbResponse]
readPrec :: ReadPrec CreateLocationSmbResponse
$creadPrec :: ReadPrec CreateLocationSmbResponse
readList :: ReadS [CreateLocationSmbResponse]
$creadList :: ReadS [CreateLocationSmbResponse]
readsPrec :: Int -> ReadS CreateLocationSmbResponse
$creadsPrec :: Int -> ReadS CreateLocationSmbResponse
Prelude.Read, Int -> CreateLocationSmbResponse -> ShowS
[CreateLocationSmbResponse] -> ShowS
CreateLocationSmbResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLocationSmbResponse] -> ShowS
$cshowList :: [CreateLocationSmbResponse] -> ShowS
show :: CreateLocationSmbResponse -> String
$cshow :: CreateLocationSmbResponse -> String
showsPrec :: Int -> CreateLocationSmbResponse -> ShowS
$cshowsPrec :: Int -> CreateLocationSmbResponse -> ShowS
Prelude.Show, forall x.
Rep CreateLocationSmbResponse x -> CreateLocationSmbResponse
forall x.
CreateLocationSmbResponse -> Rep CreateLocationSmbResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLocationSmbResponse x -> CreateLocationSmbResponse
$cfrom :: forall x.
CreateLocationSmbResponse -> Rep CreateLocationSmbResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLocationSmbResponse' 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:
--
-- 'locationArn', 'createLocationSmbResponse_locationArn' - The Amazon Resource Name (ARN) of the source SMB file system location
-- that is created.
--
-- 'httpStatus', 'createLocationSmbResponse_httpStatus' - The response's http status code.
newCreateLocationSmbResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLocationSmbResponse
newCreateLocationSmbResponse :: Int -> CreateLocationSmbResponse
newCreateLocationSmbResponse Int
pHttpStatus_ =
  CreateLocationSmbResponse'
    { $sel:locationArn:CreateLocationSmbResponse' :: Maybe Text
locationArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateLocationSmbResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the source SMB file system location
-- that is created.
createLocationSmbResponse_locationArn :: Lens.Lens' CreateLocationSmbResponse (Prelude.Maybe Prelude.Text)
createLocationSmbResponse_locationArn :: Lens' CreateLocationSmbResponse (Maybe Text)
createLocationSmbResponse_locationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLocationSmbResponse' {Maybe Text
locationArn :: Maybe Text
$sel:locationArn:CreateLocationSmbResponse' :: CreateLocationSmbResponse -> Maybe Text
locationArn} -> Maybe Text
locationArn) (\s :: CreateLocationSmbResponse
s@CreateLocationSmbResponse' {} Maybe Text
a -> CreateLocationSmbResponse
s {$sel:locationArn:CreateLocationSmbResponse' :: Maybe Text
locationArn = Maybe Text
a} :: CreateLocationSmbResponse)

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

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