{-# 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.Chime.CreateAppInstance
-- 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 Amazon Chime SDK messaging @AppInstance@ under an AWS
-- account. Only SDK messaging customers use this API. @CreateAppInstance@
-- supports idempotency behavior as described in the AWS API Standard.
module Amazonka.Chime.CreateAppInstance
  ( -- * Creating a Request
    CreateAppInstance (..),
    newCreateAppInstance,

    -- * Request Lenses
    createAppInstance_metadata,
    createAppInstance_tags,
    createAppInstance_name,
    createAppInstance_clientRequestToken,

    -- * Destructuring the Response
    CreateAppInstanceResponse (..),
    newCreateAppInstanceResponse,

    -- * Response Lenses
    createAppInstanceResponse_appInstanceArn,
    createAppInstanceResponse_httpStatus,
  )
where

import Amazonka.Chime.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:/ 'newCreateAppInstance' smart constructor.
data CreateAppInstance = CreateAppInstance'
  { -- | The metadata of the @AppInstance@. Limited to a 1KB string in UTF-8.
    CreateAppInstance -> Maybe (Sensitive Text)
metadata :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Tags assigned to the @AppInstanceUser@.
    CreateAppInstance -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The name of the @AppInstance@.
    CreateAppInstance -> Sensitive Text
name :: Core.Sensitive Prelude.Text,
    -- | The @ClientRequestToken@ of the @AppInstance@.
    CreateAppInstance -> Sensitive Text
clientRequestToken :: Core.Sensitive Prelude.Text
  }
  deriving (CreateAppInstance -> CreateAppInstance -> Bool
(CreateAppInstance -> CreateAppInstance -> Bool)
-> (CreateAppInstance -> CreateAppInstance -> Bool)
-> Eq CreateAppInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppInstance -> CreateAppInstance -> Bool
$c/= :: CreateAppInstance -> CreateAppInstance -> Bool
== :: CreateAppInstance -> CreateAppInstance -> Bool
$c== :: CreateAppInstance -> CreateAppInstance -> Bool
Prelude.Eq, Int -> CreateAppInstance -> ShowS
[CreateAppInstance] -> ShowS
CreateAppInstance -> String
(Int -> CreateAppInstance -> ShowS)
-> (CreateAppInstance -> String)
-> ([CreateAppInstance] -> ShowS)
-> Show CreateAppInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppInstance] -> ShowS
$cshowList :: [CreateAppInstance] -> ShowS
show :: CreateAppInstance -> String
$cshow :: CreateAppInstance -> String
showsPrec :: Int -> CreateAppInstance -> ShowS
$cshowsPrec :: Int -> CreateAppInstance -> ShowS
Prelude.Show, (forall x. CreateAppInstance -> Rep CreateAppInstance x)
-> (forall x. Rep CreateAppInstance x -> CreateAppInstance)
-> Generic CreateAppInstance
forall x. Rep CreateAppInstance x -> CreateAppInstance
forall x. CreateAppInstance -> Rep CreateAppInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAppInstance x -> CreateAppInstance
$cfrom :: forall x. CreateAppInstance -> Rep CreateAppInstance x
Prelude.Generic)

-- |
-- Create a value of 'CreateAppInstance' 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:
--
-- 'metadata', 'createAppInstance_metadata' - The metadata of the @AppInstance@. Limited to a 1KB string in UTF-8.
--
-- 'tags', 'createAppInstance_tags' - Tags assigned to the @AppInstanceUser@.
--
-- 'name', 'createAppInstance_name' - The name of the @AppInstance@.
--
-- 'clientRequestToken', 'createAppInstance_clientRequestToken' - The @ClientRequestToken@ of the @AppInstance@.
newCreateAppInstance ::
  -- | 'name'
  Prelude.Text ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  CreateAppInstance
newCreateAppInstance :: Text -> Text -> CreateAppInstance
newCreateAppInstance Text
pName_ Text
pClientRequestToken_ =
  CreateAppInstance' :: Maybe (Sensitive Text)
-> Maybe (NonEmpty Tag)
-> Sensitive Text
-> Sensitive Text
-> CreateAppInstance
CreateAppInstance'
    { $sel:metadata:CreateAppInstance' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateAppInstance' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateAppInstance' :: Sensitive Text
name = 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
pName_,
      $sel:clientRequestToken:CreateAppInstance' :: Sensitive Text
clientRequestToken =
        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
pClientRequestToken_
    }

-- | The metadata of the @AppInstance@. Limited to a 1KB string in UTF-8.
createAppInstance_metadata :: Lens.Lens' CreateAppInstance (Prelude.Maybe Prelude.Text)
createAppInstance_metadata :: (Maybe Text -> f (Maybe Text))
-> CreateAppInstance -> f CreateAppInstance
createAppInstance_metadata = (CreateAppInstance -> Maybe (Sensitive Text))
-> (CreateAppInstance
    -> Maybe (Sensitive Text) -> CreateAppInstance)
-> Lens
     CreateAppInstance
     CreateAppInstance
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppInstance' {Maybe (Sensitive Text)
metadata :: Maybe (Sensitive Text)
$sel:metadata:CreateAppInstance' :: CreateAppInstance -> Maybe (Sensitive Text)
metadata} -> Maybe (Sensitive Text)
metadata) (\s :: CreateAppInstance
s@CreateAppInstance' {} Maybe (Sensitive Text)
a -> CreateAppInstance
s {$sel:metadata:CreateAppInstance' :: Maybe (Sensitive Text)
metadata = Maybe (Sensitive Text)
a} :: CreateAppInstance) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateAppInstance -> f CreateAppInstance)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateAppInstance
-> f CreateAppInstance
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

-- | Tags assigned to the @AppInstanceUser@.
createAppInstance_tags :: Lens.Lens' CreateAppInstance (Prelude.Maybe (Prelude.NonEmpty Tag))
createAppInstance_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAppInstance -> f CreateAppInstance
createAppInstance_tags = (CreateAppInstance -> Maybe (NonEmpty Tag))
-> (CreateAppInstance -> Maybe (NonEmpty Tag) -> CreateAppInstance)
-> Lens
     CreateAppInstance
     CreateAppInstance
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppInstance' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:CreateAppInstance' :: CreateAppInstance -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: CreateAppInstance
s@CreateAppInstance' {} Maybe (NonEmpty Tag)
a -> CreateAppInstance
s {$sel:tags:CreateAppInstance' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: CreateAppInstance) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> CreateAppInstance -> f CreateAppInstance)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> CreateAppInstance
-> f CreateAppInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty 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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the @AppInstance@.
createAppInstance_name :: Lens.Lens' CreateAppInstance Prelude.Text
createAppInstance_name :: (Text -> f Text) -> CreateAppInstance -> f CreateAppInstance
createAppInstance_name = (CreateAppInstance -> Sensitive Text)
-> (CreateAppInstance -> Sensitive Text -> CreateAppInstance)
-> Lens
     CreateAppInstance
     CreateAppInstance
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppInstance' {Sensitive Text
name :: Sensitive Text
$sel:name:CreateAppInstance' :: CreateAppInstance -> Sensitive Text
name} -> Sensitive Text
name) (\s :: CreateAppInstance
s@CreateAppInstance' {} Sensitive Text
a -> CreateAppInstance
s {$sel:name:CreateAppInstance' :: Sensitive Text
name = Sensitive Text
a} :: CreateAppInstance) ((Sensitive Text -> f (Sensitive Text))
 -> CreateAppInstance -> f CreateAppInstance)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateAppInstance
-> f CreateAppInstance
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 @ClientRequestToken@ of the @AppInstance@.
createAppInstance_clientRequestToken :: Lens.Lens' CreateAppInstance Prelude.Text
createAppInstance_clientRequestToken :: (Text -> f Text) -> CreateAppInstance -> f CreateAppInstance
createAppInstance_clientRequestToken = (CreateAppInstance -> Sensitive Text)
-> (CreateAppInstance -> Sensitive Text -> CreateAppInstance)
-> Lens
     CreateAppInstance
     CreateAppInstance
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppInstance' {Sensitive Text
clientRequestToken :: Sensitive Text
$sel:clientRequestToken:CreateAppInstance' :: CreateAppInstance -> Sensitive Text
clientRequestToken} -> Sensitive Text
clientRequestToken) (\s :: CreateAppInstance
s@CreateAppInstance' {} Sensitive Text
a -> CreateAppInstance
s {$sel:clientRequestToken:CreateAppInstance' :: Sensitive Text
clientRequestToken = Sensitive Text
a} :: CreateAppInstance) ((Sensitive Text -> f (Sensitive Text))
 -> CreateAppInstance -> f CreateAppInstance)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> CreateAppInstance
-> f CreateAppInstance
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

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

instance Prelude.NFData CreateAppInstance

instance Core.ToHeaders CreateAppInstance where
  toHeaders :: CreateAppInstance -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateAppInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateAppInstance where
  toJSON :: CreateAppInstance -> Value
toJSON CreateAppInstance' {Maybe (NonEmpty Tag)
Maybe (Sensitive Text)
Sensitive Text
clientRequestToken :: Sensitive Text
name :: Sensitive Text
tags :: Maybe (NonEmpty Tag)
metadata :: Maybe (Sensitive Text)
$sel:clientRequestToken:CreateAppInstance' :: CreateAppInstance -> Sensitive Text
$sel:name:CreateAppInstance' :: CreateAppInstance -> Sensitive Text
$sel:tags:CreateAppInstance' :: CreateAppInstance -> Maybe (NonEmpty Tag)
$sel:metadata:CreateAppInstance' :: CreateAppInstance -> Maybe (Sensitive Text)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Metadata" 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)
metadata,
            (Text
"Tags" Text -> NonEmpty Tag -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Tag -> Pair) -> Maybe (NonEmpty Tag) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ClientRequestToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
clientRequestToken)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateAppInstanceResponse' 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:
--
-- 'appInstanceArn', 'createAppInstanceResponse_appInstanceArn' - The Amazon Resource Number (ARN) of the @AppInstance@.
--
-- 'httpStatus', 'createAppInstanceResponse_httpStatus' - The response's http status code.
newCreateAppInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAppInstanceResponse
newCreateAppInstanceResponse :: Int -> CreateAppInstanceResponse
newCreateAppInstanceResponse Int
pHttpStatus_ =
  CreateAppInstanceResponse' :: Maybe Text -> Int -> CreateAppInstanceResponse
CreateAppInstanceResponse'
    { $sel:appInstanceArn:CreateAppInstanceResponse' :: Maybe Text
appInstanceArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAppInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Number (ARN) of the @AppInstance@.
createAppInstanceResponse_appInstanceArn :: Lens.Lens' CreateAppInstanceResponse (Prelude.Maybe Prelude.Text)
createAppInstanceResponse_appInstanceArn :: (Maybe Text -> f (Maybe Text))
-> CreateAppInstanceResponse -> f CreateAppInstanceResponse
createAppInstanceResponse_appInstanceArn = (CreateAppInstanceResponse -> Maybe Text)
-> (CreateAppInstanceResponse
    -> Maybe Text -> CreateAppInstanceResponse)
-> Lens
     CreateAppInstanceResponse
     CreateAppInstanceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppInstanceResponse' {Maybe Text
appInstanceArn :: Maybe Text
$sel:appInstanceArn:CreateAppInstanceResponse' :: CreateAppInstanceResponse -> Maybe Text
appInstanceArn} -> Maybe Text
appInstanceArn) (\s :: CreateAppInstanceResponse
s@CreateAppInstanceResponse' {} Maybe Text
a -> CreateAppInstanceResponse
s {$sel:appInstanceArn:CreateAppInstanceResponse' :: Maybe Text
appInstanceArn = Maybe Text
a} :: CreateAppInstanceResponse)

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

instance Prelude.NFData CreateAppInstanceResponse