{-# 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.AppStream.CreateAppBlock
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an app block.
--
-- App blocks are an Amazon AppStream 2.0 resource that stores the details
-- about the virtual hard disk in an S3 bucket. It also stores the setup
-- script with details about how to mount the virtual hard disk. The
-- virtual hard disk includes the application binaries and other files
-- necessary to launch your applications. Multiple applications can be
-- assigned to a single app block.
--
-- This is only supported for Elastic fleets.
module Amazonka.AppStream.CreateAppBlock
  ( -- * Creating a Request
    CreateAppBlock (..),
    newCreateAppBlock,

    -- * Request Lenses
    createAppBlock_description,
    createAppBlock_displayName,
    createAppBlock_tags,
    createAppBlock_name,
    createAppBlock_sourceS3Location,
    createAppBlock_setupScriptDetails,

    -- * Destructuring the Response
    CreateAppBlockResponse (..),
    newCreateAppBlockResponse,

    -- * Response Lenses
    createAppBlockResponse_appBlock,
    createAppBlockResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateAppBlock' smart constructor.
data CreateAppBlock = CreateAppBlock'
  { -- | The description of the app block.
    CreateAppBlock -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The display name of the app block. This is not displayed to the user.
    CreateAppBlock -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The tags assigned to the app block.
    CreateAppBlock -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the app block.
    CreateAppBlock -> Text
name :: Prelude.Text,
    -- | The source S3 location of the app block.
    CreateAppBlock -> S3Location
sourceS3Location :: S3Location,
    -- | The setup script details of the app block.
    CreateAppBlock -> ScriptDetails
setupScriptDetails :: ScriptDetails
  }
  deriving (CreateAppBlock -> CreateAppBlock -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppBlock -> CreateAppBlock -> Bool
$c/= :: CreateAppBlock -> CreateAppBlock -> Bool
== :: CreateAppBlock -> CreateAppBlock -> Bool
$c== :: CreateAppBlock -> CreateAppBlock -> Bool
Prelude.Eq, ReadPrec [CreateAppBlock]
ReadPrec CreateAppBlock
Int -> ReadS CreateAppBlock
ReadS [CreateAppBlock]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppBlock]
$creadListPrec :: ReadPrec [CreateAppBlock]
readPrec :: ReadPrec CreateAppBlock
$creadPrec :: ReadPrec CreateAppBlock
readList :: ReadS [CreateAppBlock]
$creadList :: ReadS [CreateAppBlock]
readsPrec :: Int -> ReadS CreateAppBlock
$creadsPrec :: Int -> ReadS CreateAppBlock
Prelude.Read, Int -> CreateAppBlock -> ShowS
[CreateAppBlock] -> ShowS
CreateAppBlock -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppBlock] -> ShowS
$cshowList :: [CreateAppBlock] -> ShowS
show :: CreateAppBlock -> String
$cshow :: CreateAppBlock -> String
showsPrec :: Int -> CreateAppBlock -> ShowS
$cshowsPrec :: Int -> CreateAppBlock -> ShowS
Prelude.Show, forall x. Rep CreateAppBlock x -> CreateAppBlock
forall x. CreateAppBlock -> Rep CreateAppBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAppBlock x -> CreateAppBlock
$cfrom :: forall x. CreateAppBlock -> Rep CreateAppBlock x
Prelude.Generic)

-- |
-- Create a value of 'CreateAppBlock' 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:
--
-- 'description', 'createAppBlock_description' - The description of the app block.
--
-- 'displayName', 'createAppBlock_displayName' - The display name of the app block. This is not displayed to the user.
--
-- 'tags', 'createAppBlock_tags' - The tags assigned to the app block.
--
-- 'name', 'createAppBlock_name' - The name of the app block.
--
-- 'sourceS3Location', 'createAppBlock_sourceS3Location' - The source S3 location of the app block.
--
-- 'setupScriptDetails', 'createAppBlock_setupScriptDetails' - The setup script details of the app block.
newCreateAppBlock ::
  -- | 'name'
  Prelude.Text ->
  -- | 'sourceS3Location'
  S3Location ->
  -- | 'setupScriptDetails'
  ScriptDetails ->
  CreateAppBlock
newCreateAppBlock :: Text -> S3Location -> ScriptDetails -> CreateAppBlock
newCreateAppBlock
  Text
pName_
  S3Location
pSourceS3Location_
  ScriptDetails
pSetupScriptDetails_ =
    CreateAppBlock'
      { $sel:description:CreateAppBlock' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:displayName:CreateAppBlock' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateAppBlock' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateAppBlock' :: Text
name = Text
pName_,
        $sel:sourceS3Location:CreateAppBlock' :: S3Location
sourceS3Location = S3Location
pSourceS3Location_,
        $sel:setupScriptDetails:CreateAppBlock' :: ScriptDetails
setupScriptDetails = ScriptDetails
pSetupScriptDetails_
      }

-- | The description of the app block.
createAppBlock_description :: Lens.Lens' CreateAppBlock (Prelude.Maybe Prelude.Text)
createAppBlock_description :: Lens' CreateAppBlock (Maybe Text)
createAppBlock_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlock' {Maybe Text
description :: Maybe Text
$sel:description:CreateAppBlock' :: CreateAppBlock -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateAppBlock
s@CreateAppBlock' {} Maybe Text
a -> CreateAppBlock
s {$sel:description:CreateAppBlock' :: Maybe Text
description = Maybe Text
a} :: CreateAppBlock)

-- | The display name of the app block. This is not displayed to the user.
createAppBlock_displayName :: Lens.Lens' CreateAppBlock (Prelude.Maybe Prelude.Text)
createAppBlock_displayName :: Lens' CreateAppBlock (Maybe Text)
createAppBlock_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlock' {Maybe Text
displayName :: Maybe Text
$sel:displayName:CreateAppBlock' :: CreateAppBlock -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: CreateAppBlock
s@CreateAppBlock' {} Maybe Text
a -> CreateAppBlock
s {$sel:displayName:CreateAppBlock' :: Maybe Text
displayName = Maybe Text
a} :: CreateAppBlock)

-- | The tags assigned to the app block.
createAppBlock_tags :: Lens.Lens' CreateAppBlock (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createAppBlock_tags :: Lens' CreateAppBlock (Maybe (HashMap Text Text))
createAppBlock_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlock' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateAppBlock' :: CreateAppBlock -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateAppBlock
s@CreateAppBlock' {} Maybe (HashMap Text Text)
a -> CreateAppBlock
s {$sel:tags:CreateAppBlock' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateAppBlock) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the app block.
createAppBlock_name :: Lens.Lens' CreateAppBlock Prelude.Text
createAppBlock_name :: Lens' CreateAppBlock Text
createAppBlock_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlock' {Text
name :: Text
$sel:name:CreateAppBlock' :: CreateAppBlock -> Text
name} -> Text
name) (\s :: CreateAppBlock
s@CreateAppBlock' {} Text
a -> CreateAppBlock
s {$sel:name:CreateAppBlock' :: Text
name = Text
a} :: CreateAppBlock)

-- | The source S3 location of the app block.
createAppBlock_sourceS3Location :: Lens.Lens' CreateAppBlock S3Location
createAppBlock_sourceS3Location :: Lens' CreateAppBlock S3Location
createAppBlock_sourceS3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlock' {S3Location
sourceS3Location :: S3Location
$sel:sourceS3Location:CreateAppBlock' :: CreateAppBlock -> S3Location
sourceS3Location} -> S3Location
sourceS3Location) (\s :: CreateAppBlock
s@CreateAppBlock' {} S3Location
a -> CreateAppBlock
s {$sel:sourceS3Location:CreateAppBlock' :: S3Location
sourceS3Location = S3Location
a} :: CreateAppBlock)

-- | The setup script details of the app block.
createAppBlock_setupScriptDetails :: Lens.Lens' CreateAppBlock ScriptDetails
createAppBlock_setupScriptDetails :: Lens' CreateAppBlock ScriptDetails
createAppBlock_setupScriptDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlock' {ScriptDetails
setupScriptDetails :: ScriptDetails
$sel:setupScriptDetails:CreateAppBlock' :: CreateAppBlock -> ScriptDetails
setupScriptDetails} -> ScriptDetails
setupScriptDetails) (\s :: CreateAppBlock
s@CreateAppBlock' {} ScriptDetails
a -> CreateAppBlock
s {$sel:setupScriptDetails:CreateAppBlock' :: ScriptDetails
setupScriptDetails = ScriptDetails
a} :: CreateAppBlock)

instance Core.AWSRequest CreateAppBlock where
  type
    AWSResponse CreateAppBlock =
      CreateAppBlockResponse
  request :: (Service -> Service) -> CreateAppBlock -> Request CreateAppBlock
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateAppBlock
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateAppBlock)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe AppBlock -> Int -> CreateAppBlockResponse
CreateAppBlockResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AppBlock")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateAppBlock where
  hashWithSalt :: Int -> CreateAppBlock -> Int
hashWithSalt Int
_salt CreateAppBlock' {Maybe Text
Maybe (HashMap Text Text)
Text
S3Location
ScriptDetails
setupScriptDetails :: ScriptDetails
sourceS3Location :: S3Location
name :: Text
tags :: Maybe (HashMap Text Text)
displayName :: Maybe Text
description :: Maybe Text
$sel:setupScriptDetails:CreateAppBlock' :: CreateAppBlock -> ScriptDetails
$sel:sourceS3Location:CreateAppBlock' :: CreateAppBlock -> S3Location
$sel:name:CreateAppBlock' :: CreateAppBlock -> Text
$sel:tags:CreateAppBlock' :: CreateAppBlock -> Maybe (HashMap Text Text)
$sel:displayName:CreateAppBlock' :: CreateAppBlock -> Maybe Text
$sel:description:CreateAppBlock' :: CreateAppBlock -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3Location
sourceS3Location
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScriptDetails
setupScriptDetails

instance Prelude.NFData CreateAppBlock where
  rnf :: CreateAppBlock -> ()
rnf CreateAppBlock' {Maybe Text
Maybe (HashMap Text Text)
Text
S3Location
ScriptDetails
setupScriptDetails :: ScriptDetails
sourceS3Location :: S3Location
name :: Text
tags :: Maybe (HashMap Text Text)
displayName :: Maybe Text
description :: Maybe Text
$sel:setupScriptDetails:CreateAppBlock' :: CreateAppBlock -> ScriptDetails
$sel:sourceS3Location:CreateAppBlock' :: CreateAppBlock -> S3Location
$sel:name:CreateAppBlock' :: CreateAppBlock -> Text
$sel:tags:CreateAppBlock' :: CreateAppBlock -> Maybe (HashMap Text Text)
$sel:displayName:CreateAppBlock' :: CreateAppBlock -> Maybe Text
$sel:description:CreateAppBlock' :: CreateAppBlock -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3Location
sourceS3Location
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScriptDetails
setupScriptDetails

instance Data.ToHeaders CreateAppBlock where
  toHeaders :: CreateAppBlock -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"PhotonAdminProxyService.CreateAppBlock" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateAppBlock where
  toJSON :: CreateAppBlock -> Value
toJSON CreateAppBlock' {Maybe Text
Maybe (HashMap Text Text)
Text
S3Location
ScriptDetails
setupScriptDetails :: ScriptDetails
sourceS3Location :: S3Location
name :: Text
tags :: Maybe (HashMap Text Text)
displayName :: Maybe Text
description :: Maybe Text
$sel:setupScriptDetails:CreateAppBlock' :: CreateAppBlock -> ScriptDetails
$sel:sourceS3Location:CreateAppBlock' :: CreateAppBlock -> S3Location
$sel:name:CreateAppBlock' :: CreateAppBlock -> Text
$sel:tags:CreateAppBlock' :: CreateAppBlock -> Maybe (HashMap Text Text)
$sel:displayName:CreateAppBlock' :: CreateAppBlock -> Maybe Text
$sel:description:CreateAppBlock' :: CreateAppBlock -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"DisplayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
displayName,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"SourceS3Location" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3Location
sourceS3Location),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"SetupScriptDetails" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ScriptDetails
setupScriptDetails)
          ]
      )

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

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

-- | /See:/ 'newCreateAppBlockResponse' smart constructor.
data CreateAppBlockResponse = CreateAppBlockResponse'
  { -- | The app block.
    CreateAppBlockResponse -> Maybe AppBlock
appBlock :: Prelude.Maybe AppBlock,
    -- | The response's http status code.
    CreateAppBlockResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateAppBlockResponse -> CreateAppBlockResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppBlockResponse -> CreateAppBlockResponse -> Bool
$c/= :: CreateAppBlockResponse -> CreateAppBlockResponse -> Bool
== :: CreateAppBlockResponse -> CreateAppBlockResponse -> Bool
$c== :: CreateAppBlockResponse -> CreateAppBlockResponse -> Bool
Prelude.Eq, ReadPrec [CreateAppBlockResponse]
ReadPrec CreateAppBlockResponse
Int -> ReadS CreateAppBlockResponse
ReadS [CreateAppBlockResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppBlockResponse]
$creadListPrec :: ReadPrec [CreateAppBlockResponse]
readPrec :: ReadPrec CreateAppBlockResponse
$creadPrec :: ReadPrec CreateAppBlockResponse
readList :: ReadS [CreateAppBlockResponse]
$creadList :: ReadS [CreateAppBlockResponse]
readsPrec :: Int -> ReadS CreateAppBlockResponse
$creadsPrec :: Int -> ReadS CreateAppBlockResponse
Prelude.Read, Int -> CreateAppBlockResponse -> ShowS
[CreateAppBlockResponse] -> ShowS
CreateAppBlockResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppBlockResponse] -> ShowS
$cshowList :: [CreateAppBlockResponse] -> ShowS
show :: CreateAppBlockResponse -> String
$cshow :: CreateAppBlockResponse -> String
showsPrec :: Int -> CreateAppBlockResponse -> ShowS
$cshowsPrec :: Int -> CreateAppBlockResponse -> ShowS
Prelude.Show, forall x. Rep CreateAppBlockResponse x -> CreateAppBlockResponse
forall x. CreateAppBlockResponse -> Rep CreateAppBlockResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAppBlockResponse x -> CreateAppBlockResponse
$cfrom :: forall x. CreateAppBlockResponse -> Rep CreateAppBlockResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAppBlockResponse' 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:
--
-- 'appBlock', 'createAppBlockResponse_appBlock' - The app block.
--
-- 'httpStatus', 'createAppBlockResponse_httpStatus' - The response's http status code.
newCreateAppBlockResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAppBlockResponse
newCreateAppBlockResponse :: Int -> CreateAppBlockResponse
newCreateAppBlockResponse Int
pHttpStatus_ =
  CreateAppBlockResponse'
    { $sel:appBlock:CreateAppBlockResponse' :: Maybe AppBlock
appBlock = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAppBlockResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The app block.
createAppBlockResponse_appBlock :: Lens.Lens' CreateAppBlockResponse (Prelude.Maybe AppBlock)
createAppBlockResponse_appBlock :: Lens' CreateAppBlockResponse (Maybe AppBlock)
createAppBlockResponse_appBlock = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppBlockResponse' {Maybe AppBlock
appBlock :: Maybe AppBlock
$sel:appBlock:CreateAppBlockResponse' :: CreateAppBlockResponse -> Maybe AppBlock
appBlock} -> Maybe AppBlock
appBlock) (\s :: CreateAppBlockResponse
s@CreateAppBlockResponse' {} Maybe AppBlock
a -> CreateAppBlockResponse
s {$sel:appBlock:CreateAppBlockResponse' :: Maybe AppBlock
appBlock = Maybe AppBlock
a} :: CreateAppBlockResponse)

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

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