{-# 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.Connect.CreateInstance
-- 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)
--
-- This API is in preview release for Amazon Connect and is subject to
-- change.
--
-- Initiates an Amazon Connect instance with all the supported channels
-- enabled. It does not attach any storage, such as Amazon Simple Storage
-- Service (Amazon S3) or Amazon Kinesis. It also does not allow for any
-- configurations on features, such as Contact Lens for Amazon Connect.
--
-- Amazon Connect enforces a limit on the total number of instances that
-- you can create or delete in 30 days. If you exceed this limit, you will
-- get an error message indicating there has been an excessive number of
-- attempts at creating or deleting instances. You must wait 30 days before
-- you can restart creating and deleting instances in your account.
module Amazonka.Connect.CreateInstance
  ( -- * Creating a Request
    CreateInstance (..),
    newCreateInstance,

    -- * Request Lenses
    createInstance_directoryId,
    createInstance_clientToken,
    createInstance_instanceAlias,
    createInstance_identityManagementType,
    createInstance_inboundCallsEnabled,
    createInstance_outboundCallsEnabled,

    -- * Destructuring the Response
    CreateInstanceResponse (..),
    newCreateInstanceResponse,

    -- * Response Lenses
    createInstanceResponse_arn,
    createInstanceResponse_id,
    createInstanceResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
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:/ 'newCreateInstance' smart constructor.
data CreateInstance = CreateInstance'
  { -- | The identifier for the directory.
    CreateInstance -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The idempotency token.
    CreateInstance -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The name for your instance.
    CreateInstance -> Maybe (Sensitive Text)
instanceAlias :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The type of identity management for your Amazon Connect users.
    CreateInstance -> DirectoryType
identityManagementType :: DirectoryType,
    -- | Your contact center handles incoming contacts.
    CreateInstance -> Bool
inboundCallsEnabled :: Prelude.Bool,
    -- | Your contact center allows outbound calls.
    CreateInstance -> Bool
outboundCallsEnabled :: Prelude.Bool
  }
  deriving (CreateInstance -> CreateInstance -> Bool
(CreateInstance -> CreateInstance -> Bool)
-> (CreateInstance -> CreateInstance -> Bool) -> Eq CreateInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstance -> CreateInstance -> Bool
$c/= :: CreateInstance -> CreateInstance -> Bool
== :: CreateInstance -> CreateInstance -> Bool
$c== :: CreateInstance -> CreateInstance -> Bool
Prelude.Eq, Int -> CreateInstance -> ShowS
[CreateInstance] -> ShowS
CreateInstance -> String
(Int -> CreateInstance -> ShowS)
-> (CreateInstance -> String)
-> ([CreateInstance] -> ShowS)
-> Show CreateInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstance] -> ShowS
$cshowList :: [CreateInstance] -> ShowS
show :: CreateInstance -> String
$cshow :: CreateInstance -> String
showsPrec :: Int -> CreateInstance -> ShowS
$cshowsPrec :: Int -> CreateInstance -> ShowS
Prelude.Show, (forall x. CreateInstance -> Rep CreateInstance x)
-> (forall x. Rep CreateInstance x -> CreateInstance)
-> Generic CreateInstance
forall x. Rep CreateInstance x -> CreateInstance
forall x. CreateInstance -> Rep CreateInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInstance x -> CreateInstance
$cfrom :: forall x. CreateInstance -> Rep CreateInstance x
Prelude.Generic)

-- |
-- Create a value of 'CreateInstance' 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', 'createInstance_directoryId' - The identifier for the directory.
--
-- 'clientToken', 'createInstance_clientToken' - The idempotency token.
--
-- 'instanceAlias', 'createInstance_instanceAlias' - The name for your instance.
--
-- 'identityManagementType', 'createInstance_identityManagementType' - The type of identity management for your Amazon Connect users.
--
-- 'inboundCallsEnabled', 'createInstance_inboundCallsEnabled' - Your contact center handles incoming contacts.
--
-- 'outboundCallsEnabled', 'createInstance_outboundCallsEnabled' - Your contact center allows outbound calls.
newCreateInstance ::
  -- | 'identityManagementType'
  DirectoryType ->
  -- | 'inboundCallsEnabled'
  Prelude.Bool ->
  -- | 'outboundCallsEnabled'
  Prelude.Bool ->
  CreateInstance
newCreateInstance :: DirectoryType -> Bool -> Bool -> CreateInstance
newCreateInstance
  DirectoryType
pIdentityManagementType_
  Bool
pInboundCallsEnabled_
  Bool
pOutboundCallsEnabled_ =
    CreateInstance' :: Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> DirectoryType
-> Bool
-> Bool
-> CreateInstance
CreateInstance'
      { $sel:directoryId:CreateInstance' :: Maybe Text
directoryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:CreateInstance' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceAlias:CreateInstance' :: Maybe (Sensitive Text)
instanceAlias = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:identityManagementType:CreateInstance' :: DirectoryType
identityManagementType = DirectoryType
pIdentityManagementType_,
        $sel:inboundCallsEnabled:CreateInstance' :: Bool
inboundCallsEnabled = Bool
pInboundCallsEnabled_,
        $sel:outboundCallsEnabled:CreateInstance' :: Bool
outboundCallsEnabled = Bool
pOutboundCallsEnabled_
      }

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

-- | The idempotency token.
createInstance_clientToken :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_clientToken = (CreateInstance -> Maybe Text)
-> (CreateInstance -> Maybe Text -> CreateInstance)
-> Lens CreateInstance CreateInstance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateInstance' :: CreateInstance -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateInstance
s@CreateInstance' {} Maybe Text
a -> CreateInstance
s {$sel:clientToken:CreateInstance' :: Maybe Text
clientToken = Maybe Text
a} :: CreateInstance)

-- | The name for your instance.
createInstance_instanceAlias :: Lens.Lens' CreateInstance (Prelude.Maybe Prelude.Text)
createInstance_instanceAlias :: (Maybe Text -> f (Maybe Text))
-> CreateInstance -> f CreateInstance
createInstance_instanceAlias = (CreateInstance -> Maybe (Sensitive Text))
-> (CreateInstance -> Maybe (Sensitive Text) -> CreateInstance)
-> Lens
     CreateInstance
     CreateInstance
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Maybe (Sensitive Text)
instanceAlias :: Maybe (Sensitive Text)
$sel:instanceAlias:CreateInstance' :: CreateInstance -> Maybe (Sensitive Text)
instanceAlias} -> Maybe (Sensitive Text)
instanceAlias) (\s :: CreateInstance
s@CreateInstance' {} Maybe (Sensitive Text)
a -> CreateInstance
s {$sel:instanceAlias:CreateInstance' :: Maybe (Sensitive Text)
instanceAlias = Maybe (Sensitive Text)
a} :: CreateInstance) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateInstance -> f CreateInstance)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateInstance
-> f CreateInstance
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 type of identity management for your Amazon Connect users.
createInstance_identityManagementType :: Lens.Lens' CreateInstance DirectoryType
createInstance_identityManagementType :: (DirectoryType -> f DirectoryType)
-> CreateInstance -> f CreateInstance
createInstance_identityManagementType = (CreateInstance -> DirectoryType)
-> (CreateInstance -> DirectoryType -> CreateInstance)
-> Lens CreateInstance CreateInstance DirectoryType DirectoryType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {DirectoryType
identityManagementType :: DirectoryType
$sel:identityManagementType:CreateInstance' :: CreateInstance -> DirectoryType
identityManagementType} -> DirectoryType
identityManagementType) (\s :: CreateInstance
s@CreateInstance' {} DirectoryType
a -> CreateInstance
s {$sel:identityManagementType:CreateInstance' :: DirectoryType
identityManagementType = DirectoryType
a} :: CreateInstance)

-- | Your contact center handles incoming contacts.
createInstance_inboundCallsEnabled :: Lens.Lens' CreateInstance Prelude.Bool
createInstance_inboundCallsEnabled :: (Bool -> f Bool) -> CreateInstance -> f CreateInstance
createInstance_inboundCallsEnabled = (CreateInstance -> Bool)
-> (CreateInstance -> Bool -> CreateInstance)
-> Lens CreateInstance CreateInstance Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Bool
inboundCallsEnabled :: Bool
$sel:inboundCallsEnabled:CreateInstance' :: CreateInstance -> Bool
inboundCallsEnabled} -> Bool
inboundCallsEnabled) (\s :: CreateInstance
s@CreateInstance' {} Bool
a -> CreateInstance
s {$sel:inboundCallsEnabled:CreateInstance' :: Bool
inboundCallsEnabled = Bool
a} :: CreateInstance)

-- | Your contact center allows outbound calls.
createInstance_outboundCallsEnabled :: Lens.Lens' CreateInstance Prelude.Bool
createInstance_outboundCallsEnabled :: (Bool -> f Bool) -> CreateInstance -> f CreateInstance
createInstance_outboundCallsEnabled = (CreateInstance -> Bool)
-> (CreateInstance -> Bool -> CreateInstance)
-> Lens CreateInstance CreateInstance Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstance' {Bool
outboundCallsEnabled :: Bool
$sel:outboundCallsEnabled:CreateInstance' :: CreateInstance -> Bool
outboundCallsEnabled} -> Bool
outboundCallsEnabled) (\s :: CreateInstance
s@CreateInstance' {} Bool
a -> CreateInstance
s {$sel:outboundCallsEnabled:CreateInstance' :: Bool
outboundCallsEnabled = Bool
a} :: CreateInstance)

instance Core.AWSRequest CreateInstance where
  type
    AWSResponse CreateInstance =
      CreateInstanceResponse
  request :: CreateInstance -> Request CreateInstance
request = Service -> CreateInstance -> Request CreateInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateInstance)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateInstance))
-> Logger
-> Service
-> Proxy CreateInstance
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateInstance)))
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 -> Maybe Text -> Int -> CreateInstanceResponse
CreateInstanceResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateInstanceResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateInstanceResponse)
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
"Arn")
            Either String (Maybe Text -> Int -> CreateInstanceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateInstanceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Id")
            Either String (Int -> CreateInstanceResponse)
-> Either String Int -> Either String CreateInstanceResponse
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 CreateInstance

instance Prelude.NFData CreateInstance

instance Core.ToHeaders CreateInstance where
  toHeaders :: CreateInstance -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateInstance where
  toJSON :: CreateInstance -> Value
toJSON CreateInstance' {Bool
Maybe Text
Maybe (Sensitive Text)
DirectoryType
outboundCallsEnabled :: Bool
inboundCallsEnabled :: Bool
identityManagementType :: DirectoryType
instanceAlias :: Maybe (Sensitive Text)
clientToken :: Maybe Text
directoryId :: Maybe Text
$sel:outboundCallsEnabled:CreateInstance' :: CreateInstance -> Bool
$sel:inboundCallsEnabled:CreateInstance' :: CreateInstance -> Bool
$sel:identityManagementType:CreateInstance' :: CreateInstance -> DirectoryType
$sel:instanceAlias:CreateInstance' :: CreateInstance -> Maybe (Sensitive Text)
$sel:clientToken:CreateInstance' :: CreateInstance -> Maybe Text
$sel:directoryId:CreateInstance' :: CreateInstance -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DirectoryId" 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
directoryId,
            (Text
"ClientToken" 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
clientToken,
            (Text
"InstanceAlias" 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)
instanceAlias,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"IdentityManagementType"
                  Text -> DirectoryType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DirectoryType
identityManagementType
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"InboundCallsEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
inboundCallsEnabled),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"OutboundCallsEnabled"
                  Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
outboundCallsEnabled
              )
          ]
      )

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

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

-- | /See:/ 'newCreateInstanceResponse' smart constructor.
data CreateInstanceResponse = CreateInstanceResponse'
  { -- | The Amazon Resource Name (ARN) of the instance.
    CreateInstanceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the instance.
    CreateInstanceResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateInstanceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateInstanceResponse -> CreateInstanceResponse -> Bool
(CreateInstanceResponse -> CreateInstanceResponse -> Bool)
-> (CreateInstanceResponse -> CreateInstanceResponse -> Bool)
-> Eq CreateInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
$c/= :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
== :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
$c== :: CreateInstanceResponse -> CreateInstanceResponse -> Bool
Prelude.Eq, ReadPrec [CreateInstanceResponse]
ReadPrec CreateInstanceResponse
Int -> ReadS CreateInstanceResponse
ReadS [CreateInstanceResponse]
(Int -> ReadS CreateInstanceResponse)
-> ReadS [CreateInstanceResponse]
-> ReadPrec CreateInstanceResponse
-> ReadPrec [CreateInstanceResponse]
-> Read CreateInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstanceResponse]
$creadListPrec :: ReadPrec [CreateInstanceResponse]
readPrec :: ReadPrec CreateInstanceResponse
$creadPrec :: ReadPrec CreateInstanceResponse
readList :: ReadS [CreateInstanceResponse]
$creadList :: ReadS [CreateInstanceResponse]
readsPrec :: Int -> ReadS CreateInstanceResponse
$creadsPrec :: Int -> ReadS CreateInstanceResponse
Prelude.Read, Int -> CreateInstanceResponse -> ShowS
[CreateInstanceResponse] -> ShowS
CreateInstanceResponse -> String
(Int -> CreateInstanceResponse -> ShowS)
-> (CreateInstanceResponse -> String)
-> ([CreateInstanceResponse] -> ShowS)
-> Show CreateInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstanceResponse] -> ShowS
$cshowList :: [CreateInstanceResponse] -> ShowS
show :: CreateInstanceResponse -> String
$cshow :: CreateInstanceResponse -> String
showsPrec :: Int -> CreateInstanceResponse -> ShowS
$cshowsPrec :: Int -> CreateInstanceResponse -> ShowS
Prelude.Show, (forall x. CreateInstanceResponse -> Rep CreateInstanceResponse x)
-> (forall x.
    Rep CreateInstanceResponse x -> CreateInstanceResponse)
-> Generic CreateInstanceResponse
forall x. Rep CreateInstanceResponse x -> CreateInstanceResponse
forall x. CreateInstanceResponse -> Rep CreateInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInstanceResponse x -> CreateInstanceResponse
$cfrom :: forall x. CreateInstanceResponse -> Rep CreateInstanceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateInstanceResponse' 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:
--
-- 'arn', 'createInstanceResponse_arn' - The Amazon Resource Name (ARN) of the instance.
--
-- 'id', 'createInstanceResponse_id' - The identifier for the instance.
--
-- 'httpStatus', 'createInstanceResponse_httpStatus' - The response's http status code.
newCreateInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateInstanceResponse
newCreateInstanceResponse :: Int -> CreateInstanceResponse
newCreateInstanceResponse Int
pHttpStatus_ =
  CreateInstanceResponse' :: Maybe Text -> Maybe Text -> Int -> CreateInstanceResponse
CreateInstanceResponse'
    { $sel:arn:CreateInstanceResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateInstanceResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the instance.
createInstanceResponse_arn :: Lens.Lens' CreateInstanceResponse (Prelude.Maybe Prelude.Text)
createInstanceResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateInstanceResponse -> f CreateInstanceResponse
createInstanceResponse_arn = (CreateInstanceResponse -> Maybe Text)
-> (CreateInstanceResponse -> Maybe Text -> CreateInstanceResponse)
-> Lens
     CreateInstanceResponse
     CreateInstanceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateInstanceResponse' :: CreateInstanceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateInstanceResponse
s@CreateInstanceResponse' {} Maybe Text
a -> CreateInstanceResponse
s {$sel:arn:CreateInstanceResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateInstanceResponse)

-- | The identifier for the instance.
createInstanceResponse_id :: Lens.Lens' CreateInstanceResponse (Prelude.Maybe Prelude.Text)
createInstanceResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateInstanceResponse -> f CreateInstanceResponse
createInstanceResponse_id = (CreateInstanceResponse -> Maybe Text)
-> (CreateInstanceResponse -> Maybe Text -> CreateInstanceResponse)
-> Lens
     CreateInstanceResponse
     CreateInstanceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateInstanceResponse' :: CreateInstanceResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateInstanceResponse
s@CreateInstanceResponse' {} Maybe Text
a -> CreateInstanceResponse
s {$sel:id:CreateInstanceResponse' :: Maybe Text
id = Maybe Text
a} :: CreateInstanceResponse)

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

instance Prelude.NFData CreateInstanceResponse