{-# 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.ConnectDirectory
-- 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)
--
-- Creates an AD Connector to connect to a self-managed directory.
--
-- Before you call @ConnectDirectory@, ensure that all of the required
-- permissions have been explicitly granted through a policy. For details
-- about what permissions are required to run the @ConnectDirectory@
-- operation, see
-- <http://docs.aws.amazon.com/directoryservice/latest/admin-guide/UsingWithDS_IAM_ResourcePermissions.html Directory Service API Permissions: Actions, Resources, and Conditions Reference>.
module Amazonka.DirectoryService.ConnectDirectory
  ( -- * Creating a Request
    ConnectDirectory (..),
    newConnectDirectory,

    -- * Request Lenses
    connectDirectory_shortName,
    connectDirectory_description,
    connectDirectory_tags,
    connectDirectory_name,
    connectDirectory_password,
    connectDirectory_size,
    connectDirectory_connectSettings,

    -- * Destructuring the Response
    ConnectDirectoryResponse (..),
    newConnectDirectoryResponse,

    -- * Response Lenses
    connectDirectoryResponse_directoryId,
    connectDirectoryResponse_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

-- | Contains the inputs for the ConnectDirectory operation.
--
-- /See:/ 'newConnectDirectory' smart constructor.
data ConnectDirectory = ConnectDirectory'
  { -- | The NetBIOS name of your self-managed directory, such as @CORP@.
    ConnectDirectory -> Maybe Text
shortName :: Prelude.Maybe Prelude.Text,
    -- | A description for the directory.
    ConnectDirectory -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to be assigned to AD Connector.
    ConnectDirectory -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The fully qualified name of your self-managed directory, such as
    -- @corp.example.com@.
    ConnectDirectory -> Text
name :: Prelude.Text,
    -- | The password for your self-managed user account.
    ConnectDirectory -> Sensitive Text
password :: Core.Sensitive Prelude.Text,
    -- | The size of the directory.
    ConnectDirectory -> DirectorySize
size :: DirectorySize,
    -- | A DirectoryConnectSettings object that contains additional information
    -- for the operation.
    ConnectDirectory -> DirectoryConnectSettings
connectSettings :: DirectoryConnectSettings
  }
  deriving (ConnectDirectory -> ConnectDirectory -> Bool
(ConnectDirectory -> ConnectDirectory -> Bool)
-> (ConnectDirectory -> ConnectDirectory -> Bool)
-> Eq ConnectDirectory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectDirectory -> ConnectDirectory -> Bool
$c/= :: ConnectDirectory -> ConnectDirectory -> Bool
== :: ConnectDirectory -> ConnectDirectory -> Bool
$c== :: ConnectDirectory -> ConnectDirectory -> Bool
Prelude.Eq, Int -> ConnectDirectory -> ShowS
[ConnectDirectory] -> ShowS
ConnectDirectory -> String
(Int -> ConnectDirectory -> ShowS)
-> (ConnectDirectory -> String)
-> ([ConnectDirectory] -> ShowS)
-> Show ConnectDirectory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectDirectory] -> ShowS
$cshowList :: [ConnectDirectory] -> ShowS
show :: ConnectDirectory -> String
$cshow :: ConnectDirectory -> String
showsPrec :: Int -> ConnectDirectory -> ShowS
$cshowsPrec :: Int -> ConnectDirectory -> ShowS
Prelude.Show, (forall x. ConnectDirectory -> Rep ConnectDirectory x)
-> (forall x. Rep ConnectDirectory x -> ConnectDirectory)
-> Generic ConnectDirectory
forall x. Rep ConnectDirectory x -> ConnectDirectory
forall x. ConnectDirectory -> Rep ConnectDirectory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectDirectory x -> ConnectDirectory
$cfrom :: forall x. ConnectDirectory -> Rep ConnectDirectory x
Prelude.Generic)

-- |
-- Create a value of 'ConnectDirectory' 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:
--
-- 'shortName', 'connectDirectory_shortName' - The NetBIOS name of your self-managed directory, such as @CORP@.
--
-- 'description', 'connectDirectory_description' - A description for the directory.
--
-- 'tags', 'connectDirectory_tags' - The tags to be assigned to AD Connector.
--
-- 'name', 'connectDirectory_name' - The fully qualified name of your self-managed directory, such as
-- @corp.example.com@.
--
-- 'password', 'connectDirectory_password' - The password for your self-managed user account.
--
-- 'size', 'connectDirectory_size' - The size of the directory.
--
-- 'connectSettings', 'connectDirectory_connectSettings' - A DirectoryConnectSettings object that contains additional information
-- for the operation.
newConnectDirectory ::
  -- | 'name'
  Prelude.Text ->
  -- | 'password'
  Prelude.Text ->
  -- | 'size'
  DirectorySize ->
  -- | 'connectSettings'
  DirectoryConnectSettings ->
  ConnectDirectory
newConnectDirectory :: Text
-> Text
-> DirectorySize
-> DirectoryConnectSettings
-> ConnectDirectory
newConnectDirectory
  Text
pName_
  Text
pPassword_
  DirectorySize
pSize_
  DirectoryConnectSettings
pConnectSettings_ =
    ConnectDirectory' :: Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Sensitive Text
-> DirectorySize
-> DirectoryConnectSettings
-> ConnectDirectory
ConnectDirectory'
      { $sel:shortName:ConnectDirectory' :: Maybe Text
shortName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:ConnectDirectory' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ConnectDirectory' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:name:ConnectDirectory' :: Text
name = Text
pName_,
        $sel:password:ConnectDirectory' :: Sensitive Text
password = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pPassword_,
        $sel:size:ConnectDirectory' :: DirectorySize
size = DirectorySize
pSize_,
        $sel:connectSettings:ConnectDirectory' :: DirectoryConnectSettings
connectSettings = DirectoryConnectSettings
pConnectSettings_
      }

-- | The NetBIOS name of your self-managed directory, such as @CORP@.
connectDirectory_shortName :: Lens.Lens' ConnectDirectory (Prelude.Maybe Prelude.Text)
connectDirectory_shortName :: (Maybe Text -> f (Maybe Text))
-> ConnectDirectory -> f ConnectDirectory
connectDirectory_shortName = (ConnectDirectory -> Maybe Text)
-> (ConnectDirectory -> Maybe Text -> ConnectDirectory)
-> Lens ConnectDirectory ConnectDirectory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {Maybe Text
shortName :: Maybe Text
$sel:shortName:ConnectDirectory' :: ConnectDirectory -> Maybe Text
shortName} -> Maybe Text
shortName) (\s :: ConnectDirectory
s@ConnectDirectory' {} Maybe Text
a -> ConnectDirectory
s {$sel:shortName:ConnectDirectory' :: Maybe Text
shortName = Maybe Text
a} :: ConnectDirectory)

-- | A description for the directory.
connectDirectory_description :: Lens.Lens' ConnectDirectory (Prelude.Maybe Prelude.Text)
connectDirectory_description :: (Maybe Text -> f (Maybe Text))
-> ConnectDirectory -> f ConnectDirectory
connectDirectory_description = (ConnectDirectory -> Maybe Text)
-> (ConnectDirectory -> Maybe Text -> ConnectDirectory)
-> Lens ConnectDirectory ConnectDirectory (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {Maybe Text
description :: Maybe Text
$sel:description:ConnectDirectory' :: ConnectDirectory -> Maybe Text
description} -> Maybe Text
description) (\s :: ConnectDirectory
s@ConnectDirectory' {} Maybe Text
a -> ConnectDirectory
s {$sel:description:ConnectDirectory' :: Maybe Text
description = Maybe Text
a} :: ConnectDirectory)

-- | The tags to be assigned to AD Connector.
connectDirectory_tags :: Lens.Lens' ConnectDirectory (Prelude.Maybe [Tag])
connectDirectory_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ConnectDirectory -> f ConnectDirectory
connectDirectory_tags = (ConnectDirectory -> Maybe [Tag])
-> (ConnectDirectory -> Maybe [Tag] -> ConnectDirectory)
-> Lens
     ConnectDirectory ConnectDirectory (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ConnectDirectory' :: ConnectDirectory -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ConnectDirectory
s@ConnectDirectory' {} Maybe [Tag]
a -> ConnectDirectory
s {$sel:tags:ConnectDirectory' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ConnectDirectory) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> ConnectDirectory -> f ConnectDirectory)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ConnectDirectory
-> f ConnectDirectory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The fully qualified name of your self-managed directory, such as
-- @corp.example.com@.
connectDirectory_name :: Lens.Lens' ConnectDirectory Prelude.Text
connectDirectory_name :: (Text -> f Text) -> ConnectDirectory -> f ConnectDirectory
connectDirectory_name = (ConnectDirectory -> Text)
-> (ConnectDirectory -> Text -> ConnectDirectory)
-> Lens ConnectDirectory ConnectDirectory Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {Text
name :: Text
$sel:name:ConnectDirectory' :: ConnectDirectory -> Text
name} -> Text
name) (\s :: ConnectDirectory
s@ConnectDirectory' {} Text
a -> ConnectDirectory
s {$sel:name:ConnectDirectory' :: Text
name = Text
a} :: ConnectDirectory)

-- | The password for your self-managed user account.
connectDirectory_password :: Lens.Lens' ConnectDirectory Prelude.Text
connectDirectory_password :: (Text -> f Text) -> ConnectDirectory -> f ConnectDirectory
connectDirectory_password = (ConnectDirectory -> Sensitive Text)
-> (ConnectDirectory -> Sensitive Text -> ConnectDirectory)
-> Lens
     ConnectDirectory ConnectDirectory (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {Sensitive Text
password :: Sensitive Text
$sel:password:ConnectDirectory' :: ConnectDirectory -> Sensitive Text
password} -> Sensitive Text
password) (\s :: ConnectDirectory
s@ConnectDirectory' {} Sensitive Text
a -> ConnectDirectory
s {$sel:password:ConnectDirectory' :: Sensitive Text
password = Sensitive Text
a} :: ConnectDirectory) ((Sensitive Text -> f (Sensitive Text))
 -> ConnectDirectory -> f ConnectDirectory)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> ConnectDirectory
-> f ConnectDirectory
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The size of the directory.
connectDirectory_size :: Lens.Lens' ConnectDirectory DirectorySize
connectDirectory_size :: (DirectorySize -> f DirectorySize)
-> ConnectDirectory -> f ConnectDirectory
connectDirectory_size = (ConnectDirectory -> DirectorySize)
-> (ConnectDirectory -> DirectorySize -> ConnectDirectory)
-> Lens
     ConnectDirectory ConnectDirectory DirectorySize DirectorySize
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {DirectorySize
size :: DirectorySize
$sel:size:ConnectDirectory' :: ConnectDirectory -> DirectorySize
size} -> DirectorySize
size) (\s :: ConnectDirectory
s@ConnectDirectory' {} DirectorySize
a -> ConnectDirectory
s {$sel:size:ConnectDirectory' :: DirectorySize
size = DirectorySize
a} :: ConnectDirectory)

-- | A DirectoryConnectSettings object that contains additional information
-- for the operation.
connectDirectory_connectSettings :: Lens.Lens' ConnectDirectory DirectoryConnectSettings
connectDirectory_connectSettings :: (DirectoryConnectSettings -> f DirectoryConnectSettings)
-> ConnectDirectory -> f ConnectDirectory
connectDirectory_connectSettings = (ConnectDirectory -> DirectoryConnectSettings)
-> (ConnectDirectory
    -> DirectoryConnectSettings -> ConnectDirectory)
-> Lens
     ConnectDirectory
     ConnectDirectory
     DirectoryConnectSettings
     DirectoryConnectSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectory' {DirectoryConnectSettings
connectSettings :: DirectoryConnectSettings
$sel:connectSettings:ConnectDirectory' :: ConnectDirectory -> DirectoryConnectSettings
connectSettings} -> DirectoryConnectSettings
connectSettings) (\s :: ConnectDirectory
s@ConnectDirectory' {} DirectoryConnectSettings
a -> ConnectDirectory
s {$sel:connectSettings:ConnectDirectory' :: DirectoryConnectSettings
connectSettings = DirectoryConnectSettings
a} :: ConnectDirectory)

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

instance Prelude.NFData ConnectDirectory

instance Core.ToHeaders ConnectDirectory where
  toHeaders :: ConnectDirectory -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ConnectDirectory -> 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.ConnectDirectory" ::
                          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 ConnectDirectory where
  toJSON :: ConnectDirectory -> Value
toJSON ConnectDirectory' {Maybe [Tag]
Maybe Text
Text
Sensitive Text
DirectoryConnectSettings
DirectorySize
connectSettings :: DirectoryConnectSettings
size :: DirectorySize
password :: Sensitive Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe Text
shortName :: Maybe Text
$sel:connectSettings:ConnectDirectory' :: ConnectDirectory -> DirectoryConnectSettings
$sel:size:ConnectDirectory' :: ConnectDirectory -> DirectorySize
$sel:password:ConnectDirectory' :: ConnectDirectory -> Sensitive Text
$sel:name:ConnectDirectory' :: ConnectDirectory -> Text
$sel:tags:ConnectDirectory' :: ConnectDirectory -> Maybe [Tag]
$sel:description:ConnectDirectory' :: ConnectDirectory -> Maybe Text
$sel:shortName:ConnectDirectory' :: ConnectDirectory -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ShortName" 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
shortName,
            (Text
"Description" 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
description,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
password),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Size" Text -> DirectorySize -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DirectorySize
size),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ConnectSettings" Text -> DirectoryConnectSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DirectoryConnectSettings
connectSettings)
          ]
      )

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

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

-- | Contains the results of the ConnectDirectory operation.
--
-- /See:/ 'newConnectDirectoryResponse' smart constructor.
data ConnectDirectoryResponse = ConnectDirectoryResponse'
  { -- | The identifier of the new directory.
    ConnectDirectoryResponse -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ConnectDirectoryResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool
(ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool)
-> (ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool)
-> Eq ConnectDirectoryResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool
$c/= :: ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool
== :: ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool
$c== :: ConnectDirectoryResponse -> ConnectDirectoryResponse -> Bool
Prelude.Eq, ReadPrec [ConnectDirectoryResponse]
ReadPrec ConnectDirectoryResponse
Int -> ReadS ConnectDirectoryResponse
ReadS [ConnectDirectoryResponse]
(Int -> ReadS ConnectDirectoryResponse)
-> ReadS [ConnectDirectoryResponse]
-> ReadPrec ConnectDirectoryResponse
-> ReadPrec [ConnectDirectoryResponse]
-> Read ConnectDirectoryResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectDirectoryResponse]
$creadListPrec :: ReadPrec [ConnectDirectoryResponse]
readPrec :: ReadPrec ConnectDirectoryResponse
$creadPrec :: ReadPrec ConnectDirectoryResponse
readList :: ReadS [ConnectDirectoryResponse]
$creadList :: ReadS [ConnectDirectoryResponse]
readsPrec :: Int -> ReadS ConnectDirectoryResponse
$creadsPrec :: Int -> ReadS ConnectDirectoryResponse
Prelude.Read, Int -> ConnectDirectoryResponse -> ShowS
[ConnectDirectoryResponse] -> ShowS
ConnectDirectoryResponse -> String
(Int -> ConnectDirectoryResponse -> ShowS)
-> (ConnectDirectoryResponse -> String)
-> ([ConnectDirectoryResponse] -> ShowS)
-> Show ConnectDirectoryResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectDirectoryResponse] -> ShowS
$cshowList :: [ConnectDirectoryResponse] -> ShowS
show :: ConnectDirectoryResponse -> String
$cshow :: ConnectDirectoryResponse -> String
showsPrec :: Int -> ConnectDirectoryResponse -> ShowS
$cshowsPrec :: Int -> ConnectDirectoryResponse -> ShowS
Prelude.Show, (forall x.
 ConnectDirectoryResponse -> Rep ConnectDirectoryResponse x)
-> (forall x.
    Rep ConnectDirectoryResponse x -> ConnectDirectoryResponse)
-> Generic ConnectDirectoryResponse
forall x.
Rep ConnectDirectoryResponse x -> ConnectDirectoryResponse
forall x.
ConnectDirectoryResponse -> Rep ConnectDirectoryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConnectDirectoryResponse x -> ConnectDirectoryResponse
$cfrom :: forall x.
ConnectDirectoryResponse -> Rep ConnectDirectoryResponse x
Prelude.Generic)

-- |
-- Create a value of 'ConnectDirectoryResponse' 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:
--
-- 'directoryId', 'connectDirectoryResponse_directoryId' - The identifier of the new directory.
--
-- 'httpStatus', 'connectDirectoryResponse_httpStatus' - The response's http status code.
newConnectDirectoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ConnectDirectoryResponse
newConnectDirectoryResponse :: Int -> ConnectDirectoryResponse
newConnectDirectoryResponse Int
pHttpStatus_ =
  ConnectDirectoryResponse' :: Maybe Text -> Int -> ConnectDirectoryResponse
ConnectDirectoryResponse'
    { $sel:directoryId:ConnectDirectoryResponse' :: Maybe Text
directoryId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ConnectDirectoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier of the new directory.
connectDirectoryResponse_directoryId :: Lens.Lens' ConnectDirectoryResponse (Prelude.Maybe Prelude.Text)
connectDirectoryResponse_directoryId :: (Maybe Text -> f (Maybe Text))
-> ConnectDirectoryResponse -> f ConnectDirectoryResponse
connectDirectoryResponse_directoryId = (ConnectDirectoryResponse -> Maybe Text)
-> (ConnectDirectoryResponse
    -> Maybe Text -> ConnectDirectoryResponse)
-> Lens
     ConnectDirectoryResponse
     ConnectDirectoryResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectDirectoryResponse' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:ConnectDirectoryResponse' :: ConnectDirectoryResponse -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: ConnectDirectoryResponse
s@ConnectDirectoryResponse' {} Maybe Text
a -> ConnectDirectoryResponse
s {$sel:directoryId:ConnectDirectoryResponse' :: Maybe Text
directoryId = Maybe Text
a} :: ConnectDirectoryResponse)

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

instance Prelude.NFData ConnectDirectoryResponse