{-# 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.DirectoryService.ShareDirectory
-- 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)
--
-- Shares a specified directory (@DirectoryId@) in your Amazon Web Services
-- account (directory owner) with another Amazon Web Services account
-- (directory consumer). With this operation you can use your directory
-- from any Amazon Web Services account and from any Amazon VPC within an
-- Amazon Web Services Region.
--
-- When you share your Managed Microsoft AD directory, Directory Service
-- creates a shared directory in the directory consumer account. This
-- shared directory contains the metadata to provide access to the
-- directory within the directory owner account. The shared directory is
-- visible in all VPCs in the directory consumer account.
--
-- The @ShareMethod@ parameter determines whether the specified directory
-- can be shared between Amazon Web Services accounts inside the same
-- Amazon Web Services organization (@ORGANIZATIONS@). It also determines
-- whether you can share the directory with any other Amazon Web Services
-- account either inside or outside of the organization (@HANDSHAKE@).
--
-- The @ShareNotes@ parameter is only used when @HANDSHAKE@ is called,
-- which sends a directory sharing request to the directory consumer.
module Amazonka.DirectoryService.ShareDirectory
  ( -- * Creating a Request
    ShareDirectory (..),
    newShareDirectory,

    -- * Request Lenses
    shareDirectory_shareNotes,
    shareDirectory_directoryId,
    shareDirectory_shareTarget,
    shareDirectory_shareMethod,

    -- * Destructuring the Response
    ShareDirectoryResponse (..),
    newShareDirectoryResponse,

    -- * Response Lenses
    shareDirectoryResponse_sharedDirectoryId,
    shareDirectoryResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DirectoryService.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:/ 'newShareDirectory' smart constructor.
data ShareDirectory = ShareDirectory'
  { -- | A directory share request that is sent by the directory owner to the
    -- directory consumer. The request includes a typed message to help the
    -- directory consumer administrator determine whether to approve or reject
    -- the share invitation.
    ShareDirectory -> Maybe (Sensitive Text)
shareNotes :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Identifier of the Managed Microsoft AD directory that you want to share
    -- with other Amazon Web Services accounts.
    ShareDirectory -> Text
directoryId :: Prelude.Text,
    -- | Identifier for the directory consumer account with whom the directory is
    -- to be shared.
    ShareDirectory -> ShareTarget
shareTarget :: ShareTarget,
    -- | The method used when sharing a directory to determine whether the
    -- directory should be shared within your Amazon Web Services organization
    -- (@ORGANIZATIONS@) or with any Amazon Web Services account by sending a
    -- directory sharing request (@HANDSHAKE@).
    ShareDirectory -> ShareMethod
shareMethod :: ShareMethod
  }
  deriving (ShareDirectory -> ShareDirectory -> Bool
(ShareDirectory -> ShareDirectory -> Bool)
-> (ShareDirectory -> ShareDirectory -> Bool) -> Eq ShareDirectory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShareDirectory -> ShareDirectory -> Bool
$c/= :: ShareDirectory -> ShareDirectory -> Bool
== :: ShareDirectory -> ShareDirectory -> Bool
$c== :: ShareDirectory -> ShareDirectory -> Bool
Prelude.Eq, Int -> ShareDirectory -> ShowS
[ShareDirectory] -> ShowS
ShareDirectory -> String
(Int -> ShareDirectory -> ShowS)
-> (ShareDirectory -> String)
-> ([ShareDirectory] -> ShowS)
-> Show ShareDirectory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShareDirectory] -> ShowS
$cshowList :: [ShareDirectory] -> ShowS
show :: ShareDirectory -> String
$cshow :: ShareDirectory -> String
showsPrec :: Int -> ShareDirectory -> ShowS
$cshowsPrec :: Int -> ShareDirectory -> ShowS
Prelude.Show, (forall x. ShareDirectory -> Rep ShareDirectory x)
-> (forall x. Rep ShareDirectory x -> ShareDirectory)
-> Generic ShareDirectory
forall x. Rep ShareDirectory x -> ShareDirectory
forall x. ShareDirectory -> Rep ShareDirectory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShareDirectory x -> ShareDirectory
$cfrom :: forall x. ShareDirectory -> Rep ShareDirectory x
Prelude.Generic)

-- |
-- Create a value of 'ShareDirectory' 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:
--
-- 'shareNotes', 'shareDirectory_shareNotes' - A directory share request that is sent by the directory owner to the
-- directory consumer. The request includes a typed message to help the
-- directory consumer administrator determine whether to approve or reject
-- the share invitation.
--
-- 'directoryId', 'shareDirectory_directoryId' - Identifier of the Managed Microsoft AD directory that you want to share
-- with other Amazon Web Services accounts.
--
-- 'shareTarget', 'shareDirectory_shareTarget' - Identifier for the directory consumer account with whom the directory is
-- to be shared.
--
-- 'shareMethod', 'shareDirectory_shareMethod' - The method used when sharing a directory to determine whether the
-- directory should be shared within your Amazon Web Services organization
-- (@ORGANIZATIONS@) or with any Amazon Web Services account by sending a
-- directory sharing request (@HANDSHAKE@).
newShareDirectory ::
  -- | 'directoryId'
  Prelude.Text ->
  -- | 'shareTarget'
  ShareTarget ->
  -- | 'shareMethod'
  ShareMethod ->
  ShareDirectory
newShareDirectory :: Text -> ShareTarget -> ShareMethod -> ShareDirectory
newShareDirectory
  Text
pDirectoryId_
  ShareTarget
pShareTarget_
  ShareMethod
pShareMethod_ =
    ShareDirectory' :: Maybe (Sensitive Text)
-> Text -> ShareTarget -> ShareMethod -> ShareDirectory
ShareDirectory'
      { $sel:shareNotes:ShareDirectory' :: Maybe (Sensitive Text)
shareNotes = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:directoryId:ShareDirectory' :: Text
directoryId = Text
pDirectoryId_,
        $sel:shareTarget:ShareDirectory' :: ShareTarget
shareTarget = ShareTarget
pShareTarget_,
        $sel:shareMethod:ShareDirectory' :: ShareMethod
shareMethod = ShareMethod
pShareMethod_
      }

-- | A directory share request that is sent by the directory owner to the
-- directory consumer. The request includes a typed message to help the
-- directory consumer administrator determine whether to approve or reject
-- the share invitation.
shareDirectory_shareNotes :: Lens.Lens' ShareDirectory (Prelude.Maybe Prelude.Text)
shareDirectory_shareNotes :: (Maybe Text -> f (Maybe Text))
-> ShareDirectory -> f ShareDirectory
shareDirectory_shareNotes = (ShareDirectory -> Maybe (Sensitive Text))
-> (ShareDirectory -> Maybe (Sensitive Text) -> ShareDirectory)
-> Lens
     ShareDirectory
     ShareDirectory
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDirectory' {Maybe (Sensitive Text)
shareNotes :: Maybe (Sensitive Text)
$sel:shareNotes:ShareDirectory' :: ShareDirectory -> Maybe (Sensitive Text)
shareNotes} -> Maybe (Sensitive Text)
shareNotes) (\s :: ShareDirectory
s@ShareDirectory' {} Maybe (Sensitive Text)
a -> ShareDirectory
s {$sel:shareNotes:ShareDirectory' :: Maybe (Sensitive Text)
shareNotes = Maybe (Sensitive Text)
a} :: ShareDirectory) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ShareDirectory -> f ShareDirectory)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ShareDirectory
-> f ShareDirectory
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

-- | Identifier of the Managed Microsoft AD directory that you want to share
-- with other Amazon Web Services accounts.
shareDirectory_directoryId :: Lens.Lens' ShareDirectory Prelude.Text
shareDirectory_directoryId :: (Text -> f Text) -> ShareDirectory -> f ShareDirectory
shareDirectory_directoryId = (ShareDirectory -> Text)
-> (ShareDirectory -> Text -> ShareDirectory)
-> Lens ShareDirectory ShareDirectory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDirectory' {Text
directoryId :: Text
$sel:directoryId:ShareDirectory' :: ShareDirectory -> Text
directoryId} -> Text
directoryId) (\s :: ShareDirectory
s@ShareDirectory' {} Text
a -> ShareDirectory
s {$sel:directoryId:ShareDirectory' :: Text
directoryId = Text
a} :: ShareDirectory)

-- | Identifier for the directory consumer account with whom the directory is
-- to be shared.
shareDirectory_shareTarget :: Lens.Lens' ShareDirectory ShareTarget
shareDirectory_shareTarget :: (ShareTarget -> f ShareTarget)
-> ShareDirectory -> f ShareDirectory
shareDirectory_shareTarget = (ShareDirectory -> ShareTarget)
-> (ShareDirectory -> ShareTarget -> ShareDirectory)
-> Lens ShareDirectory ShareDirectory ShareTarget ShareTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDirectory' {ShareTarget
shareTarget :: ShareTarget
$sel:shareTarget:ShareDirectory' :: ShareDirectory -> ShareTarget
shareTarget} -> ShareTarget
shareTarget) (\s :: ShareDirectory
s@ShareDirectory' {} ShareTarget
a -> ShareDirectory
s {$sel:shareTarget:ShareDirectory' :: ShareTarget
shareTarget = ShareTarget
a} :: ShareDirectory)

-- | The method used when sharing a directory to determine whether the
-- directory should be shared within your Amazon Web Services organization
-- (@ORGANIZATIONS@) or with any Amazon Web Services account by sending a
-- directory sharing request (@HANDSHAKE@).
shareDirectory_shareMethod :: Lens.Lens' ShareDirectory ShareMethod
shareDirectory_shareMethod :: (ShareMethod -> f ShareMethod)
-> ShareDirectory -> f ShareDirectory
shareDirectory_shareMethod = (ShareDirectory -> ShareMethod)
-> (ShareDirectory -> ShareMethod -> ShareDirectory)
-> Lens ShareDirectory ShareDirectory ShareMethod ShareMethod
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDirectory' {ShareMethod
shareMethod :: ShareMethod
$sel:shareMethod:ShareDirectory' :: ShareDirectory -> ShareMethod
shareMethod} -> ShareMethod
shareMethod) (\s :: ShareDirectory
s@ShareDirectory' {} ShareMethod
a -> ShareDirectory
s {$sel:shareMethod:ShareDirectory' :: ShareMethod
shareMethod = ShareMethod
a} :: ShareDirectory)

instance Core.AWSRequest ShareDirectory where
  type
    AWSResponse ShareDirectory =
      ShareDirectoryResponse
  request :: ShareDirectory -> Request ShareDirectory
request = Service -> ShareDirectory -> Request ShareDirectory
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ShareDirectory
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ShareDirectory)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ShareDirectory))
-> Logger
-> Service
-> Proxy ShareDirectory
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ShareDirectory)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> ShareDirectoryResponse
ShareDirectoryResponse'
            (Maybe Text -> Int -> ShareDirectoryResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ShareDirectoryResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SharedDirectoryId")
            Either String (Int -> ShareDirectoryResponse)
-> Either String Int -> Either String ShareDirectoryResponse
forall (f :: * -> *) a b. Applicative f => 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 ShareDirectory

instance Prelude.NFData ShareDirectory

instance Core.ToHeaders ShareDirectory where
  toHeaders :: ShareDirectory -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ShareDirectory -> 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
"DirectoryService_20150416.ShareDirectory" ::
                          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 ShareDirectory where
  toJSON :: ShareDirectory -> Value
toJSON ShareDirectory' {Maybe (Sensitive Text)
Text
ShareMethod
ShareTarget
shareMethod :: ShareMethod
shareTarget :: ShareTarget
directoryId :: Text
shareNotes :: Maybe (Sensitive Text)
$sel:shareMethod:ShareDirectory' :: ShareDirectory -> ShareMethod
$sel:shareTarget:ShareDirectory' :: ShareDirectory -> ShareTarget
$sel:directoryId:ShareDirectory' :: ShareDirectory -> Text
$sel:shareNotes:ShareDirectory' :: ShareDirectory -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ShareNotes" 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)
shareNotes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DirectoryId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ShareTarget" Text -> ShareTarget -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ShareTarget
shareTarget),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ShareMethod" Text -> ShareMethod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ShareMethod
shareMethod)
          ]
      )

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

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

-- | /See:/ 'newShareDirectoryResponse' smart constructor.
data ShareDirectoryResponse = ShareDirectoryResponse'
  { -- | Identifier of the directory that is stored in the directory consumer
    -- account that is shared from the specified directory (@DirectoryId@).
    ShareDirectoryResponse -> Maybe Text
sharedDirectoryId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ShareDirectoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ShareDirectoryResponse -> ShareDirectoryResponse -> Bool
(ShareDirectoryResponse -> ShareDirectoryResponse -> Bool)
-> (ShareDirectoryResponse -> ShareDirectoryResponse -> Bool)
-> Eq ShareDirectoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShareDirectoryResponse -> ShareDirectoryResponse -> Bool
$c/= :: ShareDirectoryResponse -> ShareDirectoryResponse -> Bool
== :: ShareDirectoryResponse -> ShareDirectoryResponse -> Bool
$c== :: ShareDirectoryResponse -> ShareDirectoryResponse -> Bool
Prelude.Eq, ReadPrec [ShareDirectoryResponse]
ReadPrec ShareDirectoryResponse
Int -> ReadS ShareDirectoryResponse
ReadS [ShareDirectoryResponse]
(Int -> ReadS ShareDirectoryResponse)
-> ReadS [ShareDirectoryResponse]
-> ReadPrec ShareDirectoryResponse
-> ReadPrec [ShareDirectoryResponse]
-> Read ShareDirectoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShareDirectoryResponse]
$creadListPrec :: ReadPrec [ShareDirectoryResponse]
readPrec :: ReadPrec ShareDirectoryResponse
$creadPrec :: ReadPrec ShareDirectoryResponse
readList :: ReadS [ShareDirectoryResponse]
$creadList :: ReadS [ShareDirectoryResponse]
readsPrec :: Int -> ReadS ShareDirectoryResponse
$creadsPrec :: Int -> ReadS ShareDirectoryResponse
Prelude.Read, Int -> ShareDirectoryResponse -> ShowS
[ShareDirectoryResponse] -> ShowS
ShareDirectoryResponse -> String
(Int -> ShareDirectoryResponse -> ShowS)
-> (ShareDirectoryResponse -> String)
-> ([ShareDirectoryResponse] -> ShowS)
-> Show ShareDirectoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShareDirectoryResponse] -> ShowS
$cshowList :: [ShareDirectoryResponse] -> ShowS
show :: ShareDirectoryResponse -> String
$cshow :: ShareDirectoryResponse -> String
showsPrec :: Int -> ShareDirectoryResponse -> ShowS
$cshowsPrec :: Int -> ShareDirectoryResponse -> ShowS
Prelude.Show, (forall x. ShareDirectoryResponse -> Rep ShareDirectoryResponse x)
-> (forall x.
    Rep ShareDirectoryResponse x -> ShareDirectoryResponse)
-> Generic ShareDirectoryResponse
forall x. Rep ShareDirectoryResponse x -> ShareDirectoryResponse
forall x. ShareDirectoryResponse -> Rep ShareDirectoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShareDirectoryResponse x -> ShareDirectoryResponse
$cfrom :: forall x. ShareDirectoryResponse -> Rep ShareDirectoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'ShareDirectoryResponse' 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:
--
-- 'sharedDirectoryId', 'shareDirectoryResponse_sharedDirectoryId' - Identifier of the directory that is stored in the directory consumer
-- account that is shared from the specified directory (@DirectoryId@).
--
-- 'httpStatus', 'shareDirectoryResponse_httpStatus' - The response's http status code.
newShareDirectoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ShareDirectoryResponse
newShareDirectoryResponse :: Int -> ShareDirectoryResponse
newShareDirectoryResponse Int
pHttpStatus_ =
  ShareDirectoryResponse' :: Maybe Text -> Int -> ShareDirectoryResponse
ShareDirectoryResponse'
    { $sel:sharedDirectoryId:ShareDirectoryResponse' :: Maybe Text
sharedDirectoryId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ShareDirectoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Identifier of the directory that is stored in the directory consumer
-- account that is shared from the specified directory (@DirectoryId@).
shareDirectoryResponse_sharedDirectoryId :: Lens.Lens' ShareDirectoryResponse (Prelude.Maybe Prelude.Text)
shareDirectoryResponse_sharedDirectoryId :: (Maybe Text -> f (Maybe Text))
-> ShareDirectoryResponse -> f ShareDirectoryResponse
shareDirectoryResponse_sharedDirectoryId = (ShareDirectoryResponse -> Maybe Text)
-> (ShareDirectoryResponse -> Maybe Text -> ShareDirectoryResponse)
-> Lens
     ShareDirectoryResponse
     ShareDirectoryResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareDirectoryResponse' {Maybe Text
sharedDirectoryId :: Maybe Text
$sel:sharedDirectoryId:ShareDirectoryResponse' :: ShareDirectoryResponse -> Maybe Text
sharedDirectoryId} -> Maybe Text
sharedDirectoryId) (\s :: ShareDirectoryResponse
s@ShareDirectoryResponse' {} Maybe Text
a -> ShareDirectoryResponse
s {$sel:sharedDirectoryId:ShareDirectoryResponse' :: Maybe Text
sharedDirectoryId = Maybe Text
a} :: ShareDirectoryResponse)

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

instance Prelude.NFData ShareDirectoryResponse