{-# 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.Cloud9.CreateEnvironmentEC2
-- 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 Cloud9 development environment, launches an Amazon Elastic
-- Compute Cloud (Amazon EC2) instance, and then connects from the instance
-- to the environment.
module Amazonka.Cloud9.CreateEnvironmentEC2
  ( -- * Creating a Request
    CreateEnvironmentEC2 (..),
    newCreateEnvironmentEC2,

    -- * Request Lenses
    createEnvironmentEC2_automaticStopTimeMinutes,
    createEnvironmentEC2_subnetId,
    createEnvironmentEC2_ownerArn,
    createEnvironmentEC2_imageId,
    createEnvironmentEC2_clientRequestToken,
    createEnvironmentEC2_connectionType,
    createEnvironmentEC2_description,
    createEnvironmentEC2_dryRun,
    createEnvironmentEC2_tags,
    createEnvironmentEC2_name,
    createEnvironmentEC2_instanceType,

    -- * Destructuring the Response
    CreateEnvironmentEC2Response (..),
    newCreateEnvironmentEC2Response,

    -- * Response Lenses
    createEnvironmentEC2Response_environmentId,
    createEnvironmentEC2Response_httpStatus,
  )
where

import Amazonka.Cloud9.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:/ 'newCreateEnvironmentEC2' smart constructor.
data CreateEnvironmentEC2 = CreateEnvironmentEC2'
  { -- | The number of minutes until the running instance is shut down after the
    -- environment has last been used.
    CreateEnvironmentEC2 -> Maybe Int
automaticStopTimeMinutes :: Prelude.Maybe Prelude.Int,
    -- | The ID of the subnet in Amazon VPC that Cloud9 will use to communicate
    -- with the Amazon EC2 instance.
    CreateEnvironmentEC2 -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the environment owner. This ARN can be
    -- the ARN of any IAM principal. If this value is not specified, the ARN
    -- defaults to this environment\'s creator.
    CreateEnvironmentEC2 -> Maybe Text
ownerArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the Amazon Machine Image (AMI) that\'s used to create
    -- the EC2 instance. To choose an AMI for the instance, you must specify a
    -- valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.
    --
    -- The default AMI is used if the parameter isn\'t explicitly assigned a
    -- value in the request. Because Amazon Linux AMI has ended standard
    -- support as of December 31, 2020, we recommend you choose Amazon Linux 2,
    -- which includes long term support through 2023.
    --
    -- __AMI aliases__
    --
    -- -   __Amazon Linux (default): @amazonlinux-1-x86_64@__
    --
    -- -   Amazon Linux 2: @amazonlinux-2-x86_64@
    --
    -- -   Ubuntu 18.04: @ubuntu-18.04-x86_64@
    --
    -- __SSM paths__
    --
    -- -   __Amazon Linux (default):
    --     @resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-1-x86_64@__
    --
    -- -   Amazon Linux 2:
    --     @resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-2-x86_64@
    --
    -- -   Ubuntu 18.04:
    --     @resolve:ssm:\/aws\/service\/cloud9\/amis\/ubuntu-18.04-x86_64@
    CreateEnvironmentEC2 -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
    -- | A unique, case-sensitive string that helps Cloud9 to ensure this
    -- operation completes no more than one time.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Client Tokens>
    -- in the /Amazon EC2 API Reference/.
    CreateEnvironmentEC2 -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The connection type used for connecting to an Amazon EC2 environment.
    -- Valid values are @CONNECT_SSH@ (default) and @CONNECT_SSM@ (connected
    -- through Amazon EC2 Systems Manager).
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager>
    -- in the /Cloud9 User Guide/.
    CreateEnvironmentEC2 -> Maybe ConnectionType
connectionType :: Prelude.Maybe ConnectionType,
    -- | The description of the environment to create.
    CreateEnvironmentEC2 -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    CreateEnvironmentEC2 -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | An array of key-value pairs that will be associated with the new Cloud9
    -- development environment.
    CreateEnvironmentEC2 -> Maybe (Sensitive [Sensitive Tag])
tags :: Prelude.Maybe (Core.Sensitive [Core.Sensitive Tag]),
    -- | The name of the environment to create.
    --
    -- This name is visible to other IAM users in the same Amazon Web Services
    -- account.
    CreateEnvironmentEC2 -> Text
name :: Prelude.Text,
    -- | The type of instance to connect to the environment (for example,
    -- @t2.micro@).
    CreateEnvironmentEC2 -> Text
instanceType :: Prelude.Text
  }
  deriving (CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool
(CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool)
-> (CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool)
-> Eq CreateEnvironmentEC2
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool
$c/= :: CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool
== :: CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool
$c== :: CreateEnvironmentEC2 -> CreateEnvironmentEC2 -> Bool
Prelude.Eq, Int -> CreateEnvironmentEC2 -> ShowS
[CreateEnvironmentEC2] -> ShowS
CreateEnvironmentEC2 -> String
(Int -> CreateEnvironmentEC2 -> ShowS)
-> (CreateEnvironmentEC2 -> String)
-> ([CreateEnvironmentEC2] -> ShowS)
-> Show CreateEnvironmentEC2
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironmentEC2] -> ShowS
$cshowList :: [CreateEnvironmentEC2] -> ShowS
show :: CreateEnvironmentEC2 -> String
$cshow :: CreateEnvironmentEC2 -> String
showsPrec :: Int -> CreateEnvironmentEC2 -> ShowS
$cshowsPrec :: Int -> CreateEnvironmentEC2 -> ShowS
Prelude.Show, (forall x. CreateEnvironmentEC2 -> Rep CreateEnvironmentEC2 x)
-> (forall x. Rep CreateEnvironmentEC2 x -> CreateEnvironmentEC2)
-> Generic CreateEnvironmentEC2
forall x. Rep CreateEnvironmentEC2 x -> CreateEnvironmentEC2
forall x. CreateEnvironmentEC2 -> Rep CreateEnvironmentEC2 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEnvironmentEC2 x -> CreateEnvironmentEC2
$cfrom :: forall x. CreateEnvironmentEC2 -> Rep CreateEnvironmentEC2 x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironmentEC2' 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:
--
-- 'automaticStopTimeMinutes', 'createEnvironmentEC2_automaticStopTimeMinutes' - The number of minutes until the running instance is shut down after the
-- environment has last been used.
--
-- 'subnetId', 'createEnvironmentEC2_subnetId' - The ID of the subnet in Amazon VPC that Cloud9 will use to communicate
-- with the Amazon EC2 instance.
--
-- 'ownerArn', 'createEnvironmentEC2_ownerArn' - The Amazon Resource Name (ARN) of the environment owner. This ARN can be
-- the ARN of any IAM principal. If this value is not specified, the ARN
-- defaults to this environment\'s creator.
--
-- 'imageId', 'createEnvironmentEC2_imageId' - The identifier for the Amazon Machine Image (AMI) that\'s used to create
-- the EC2 instance. To choose an AMI for the instance, you must specify a
-- valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.
--
-- The default AMI is used if the parameter isn\'t explicitly assigned a
-- value in the request. Because Amazon Linux AMI has ended standard
-- support as of December 31, 2020, we recommend you choose Amazon Linux 2,
-- which includes long term support through 2023.
--
-- __AMI aliases__
--
-- -   __Amazon Linux (default): @amazonlinux-1-x86_64@__
--
-- -   Amazon Linux 2: @amazonlinux-2-x86_64@
--
-- -   Ubuntu 18.04: @ubuntu-18.04-x86_64@
--
-- __SSM paths__
--
-- -   __Amazon Linux (default):
--     @resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-1-x86_64@__
--
-- -   Amazon Linux 2:
--     @resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-2-x86_64@
--
-- -   Ubuntu 18.04:
--     @resolve:ssm:\/aws\/service\/cloud9\/amis\/ubuntu-18.04-x86_64@
--
-- 'clientRequestToken', 'createEnvironmentEC2_clientRequestToken' - A unique, case-sensitive string that helps Cloud9 to ensure this
-- operation completes no more than one time.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Client Tokens>
-- in the /Amazon EC2 API Reference/.
--
-- 'connectionType', 'createEnvironmentEC2_connectionType' - The connection type used for connecting to an Amazon EC2 environment.
-- Valid values are @CONNECT_SSH@ (default) and @CONNECT_SSM@ (connected
-- through Amazon EC2 Systems Manager).
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager>
-- in the /Cloud9 User Guide/.
--
-- 'description', 'createEnvironmentEC2_description' - The description of the environment to create.
--
-- 'dryRun', 'createEnvironmentEC2_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'tags', 'createEnvironmentEC2_tags' - An array of key-value pairs that will be associated with the new Cloud9
-- development environment.
--
-- 'name', 'createEnvironmentEC2_name' - The name of the environment to create.
--
-- This name is visible to other IAM users in the same Amazon Web Services
-- account.
--
-- 'instanceType', 'createEnvironmentEC2_instanceType' - The type of instance to connect to the environment (for example,
-- @t2.micro@).
newCreateEnvironmentEC2 ::
  -- | 'name'
  Prelude.Text ->
  -- | 'instanceType'
  Prelude.Text ->
  CreateEnvironmentEC2
newCreateEnvironmentEC2 :: Text -> Text -> CreateEnvironmentEC2
newCreateEnvironmentEC2 Text
pName_ Text
pInstanceType_ =
  CreateEnvironmentEC2' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe Bool
-> Maybe (Sensitive [Sensitive Tag])
-> Text
-> Text
-> CreateEnvironmentEC2
CreateEnvironmentEC2'
    { $sel:automaticStopTimeMinutes:CreateEnvironmentEC2' :: Maybe Int
automaticStopTimeMinutes =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:CreateEnvironmentEC2' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerArn:CreateEnvironmentEC2' :: Maybe Text
ownerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageId:CreateEnvironmentEC2' :: Maybe Text
imageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateEnvironmentEC2' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionType:CreateEnvironmentEC2' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateEnvironmentEC2' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:CreateEnvironmentEC2' :: Maybe Bool
dryRun = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateEnvironmentEC2' :: Maybe (Sensitive [Sensitive Tag])
tags = Maybe (Sensitive [Sensitive Tag])
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateEnvironmentEC2' :: Text
name = Text
pName_,
      $sel:instanceType:CreateEnvironmentEC2' :: Text
instanceType = Text
pInstanceType_
    }

-- | The number of minutes until the running instance is shut down after the
-- environment has last been used.
createEnvironmentEC2_automaticStopTimeMinutes :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Int)
createEnvironmentEC2_automaticStopTimeMinutes :: (Maybe Int -> f (Maybe Int))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_automaticStopTimeMinutes = (CreateEnvironmentEC2 -> Maybe Int)
-> (CreateEnvironmentEC2 -> Maybe Int -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2 CreateEnvironmentEC2 (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe Int
automaticStopTimeMinutes :: Maybe Int
$sel:automaticStopTimeMinutes:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Int
automaticStopTimeMinutes} -> Maybe Int
automaticStopTimeMinutes) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe Int
a -> CreateEnvironmentEC2
s {$sel:automaticStopTimeMinutes:CreateEnvironmentEC2' :: Maybe Int
automaticStopTimeMinutes = Maybe Int
a} :: CreateEnvironmentEC2)

-- | The ID of the subnet in Amazon VPC that Cloud9 will use to communicate
-- with the Amazon EC2 instance.
createEnvironmentEC2_subnetId :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Text)
createEnvironmentEC2_subnetId :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_subnetId = (CreateEnvironmentEC2 -> Maybe Text)
-> (CreateEnvironmentEC2 -> Maybe Text -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2 CreateEnvironmentEC2 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe Text
a -> CreateEnvironmentEC2
s {$sel:subnetId:CreateEnvironmentEC2' :: Maybe Text
subnetId = Maybe Text
a} :: CreateEnvironmentEC2)

-- | The Amazon Resource Name (ARN) of the environment owner. This ARN can be
-- the ARN of any IAM principal. If this value is not specified, the ARN
-- defaults to this environment\'s creator.
createEnvironmentEC2_ownerArn :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Text)
createEnvironmentEC2_ownerArn :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_ownerArn = (CreateEnvironmentEC2 -> Maybe Text)
-> (CreateEnvironmentEC2 -> Maybe Text -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2 CreateEnvironmentEC2 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe Text
ownerArn :: Maybe Text
$sel:ownerArn:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
ownerArn} -> Maybe Text
ownerArn) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe Text
a -> CreateEnvironmentEC2
s {$sel:ownerArn:CreateEnvironmentEC2' :: Maybe Text
ownerArn = Maybe Text
a} :: CreateEnvironmentEC2)

-- | The identifier for the Amazon Machine Image (AMI) that\'s used to create
-- the EC2 instance. To choose an AMI for the instance, you must specify a
-- valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.
--
-- The default AMI is used if the parameter isn\'t explicitly assigned a
-- value in the request. Because Amazon Linux AMI has ended standard
-- support as of December 31, 2020, we recommend you choose Amazon Linux 2,
-- which includes long term support through 2023.
--
-- __AMI aliases__
--
-- -   __Amazon Linux (default): @amazonlinux-1-x86_64@__
--
-- -   Amazon Linux 2: @amazonlinux-2-x86_64@
--
-- -   Ubuntu 18.04: @ubuntu-18.04-x86_64@
--
-- __SSM paths__
--
-- -   __Amazon Linux (default):
--     @resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-1-x86_64@__
--
-- -   Amazon Linux 2:
--     @resolve:ssm:\/aws\/service\/cloud9\/amis\/amazonlinux-2-x86_64@
--
-- -   Ubuntu 18.04:
--     @resolve:ssm:\/aws\/service\/cloud9\/amis\/ubuntu-18.04-x86_64@
createEnvironmentEC2_imageId :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Text)
createEnvironmentEC2_imageId :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_imageId = (CreateEnvironmentEC2 -> Maybe Text)
-> (CreateEnvironmentEC2 -> Maybe Text -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2 CreateEnvironmentEC2 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe Text
imageId :: Maybe Text
$sel:imageId:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe Text
a -> CreateEnvironmentEC2
s {$sel:imageId:CreateEnvironmentEC2' :: Maybe Text
imageId = Maybe Text
a} :: CreateEnvironmentEC2)

-- | A unique, case-sensitive string that helps Cloud9 to ensure this
-- operation completes no more than one time.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html Client Tokens>
-- in the /Amazon EC2 API Reference/.
createEnvironmentEC2_clientRequestToken :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Text)
createEnvironmentEC2_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_clientRequestToken = (CreateEnvironmentEC2 -> Maybe Text)
-> (CreateEnvironmentEC2 -> Maybe Text -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2 CreateEnvironmentEC2 (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe Text
a -> CreateEnvironmentEC2
s {$sel:clientRequestToken:CreateEnvironmentEC2' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateEnvironmentEC2)

-- | The connection type used for connecting to an Amazon EC2 environment.
-- Valid values are @CONNECT_SSH@ (default) and @CONNECT_SSM@ (connected
-- through Amazon EC2 Systems Manager).
--
-- For more information, see
-- <https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager>
-- in the /Cloud9 User Guide/.
createEnvironmentEC2_connectionType :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe ConnectionType)
createEnvironmentEC2_connectionType :: (Maybe ConnectionType -> f (Maybe ConnectionType))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_connectionType = (CreateEnvironmentEC2 -> Maybe ConnectionType)
-> (CreateEnvironmentEC2
    -> Maybe ConnectionType -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2
     CreateEnvironmentEC2
     (Maybe ConnectionType)
     (Maybe ConnectionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe ConnectionType
connectionType :: Maybe ConnectionType
$sel:connectionType:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe ConnectionType
connectionType} -> Maybe ConnectionType
connectionType) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe ConnectionType
a -> CreateEnvironmentEC2
s {$sel:connectionType:CreateEnvironmentEC2' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
a} :: CreateEnvironmentEC2)

-- | The description of the environment to create.
createEnvironmentEC2_description :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Text)
createEnvironmentEC2_description :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_description = (CreateEnvironmentEC2 -> Maybe (Sensitive Text))
-> (CreateEnvironmentEC2
    -> Maybe (Sensitive Text) -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2
     CreateEnvironmentEC2
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe (Sensitive Text)
a -> CreateEnvironmentEC2
s {$sel:description:CreateEnvironmentEC2' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: CreateEnvironmentEC2) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> CreateEnvironmentEC2 -> f CreateEnvironmentEC2)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2
-> f CreateEnvironmentEC2
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

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
createEnvironmentEC2_dryRun :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe Prelude.Bool)
createEnvironmentEC2_dryRun :: (Maybe Bool -> f (Maybe Bool))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_dryRun = (CreateEnvironmentEC2 -> Maybe Bool)
-> (CreateEnvironmentEC2 -> Maybe Bool -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2 CreateEnvironmentEC2 (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe Bool
a -> CreateEnvironmentEC2
s {$sel:dryRun:CreateEnvironmentEC2' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateEnvironmentEC2)

-- | An array of key-value pairs that will be associated with the new Cloud9
-- development environment.
createEnvironmentEC2_tags :: Lens.Lens' CreateEnvironmentEC2 (Prelude.Maybe [Tag])
createEnvironmentEC2_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_tags = (CreateEnvironmentEC2 -> Maybe (Sensitive [Sensitive Tag]))
-> (CreateEnvironmentEC2
    -> Maybe (Sensitive [Sensitive Tag]) -> CreateEnvironmentEC2)
-> Lens
     CreateEnvironmentEC2
     CreateEnvironmentEC2
     (Maybe (Sensitive [Sensitive Tag]))
     (Maybe (Sensitive [Sensitive Tag]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Maybe (Sensitive [Sensitive Tag])
tags :: Maybe (Sensitive [Sensitive Tag])
$sel:tags:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe (Sensitive [Sensitive Tag])
tags} -> Maybe (Sensitive [Sensitive Tag])
tags) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Maybe (Sensitive [Sensitive Tag])
a -> CreateEnvironmentEC2
s {$sel:tags:CreateEnvironmentEC2' :: Maybe (Sensitive [Sensitive Tag])
tags = Maybe (Sensitive [Sensitive Tag])
a} :: CreateEnvironmentEC2) ((Maybe (Sensitive [Sensitive Tag])
  -> f (Maybe (Sensitive [Sensitive Tag])))
 -> CreateEnvironmentEC2 -> f CreateEnvironmentEC2)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe (Sensitive [Sensitive Tag])
    -> f (Maybe (Sensitive [Sensitive Tag])))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEnvironmentEC2
-> f CreateEnvironmentEC2
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive [Sensitive Tag]) (Sensitive [Sensitive Tag]) [Tag] [Tag]
-> Iso
     (Maybe (Sensitive [Sensitive Tag]))
     (Maybe (Sensitive [Sensitive 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 (Exchange [Tag] [Tag] [Sensitive Tag] (Identity [Sensitive Tag])
-> Exchange
     [Tag]
     [Tag]
     (Sensitive [Sensitive Tag])
     (Identity (Sensitive [Sensitive Tag]))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Exchange [Tag] [Tag] [Sensitive Tag] (Identity [Sensitive Tag])
 -> Exchange
      [Tag]
      [Tag]
      (Sensitive [Sensitive Tag])
      (Identity (Sensitive [Sensitive Tag])))
-> (Exchange [Tag] [Tag] [Tag] (Identity [Tag])
    -> Exchange [Tag] [Tag] [Sensitive Tag] (Identity [Sensitive Tag]))
-> AnIso
     (Sensitive [Sensitive Tag]) (Sensitive [Sensitive Tag]) [Tag] [Tag]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange [Tag] [Tag] [Tag] (Identity [Tag])
-> Exchange [Tag] [Tag] [Sensitive Tag] (Identity [Sensitive Tag])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The name of the environment to create.
--
-- This name is visible to other IAM users in the same Amazon Web Services
-- account.
createEnvironmentEC2_name :: Lens.Lens' CreateEnvironmentEC2 Prelude.Text
createEnvironmentEC2_name :: (Text -> f Text) -> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_name = (CreateEnvironmentEC2 -> Text)
-> (CreateEnvironmentEC2 -> Text -> CreateEnvironmentEC2)
-> Lens CreateEnvironmentEC2 CreateEnvironmentEC2 Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Text
name :: Text
$sel:name:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Text
name} -> Text
name) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Text
a -> CreateEnvironmentEC2
s {$sel:name:CreateEnvironmentEC2' :: Text
name = Text
a} :: CreateEnvironmentEC2)

-- | The type of instance to connect to the environment (for example,
-- @t2.micro@).
createEnvironmentEC2_instanceType :: Lens.Lens' CreateEnvironmentEC2 Prelude.Text
createEnvironmentEC2_instanceType :: (Text -> f Text) -> CreateEnvironmentEC2 -> f CreateEnvironmentEC2
createEnvironmentEC2_instanceType = (CreateEnvironmentEC2 -> Text)
-> (CreateEnvironmentEC2 -> Text -> CreateEnvironmentEC2)
-> Lens CreateEnvironmentEC2 CreateEnvironmentEC2 Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2' {Text
instanceType :: Text
$sel:instanceType:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Text
instanceType} -> Text
instanceType) (\s :: CreateEnvironmentEC2
s@CreateEnvironmentEC2' {} Text
a -> CreateEnvironmentEC2
s {$sel:instanceType:CreateEnvironmentEC2' :: Text
instanceType = Text
a} :: CreateEnvironmentEC2)

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

instance Prelude.NFData CreateEnvironmentEC2

instance Core.ToHeaders CreateEnvironmentEC2 where
  toHeaders :: CreateEnvironmentEC2 -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateEnvironmentEC2 -> 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
"AWSCloud9WorkspaceManagementService.CreateEnvironmentEC2" ::
                          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 CreateEnvironmentEC2 where
  toJSON :: CreateEnvironmentEC2 -> Value
toJSON CreateEnvironmentEC2' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive [Sensitive Tag])
Maybe (Sensitive Text)
Maybe ConnectionType
Text
instanceType :: Text
name :: Text
tags :: Maybe (Sensitive [Sensitive Tag])
dryRun :: Maybe Bool
description :: Maybe (Sensitive Text)
connectionType :: Maybe ConnectionType
clientRequestToken :: Maybe Text
imageId :: Maybe Text
ownerArn :: Maybe Text
subnetId :: Maybe Text
automaticStopTimeMinutes :: Maybe Int
$sel:instanceType:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Text
$sel:name:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Text
$sel:tags:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe (Sensitive [Sensitive Tag])
$sel:dryRun:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Bool
$sel:description:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe (Sensitive Text)
$sel:connectionType:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe ConnectionType
$sel:clientRequestToken:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
$sel:imageId:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
$sel:ownerArn:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
$sel:subnetId:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Text
$sel:automaticStopTimeMinutes:CreateEnvironmentEC2' :: CreateEnvironmentEC2 -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"automaticStopTimeMinutes" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
automaticStopTimeMinutes,
            (Text
"subnetId" 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
subnetId,
            (Text
"ownerArn" 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
ownerArn,
            (Text
"imageId" 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
imageId,
            (Text
"clientRequestToken" 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
clientRequestToken,
            (Text
"connectionType" Text -> ConnectionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ConnectionType -> Pair) -> Maybe ConnectionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectionType
connectionType,
            (Text
"description" 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)
description,
            (Text
"dryRun" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
dryRun,
            (Text
"tags" Text -> Sensitive [Sensitive Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive [Sensitive Tag] -> Pair)
-> Maybe (Sensitive [Sensitive Tag]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive [Sensitive 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
"instanceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceType)
          ]
      )

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

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

-- | /See:/ 'newCreateEnvironmentEC2Response' smart constructor.
data CreateEnvironmentEC2Response = CreateEnvironmentEC2Response'
  { -- | The ID of the environment that was created.
    CreateEnvironmentEC2Response -> Maybe Text
environmentId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateEnvironmentEC2Response -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateEnvironmentEC2Response
-> CreateEnvironmentEC2Response -> Bool
(CreateEnvironmentEC2Response
 -> CreateEnvironmentEC2Response -> Bool)
-> (CreateEnvironmentEC2Response
    -> CreateEnvironmentEC2Response -> Bool)
-> Eq CreateEnvironmentEC2Response
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEnvironmentEC2Response
-> CreateEnvironmentEC2Response -> Bool
$c/= :: CreateEnvironmentEC2Response
-> CreateEnvironmentEC2Response -> Bool
== :: CreateEnvironmentEC2Response
-> CreateEnvironmentEC2Response -> Bool
$c== :: CreateEnvironmentEC2Response
-> CreateEnvironmentEC2Response -> Bool
Prelude.Eq, ReadPrec [CreateEnvironmentEC2Response]
ReadPrec CreateEnvironmentEC2Response
Int -> ReadS CreateEnvironmentEC2Response
ReadS [CreateEnvironmentEC2Response]
(Int -> ReadS CreateEnvironmentEC2Response)
-> ReadS [CreateEnvironmentEC2Response]
-> ReadPrec CreateEnvironmentEC2Response
-> ReadPrec [CreateEnvironmentEC2Response]
-> Read CreateEnvironmentEC2Response
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEnvironmentEC2Response]
$creadListPrec :: ReadPrec [CreateEnvironmentEC2Response]
readPrec :: ReadPrec CreateEnvironmentEC2Response
$creadPrec :: ReadPrec CreateEnvironmentEC2Response
readList :: ReadS [CreateEnvironmentEC2Response]
$creadList :: ReadS [CreateEnvironmentEC2Response]
readsPrec :: Int -> ReadS CreateEnvironmentEC2Response
$creadsPrec :: Int -> ReadS CreateEnvironmentEC2Response
Prelude.Read, Int -> CreateEnvironmentEC2Response -> ShowS
[CreateEnvironmentEC2Response] -> ShowS
CreateEnvironmentEC2Response -> String
(Int -> CreateEnvironmentEC2Response -> ShowS)
-> (CreateEnvironmentEC2Response -> String)
-> ([CreateEnvironmentEC2Response] -> ShowS)
-> Show CreateEnvironmentEC2Response
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEnvironmentEC2Response] -> ShowS
$cshowList :: [CreateEnvironmentEC2Response] -> ShowS
show :: CreateEnvironmentEC2Response -> String
$cshow :: CreateEnvironmentEC2Response -> String
showsPrec :: Int -> CreateEnvironmentEC2Response -> ShowS
$cshowsPrec :: Int -> CreateEnvironmentEC2Response -> ShowS
Prelude.Show, (forall x.
 CreateEnvironmentEC2Response -> Rep CreateEnvironmentEC2Response x)
-> (forall x.
    Rep CreateEnvironmentEC2Response x -> CreateEnvironmentEC2Response)
-> Generic CreateEnvironmentEC2Response
forall x.
Rep CreateEnvironmentEC2Response x -> CreateEnvironmentEC2Response
forall x.
CreateEnvironmentEC2Response -> Rep CreateEnvironmentEC2Response x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEnvironmentEC2Response x -> CreateEnvironmentEC2Response
$cfrom :: forall x.
CreateEnvironmentEC2Response -> Rep CreateEnvironmentEC2Response x
Prelude.Generic)

-- |
-- Create a value of 'CreateEnvironmentEC2Response' 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:
--
-- 'environmentId', 'createEnvironmentEC2Response_environmentId' - The ID of the environment that was created.
--
-- 'httpStatus', 'createEnvironmentEC2Response_httpStatus' - The response's http status code.
newCreateEnvironmentEC2Response ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateEnvironmentEC2Response
newCreateEnvironmentEC2Response :: Int -> CreateEnvironmentEC2Response
newCreateEnvironmentEC2Response Int
pHttpStatus_ =
  CreateEnvironmentEC2Response' :: Maybe Text -> Int -> CreateEnvironmentEC2Response
CreateEnvironmentEC2Response'
    { $sel:environmentId:CreateEnvironmentEC2Response' :: Maybe Text
environmentId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateEnvironmentEC2Response' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the environment that was created.
createEnvironmentEC2Response_environmentId :: Lens.Lens' CreateEnvironmentEC2Response (Prelude.Maybe Prelude.Text)
createEnvironmentEC2Response_environmentId :: (Maybe Text -> f (Maybe Text))
-> CreateEnvironmentEC2Response -> f CreateEnvironmentEC2Response
createEnvironmentEC2Response_environmentId = (CreateEnvironmentEC2Response -> Maybe Text)
-> (CreateEnvironmentEC2Response
    -> Maybe Text -> CreateEnvironmentEC2Response)
-> Lens
     CreateEnvironmentEC2Response
     CreateEnvironmentEC2Response
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEnvironmentEC2Response' {Maybe Text
environmentId :: Maybe Text
$sel:environmentId:CreateEnvironmentEC2Response' :: CreateEnvironmentEC2Response -> Maybe Text
environmentId} -> Maybe Text
environmentId) (\s :: CreateEnvironmentEC2Response
s@CreateEnvironmentEC2Response' {} Maybe Text
a -> CreateEnvironmentEC2Response
s {$sel:environmentId:CreateEnvironmentEC2Response' :: Maybe Text
environmentId = Maybe Text
a} :: CreateEnvironmentEC2Response)

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

instance Prelude.NFData CreateEnvironmentEC2Response