{-# 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.CreateFleet
-- 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 a fleet. A fleet consists of streaming instances that run a
-- specified image.
module Amazonka.AppStream.CreateFleet
  ( -- * Creating a Request
    CreateFleet (..),
    newCreateFleet,

    -- * Request Lenses
    createFleet_domainJoinInfo,
    createFleet_iamRoleArn,
    createFleet_disconnectTimeoutInSeconds,
    createFleet_maxUserDurationInSeconds,
    createFleet_idleDisconnectTimeoutInSeconds,
    createFleet_fleetType,
    createFleet_vpcConfig,
    createFleet_imageArn,
    createFleet_displayName,
    createFleet_enableDefaultInternetAccess,
    createFleet_imageName,
    createFleet_description,
    createFleet_streamView,
    createFleet_tags,
    createFleet_name,
    createFleet_instanceType,
    createFleet_computeCapacity,

    -- * Destructuring the Response
    CreateFleetResponse (..),
    newCreateFleetResponse,

    -- * Response Lenses
    createFleetResponse_fleet,
    createFleetResponse_httpStatus,
  )
where

import Amazonka.AppStream.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:/ 'newCreateFleet' smart constructor.
data CreateFleet = CreateFleet'
  { -- | The name of the directory and organizational unit (OU) to use to join
    -- the fleet to a Microsoft Active Directory domain.
    CreateFleet -> Maybe DomainJoinInfo
domainJoinInfo :: Prelude.Maybe DomainJoinInfo,
    -- | The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To
    -- assume a role, a fleet instance calls the AWS Security Token Service
    -- (STS) @AssumeRole@ API operation and passes the ARN of the role to use.
    -- The operation creates a new session with temporary credentials.
    -- AppStream 2.0 retrieves the temporary credentials and creates the
    -- __appstream_machine_role__ credential profile on the instance.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances>
    -- in the /Amazon AppStream 2.0 Administration Guide/.
    CreateFleet -> Maybe Text
iamRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The amount of time that a streaming session remains active after users
    -- disconnect. If users try to reconnect to the streaming session after a
    -- disconnection or network interruption within this time interval, they
    -- are connected to their previous session. Otherwise, they are connected
    -- to a new session with a new streaming instance.
    --
    -- Specify a value between 60 and 360000.
    CreateFleet -> Maybe Int
disconnectTimeoutInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The maximum amount of time that a streaming session can remain active,
    -- in seconds. If users are still connected to a streaming instance five
    -- minutes before this limit is reached, they are prompted to save any open
    -- documents before being disconnected. After this time elapses, the
    -- instance is terminated and replaced by a new instance.
    --
    -- Specify a value between 600 and 360000.
    CreateFleet -> Maybe Int
maxUserDurationInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The amount of time that users can be idle (inactive) before they are
    -- disconnected from their streaming session and the
    -- @DisconnectTimeoutInSeconds@ time interval begins. Users are notified
    -- before they are disconnected due to inactivity. If they try to reconnect
    -- to the streaming session before the time interval specified in
    -- @DisconnectTimeoutInSeconds@ elapses, they are connected to their
    -- previous session. Users are considered idle when they stop providing
    -- keyboard or mouse input during their streaming session. File uploads and
    -- downloads, audio in, audio out, and pixels changing do not qualify as
    -- user activity. If users continue to be idle after the time interval in
    -- @IdleDisconnectTimeoutInSeconds@ elapses, they are disconnected.
    --
    -- To prevent users from being disconnected due to inactivity, specify a
    -- value of 0. Otherwise, specify a value between 60 and 3600. The default
    -- value is 0.
    --
    -- If you enable this feature, we recommend that you specify a value that
    -- corresponds exactly to a whole number of minutes (for example, 60, 120,
    -- and 180). If you don\'t do this, the value is rounded to the nearest
    -- minute. For example, if you specify a value of 70, users are
    -- disconnected after 1 minute of inactivity. If you specify a value that
    -- is at the midpoint between two different minutes, the value is rounded
    -- up. For example, if you specify a value of 90, users are disconnected
    -- after 2 minutes of inactivity.
    CreateFleet -> Maybe Int
idleDisconnectTimeoutInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The fleet type.
    --
    -- [ALWAYS_ON]
    --     Provides users with instant-on access to their apps. You are charged
    --     for all running instances in your fleet, even if no users are
    --     streaming apps.
    --
    -- [ON_DEMAND]
    --     Provide users with access to applications after they connect, which
    --     takes one to two minutes. You are charged for instance streaming
    --     when users are connected and a small hourly fee for instances that
    --     are not streaming apps.
    CreateFleet -> Maybe FleetType
fleetType :: Prelude.Maybe FleetType,
    -- | The VPC configuration for the fleet.
    CreateFleet -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
    -- | The ARN of the public, private, or shared image to use.
    CreateFleet -> Maybe Text
imageArn :: Prelude.Maybe Prelude.Text,
    -- | The fleet name to display.
    CreateFleet -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | Enables or disables default internet access for the fleet.
    CreateFleet -> Maybe Bool
enableDefaultInternetAccess :: Prelude.Maybe Prelude.Bool,
    -- | The name of the image used to create the fleet.
    CreateFleet -> Maybe Text
imageName :: Prelude.Maybe Prelude.Text,
    -- | The description to display.
    CreateFleet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The AppStream 2.0 view that is displayed to your users when they stream
    -- from the fleet. When @APP@ is specified, only the windows of
    -- applications opened by users display. When @DESKTOP@ is specified, the
    -- standard desktop that is provided by the operating system displays.
    --
    -- The default value is @APP@.
    CreateFleet -> Maybe StreamView
streamView :: Prelude.Maybe StreamView,
    -- | The tags to associate with the fleet. A tag is a key-value pair, and the
    -- value is optional. For example, Environment=Test. If you do not specify
    -- a value, Environment=.
    --
    -- If you do not specify a value, the value is set to an empty string.
    --
    -- Generally allowed characters are: letters, numbers, and spaces
    -- representable in UTF-8, and the following special characters:
    --
    -- _ . : \/ = + \\ - \@
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html Tagging Your Resources>
    -- in the /Amazon AppStream 2.0 Administration Guide/.
    CreateFleet -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A unique name for the fleet.
    CreateFleet -> Text
name :: Prelude.Text,
    -- | The instance type to use when launching fleet instances. The following
    -- instance types are available:
    --
    -- -   stream.standard.small
    --
    -- -   stream.standard.medium
    --
    -- -   stream.standard.large
    --
    -- -   stream.compute.large
    --
    -- -   stream.compute.xlarge
    --
    -- -   stream.compute.2xlarge
    --
    -- -   stream.compute.4xlarge
    --
    -- -   stream.compute.8xlarge
    --
    -- -   stream.memory.large
    --
    -- -   stream.memory.xlarge
    --
    -- -   stream.memory.2xlarge
    --
    -- -   stream.memory.4xlarge
    --
    -- -   stream.memory.8xlarge
    --
    -- -   stream.memory.z1d.large
    --
    -- -   stream.memory.z1d.xlarge
    --
    -- -   stream.memory.z1d.2xlarge
    --
    -- -   stream.memory.z1d.3xlarge
    --
    -- -   stream.memory.z1d.6xlarge
    --
    -- -   stream.memory.z1d.12xlarge
    --
    -- -   stream.graphics-design.large
    --
    -- -   stream.graphics-design.xlarge
    --
    -- -   stream.graphics-design.2xlarge
    --
    -- -   stream.graphics-design.4xlarge
    --
    -- -   stream.graphics-desktop.2xlarge
    --
    -- -   stream.graphics.g4dn.xlarge
    --
    -- -   stream.graphics.g4dn.2xlarge
    --
    -- -   stream.graphics.g4dn.4xlarge
    --
    -- -   stream.graphics.g4dn.8xlarge
    --
    -- -   stream.graphics.g4dn.12xlarge
    --
    -- -   stream.graphics.g4dn.16xlarge
    --
    -- -   stream.graphics-pro.4xlarge
    --
    -- -   stream.graphics-pro.8xlarge
    --
    -- -   stream.graphics-pro.16xlarge
    CreateFleet -> Text
instanceType :: Prelude.Text,
    -- | The desired capacity for the fleet.
    CreateFleet -> ComputeCapacity
computeCapacity :: ComputeCapacity
  }
  deriving (CreateFleet -> CreateFleet -> Bool
(CreateFleet -> CreateFleet -> Bool)
-> (CreateFleet -> CreateFleet -> Bool) -> Eq CreateFleet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFleet -> CreateFleet -> Bool
$c/= :: CreateFleet -> CreateFleet -> Bool
== :: CreateFleet -> CreateFleet -> Bool
$c== :: CreateFleet -> CreateFleet -> Bool
Prelude.Eq, ReadPrec [CreateFleet]
ReadPrec CreateFleet
Int -> ReadS CreateFleet
ReadS [CreateFleet]
(Int -> ReadS CreateFleet)
-> ReadS [CreateFleet]
-> ReadPrec CreateFleet
-> ReadPrec [CreateFleet]
-> Read CreateFleet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFleet]
$creadListPrec :: ReadPrec [CreateFleet]
readPrec :: ReadPrec CreateFleet
$creadPrec :: ReadPrec CreateFleet
readList :: ReadS [CreateFleet]
$creadList :: ReadS [CreateFleet]
readsPrec :: Int -> ReadS CreateFleet
$creadsPrec :: Int -> ReadS CreateFleet
Prelude.Read, Int -> CreateFleet -> ShowS
[CreateFleet] -> ShowS
CreateFleet -> String
(Int -> CreateFleet -> ShowS)
-> (CreateFleet -> String)
-> ([CreateFleet] -> ShowS)
-> Show CreateFleet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFleet] -> ShowS
$cshowList :: [CreateFleet] -> ShowS
show :: CreateFleet -> String
$cshow :: CreateFleet -> String
showsPrec :: Int -> CreateFleet -> ShowS
$cshowsPrec :: Int -> CreateFleet -> ShowS
Prelude.Show, (forall x. CreateFleet -> Rep CreateFleet x)
-> (forall x. Rep CreateFleet x -> CreateFleet)
-> Generic CreateFleet
forall x. Rep CreateFleet x -> CreateFleet
forall x. CreateFleet -> Rep CreateFleet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFleet x -> CreateFleet
$cfrom :: forall x. CreateFleet -> Rep CreateFleet x
Prelude.Generic)

-- |
-- Create a value of 'CreateFleet' 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:
--
-- 'domainJoinInfo', 'createFleet_domainJoinInfo' - The name of the directory and organizational unit (OU) to use to join
-- the fleet to a Microsoft Active Directory domain.
--
-- 'iamRoleArn', 'createFleet_iamRoleArn' - The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To
-- assume a role, a fleet instance calls the AWS Security Token Service
-- (STS) @AssumeRole@ API operation and passes the ARN of the role to use.
-- The operation creates a new session with temporary credentials.
-- AppStream 2.0 retrieves the temporary credentials and creates the
-- __appstream_machine_role__ credential profile on the instance.
--
-- For more information, see
-- <https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances>
-- in the /Amazon AppStream 2.0 Administration Guide/.
--
-- 'disconnectTimeoutInSeconds', 'createFleet_disconnectTimeoutInSeconds' - The amount of time that a streaming session remains active after users
-- disconnect. If users try to reconnect to the streaming session after a
-- disconnection or network interruption within this time interval, they
-- are connected to their previous session. Otherwise, they are connected
-- to a new session with a new streaming instance.
--
-- Specify a value between 60 and 360000.
--
-- 'maxUserDurationInSeconds', 'createFleet_maxUserDurationInSeconds' - The maximum amount of time that a streaming session can remain active,
-- in seconds. If users are still connected to a streaming instance five
-- minutes before this limit is reached, they are prompted to save any open
-- documents before being disconnected. After this time elapses, the
-- instance is terminated and replaced by a new instance.
--
-- Specify a value between 600 and 360000.
--
-- 'idleDisconnectTimeoutInSeconds', 'createFleet_idleDisconnectTimeoutInSeconds' - The amount of time that users can be idle (inactive) before they are
-- disconnected from their streaming session and the
-- @DisconnectTimeoutInSeconds@ time interval begins. Users are notified
-- before they are disconnected due to inactivity. If they try to reconnect
-- to the streaming session before the time interval specified in
-- @DisconnectTimeoutInSeconds@ elapses, they are connected to their
-- previous session. Users are considered idle when they stop providing
-- keyboard or mouse input during their streaming session. File uploads and
-- downloads, audio in, audio out, and pixels changing do not qualify as
-- user activity. If users continue to be idle after the time interval in
-- @IdleDisconnectTimeoutInSeconds@ elapses, they are disconnected.
--
-- To prevent users from being disconnected due to inactivity, specify a
-- value of 0. Otherwise, specify a value between 60 and 3600. The default
-- value is 0.
--
-- If you enable this feature, we recommend that you specify a value that
-- corresponds exactly to a whole number of minutes (for example, 60, 120,
-- and 180). If you don\'t do this, the value is rounded to the nearest
-- minute. For example, if you specify a value of 70, users are
-- disconnected after 1 minute of inactivity. If you specify a value that
-- is at the midpoint between two different minutes, the value is rounded
-- up. For example, if you specify a value of 90, users are disconnected
-- after 2 minutes of inactivity.
--
-- 'fleetType', 'createFleet_fleetType' - The fleet type.
--
-- [ALWAYS_ON]
--     Provides users with instant-on access to their apps. You are charged
--     for all running instances in your fleet, even if no users are
--     streaming apps.
--
-- [ON_DEMAND]
--     Provide users with access to applications after they connect, which
--     takes one to two minutes. You are charged for instance streaming
--     when users are connected and a small hourly fee for instances that
--     are not streaming apps.
--
-- 'vpcConfig', 'createFleet_vpcConfig' - The VPC configuration for the fleet.
--
-- 'imageArn', 'createFleet_imageArn' - The ARN of the public, private, or shared image to use.
--
-- 'displayName', 'createFleet_displayName' - The fleet name to display.
--
-- 'enableDefaultInternetAccess', 'createFleet_enableDefaultInternetAccess' - Enables or disables default internet access for the fleet.
--
-- 'imageName', 'createFleet_imageName' - The name of the image used to create the fleet.
--
-- 'description', 'createFleet_description' - The description to display.
--
-- 'streamView', 'createFleet_streamView' - The AppStream 2.0 view that is displayed to your users when they stream
-- from the fleet. When @APP@ is specified, only the windows of
-- applications opened by users display. When @DESKTOP@ is specified, the
-- standard desktop that is provided by the operating system displays.
--
-- The default value is @APP@.
--
-- 'tags', 'createFleet_tags' - The tags to associate with the fleet. A tag is a key-value pair, and the
-- value is optional. For example, Environment=Test. If you do not specify
-- a value, Environment=.
--
-- If you do not specify a value, the value is set to an empty string.
--
-- Generally allowed characters are: letters, numbers, and spaces
-- representable in UTF-8, and the following special characters:
--
-- _ . : \/ = + \\ - \@
--
-- For more information, see
-- <https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html Tagging Your Resources>
-- in the /Amazon AppStream 2.0 Administration Guide/.
--
-- 'name', 'createFleet_name' - A unique name for the fleet.
--
-- 'instanceType', 'createFleet_instanceType' - The instance type to use when launching fleet instances. The following
-- instance types are available:
--
-- -   stream.standard.small
--
-- -   stream.standard.medium
--
-- -   stream.standard.large
--
-- -   stream.compute.large
--
-- -   stream.compute.xlarge
--
-- -   stream.compute.2xlarge
--
-- -   stream.compute.4xlarge
--
-- -   stream.compute.8xlarge
--
-- -   stream.memory.large
--
-- -   stream.memory.xlarge
--
-- -   stream.memory.2xlarge
--
-- -   stream.memory.4xlarge
--
-- -   stream.memory.8xlarge
--
-- -   stream.memory.z1d.large
--
-- -   stream.memory.z1d.xlarge
--
-- -   stream.memory.z1d.2xlarge
--
-- -   stream.memory.z1d.3xlarge
--
-- -   stream.memory.z1d.6xlarge
--
-- -   stream.memory.z1d.12xlarge
--
-- -   stream.graphics-design.large
--
-- -   stream.graphics-design.xlarge
--
-- -   stream.graphics-design.2xlarge
--
-- -   stream.graphics-design.4xlarge
--
-- -   stream.graphics-desktop.2xlarge
--
-- -   stream.graphics.g4dn.xlarge
--
-- -   stream.graphics.g4dn.2xlarge
--
-- -   stream.graphics.g4dn.4xlarge
--
-- -   stream.graphics.g4dn.8xlarge
--
-- -   stream.graphics.g4dn.12xlarge
--
-- -   stream.graphics.g4dn.16xlarge
--
-- -   stream.graphics-pro.4xlarge
--
-- -   stream.graphics-pro.8xlarge
--
-- -   stream.graphics-pro.16xlarge
--
-- 'computeCapacity', 'createFleet_computeCapacity' - The desired capacity for the fleet.
newCreateFleet ::
  -- | 'name'
  Prelude.Text ->
  -- | 'instanceType'
  Prelude.Text ->
  -- | 'computeCapacity'
  ComputeCapacity ->
  CreateFleet
newCreateFleet :: Text -> Text -> ComputeCapacity -> CreateFleet
newCreateFleet
  Text
pName_
  Text
pInstanceType_
  ComputeCapacity
pComputeCapacity_ =
    CreateFleet' :: Maybe DomainJoinInfo
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe FleetType
-> Maybe VpcConfig
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe StreamView
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> ComputeCapacity
-> CreateFleet
CreateFleet'
      { $sel:domainJoinInfo:CreateFleet' :: Maybe DomainJoinInfo
domainJoinInfo = Maybe DomainJoinInfo
forall a. Maybe a
Prelude.Nothing,
        $sel:iamRoleArn:CreateFleet' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:disconnectTimeoutInSeconds:CreateFleet' :: Maybe Int
disconnectTimeoutInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:maxUserDurationInSeconds:CreateFleet' :: Maybe Int
maxUserDurationInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:idleDisconnectTimeoutInSeconds:CreateFleet' :: Maybe Int
idleDisconnectTimeoutInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:fleetType:CreateFleet' :: Maybe FleetType
fleetType = Maybe FleetType
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcConfig:CreateFleet' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:imageArn:CreateFleet' :: Maybe Text
imageArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:displayName:CreateFleet' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:enableDefaultInternetAccess:CreateFleet' :: Maybe Bool
enableDefaultInternetAccess = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:imageName:CreateFleet' :: Maybe Text
imageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateFleet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:streamView:CreateFleet' :: Maybe StreamView
streamView = Maybe StreamView
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateFleet' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateFleet' :: Text
name = Text
pName_,
        $sel:instanceType:CreateFleet' :: Text
instanceType = Text
pInstanceType_,
        $sel:computeCapacity:CreateFleet' :: ComputeCapacity
computeCapacity = ComputeCapacity
pComputeCapacity_
      }

-- | The name of the directory and organizational unit (OU) to use to join
-- the fleet to a Microsoft Active Directory domain.
createFleet_domainJoinInfo :: Lens.Lens' CreateFleet (Prelude.Maybe DomainJoinInfo)
createFleet_domainJoinInfo :: (Maybe DomainJoinInfo -> f (Maybe DomainJoinInfo))
-> CreateFleet -> f CreateFleet
createFleet_domainJoinInfo = (CreateFleet -> Maybe DomainJoinInfo)
-> (CreateFleet -> Maybe DomainJoinInfo -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe DomainJoinInfo)
     (Maybe DomainJoinInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe DomainJoinInfo
domainJoinInfo :: Maybe DomainJoinInfo
$sel:domainJoinInfo:CreateFleet' :: CreateFleet -> Maybe DomainJoinInfo
domainJoinInfo} -> Maybe DomainJoinInfo
domainJoinInfo) (\s :: CreateFleet
s@CreateFleet' {} Maybe DomainJoinInfo
a -> CreateFleet
s {$sel:domainJoinInfo:CreateFleet' :: Maybe DomainJoinInfo
domainJoinInfo = Maybe DomainJoinInfo
a} :: CreateFleet)

-- | The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To
-- assume a role, a fleet instance calls the AWS Security Token Service
-- (STS) @AssumeRole@ API operation and passes the ARN of the role to use.
-- The operation creates a new session with temporary credentials.
-- AppStream 2.0 retrieves the temporary credentials and creates the
-- __appstream_machine_role__ credential profile on the instance.
--
-- For more information, see
-- <https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html Using an IAM Role to Grant Permissions to Applications and Scripts Running on AppStream 2.0 Streaming Instances>
-- in the /Amazon AppStream 2.0 Administration Guide/.
createFleet_iamRoleArn :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_iamRoleArn :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_iamRoleArn = (CreateFleet -> Maybe Text)
-> (CreateFleet -> Maybe Text -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:iamRoleArn:CreateFleet' :: Maybe Text
iamRoleArn = Maybe Text
a} :: CreateFleet)

-- | The amount of time that a streaming session remains active after users
-- disconnect. If users try to reconnect to the streaming session after a
-- disconnection or network interruption within this time interval, they
-- are connected to their previous session. Otherwise, they are connected
-- to a new session with a new streaming instance.
--
-- Specify a value between 60 and 360000.
createFleet_disconnectTimeoutInSeconds :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Int)
createFleet_disconnectTimeoutInSeconds :: (Maybe Int -> f (Maybe Int)) -> CreateFleet -> f CreateFleet
createFleet_disconnectTimeoutInSeconds = (CreateFleet -> Maybe Int)
-> (CreateFleet -> Maybe Int -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Int
disconnectTimeoutInSeconds :: Maybe Int
$sel:disconnectTimeoutInSeconds:CreateFleet' :: CreateFleet -> Maybe Int
disconnectTimeoutInSeconds} -> Maybe Int
disconnectTimeoutInSeconds) (\s :: CreateFleet
s@CreateFleet' {} Maybe Int
a -> CreateFleet
s {$sel:disconnectTimeoutInSeconds:CreateFleet' :: Maybe Int
disconnectTimeoutInSeconds = Maybe Int
a} :: CreateFleet)

-- | The maximum amount of time that a streaming session can remain active,
-- in seconds. If users are still connected to a streaming instance five
-- minutes before this limit is reached, they are prompted to save any open
-- documents before being disconnected. After this time elapses, the
-- instance is terminated and replaced by a new instance.
--
-- Specify a value between 600 and 360000.
createFleet_maxUserDurationInSeconds :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Int)
createFleet_maxUserDurationInSeconds :: (Maybe Int -> f (Maybe Int)) -> CreateFleet -> f CreateFleet
createFleet_maxUserDurationInSeconds = (CreateFleet -> Maybe Int)
-> (CreateFleet -> Maybe Int -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Int
maxUserDurationInSeconds :: Maybe Int
$sel:maxUserDurationInSeconds:CreateFleet' :: CreateFleet -> Maybe Int
maxUserDurationInSeconds} -> Maybe Int
maxUserDurationInSeconds) (\s :: CreateFleet
s@CreateFleet' {} Maybe Int
a -> CreateFleet
s {$sel:maxUserDurationInSeconds:CreateFleet' :: Maybe Int
maxUserDurationInSeconds = Maybe Int
a} :: CreateFleet)

-- | The amount of time that users can be idle (inactive) before they are
-- disconnected from their streaming session and the
-- @DisconnectTimeoutInSeconds@ time interval begins. Users are notified
-- before they are disconnected due to inactivity. If they try to reconnect
-- to the streaming session before the time interval specified in
-- @DisconnectTimeoutInSeconds@ elapses, they are connected to their
-- previous session. Users are considered idle when they stop providing
-- keyboard or mouse input during their streaming session. File uploads and
-- downloads, audio in, audio out, and pixels changing do not qualify as
-- user activity. If users continue to be idle after the time interval in
-- @IdleDisconnectTimeoutInSeconds@ elapses, they are disconnected.
--
-- To prevent users from being disconnected due to inactivity, specify a
-- value of 0. Otherwise, specify a value between 60 and 3600. The default
-- value is 0.
--
-- If you enable this feature, we recommend that you specify a value that
-- corresponds exactly to a whole number of minutes (for example, 60, 120,
-- and 180). If you don\'t do this, the value is rounded to the nearest
-- minute. For example, if you specify a value of 70, users are
-- disconnected after 1 minute of inactivity. If you specify a value that
-- is at the midpoint between two different minutes, the value is rounded
-- up. For example, if you specify a value of 90, users are disconnected
-- after 2 minutes of inactivity.
createFleet_idleDisconnectTimeoutInSeconds :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Int)
createFleet_idleDisconnectTimeoutInSeconds :: (Maybe Int -> f (Maybe Int)) -> CreateFleet -> f CreateFleet
createFleet_idleDisconnectTimeoutInSeconds = (CreateFleet -> Maybe Int)
-> (CreateFleet -> Maybe Int -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Int
idleDisconnectTimeoutInSeconds :: Maybe Int
$sel:idleDisconnectTimeoutInSeconds:CreateFleet' :: CreateFleet -> Maybe Int
idleDisconnectTimeoutInSeconds} -> Maybe Int
idleDisconnectTimeoutInSeconds) (\s :: CreateFleet
s@CreateFleet' {} Maybe Int
a -> CreateFleet
s {$sel:idleDisconnectTimeoutInSeconds:CreateFleet' :: Maybe Int
idleDisconnectTimeoutInSeconds = Maybe Int
a} :: CreateFleet)

-- | The fleet type.
--
-- [ALWAYS_ON]
--     Provides users with instant-on access to their apps. You are charged
--     for all running instances in your fleet, even if no users are
--     streaming apps.
--
-- [ON_DEMAND]
--     Provide users with access to applications after they connect, which
--     takes one to two minutes. You are charged for instance streaming
--     when users are connected and a small hourly fee for instances that
--     are not streaming apps.
createFleet_fleetType :: Lens.Lens' CreateFleet (Prelude.Maybe FleetType)
createFleet_fleetType :: (Maybe FleetType -> f (Maybe FleetType))
-> CreateFleet -> f CreateFleet
createFleet_fleetType = (CreateFleet -> Maybe FleetType)
-> (CreateFleet -> Maybe FleetType -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe FleetType) (Maybe FleetType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe FleetType
fleetType :: Maybe FleetType
$sel:fleetType:CreateFleet' :: CreateFleet -> Maybe FleetType
fleetType} -> Maybe FleetType
fleetType) (\s :: CreateFleet
s@CreateFleet' {} Maybe FleetType
a -> CreateFleet
s {$sel:fleetType:CreateFleet' :: Maybe FleetType
fleetType = Maybe FleetType
a} :: CreateFleet)

-- | The VPC configuration for the fleet.
createFleet_vpcConfig :: Lens.Lens' CreateFleet (Prelude.Maybe VpcConfig)
createFleet_vpcConfig :: (Maybe VpcConfig -> f (Maybe VpcConfig))
-> CreateFleet -> f CreateFleet
createFleet_vpcConfig = (CreateFleet -> Maybe VpcConfig)
-> (CreateFleet -> Maybe VpcConfig -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe VpcConfig) (Maybe VpcConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe VpcConfig
vpcConfig :: Maybe VpcConfig
$sel:vpcConfig:CreateFleet' :: CreateFleet -> Maybe VpcConfig
vpcConfig} -> Maybe VpcConfig
vpcConfig) (\s :: CreateFleet
s@CreateFleet' {} Maybe VpcConfig
a -> CreateFleet
s {$sel:vpcConfig:CreateFleet' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
a} :: CreateFleet)

-- | The ARN of the public, private, or shared image to use.
createFleet_imageArn :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_imageArn :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_imageArn = (CreateFleet -> Maybe Text)
-> (CreateFleet -> Maybe Text -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Text
imageArn :: Maybe Text
$sel:imageArn:CreateFleet' :: CreateFleet -> Maybe Text
imageArn} -> Maybe Text
imageArn) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:imageArn:CreateFleet' :: Maybe Text
imageArn = Maybe Text
a} :: CreateFleet)

-- | The fleet name to display.
createFleet_displayName :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_displayName :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_displayName = (CreateFleet -> Maybe Text)
-> (CreateFleet -> Maybe Text -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Text
displayName :: Maybe Text
$sel:displayName:CreateFleet' :: CreateFleet -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:displayName:CreateFleet' :: Maybe Text
displayName = Maybe Text
a} :: CreateFleet)

-- | Enables or disables default internet access for the fleet.
createFleet_enableDefaultInternetAccess :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Bool)
createFleet_enableDefaultInternetAccess :: (Maybe Bool -> f (Maybe Bool)) -> CreateFleet -> f CreateFleet
createFleet_enableDefaultInternetAccess = (CreateFleet -> Maybe Bool)
-> (CreateFleet -> Maybe Bool -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Bool
enableDefaultInternetAccess :: Maybe Bool
$sel:enableDefaultInternetAccess:CreateFleet' :: CreateFleet -> Maybe Bool
enableDefaultInternetAccess} -> Maybe Bool
enableDefaultInternetAccess) (\s :: CreateFleet
s@CreateFleet' {} Maybe Bool
a -> CreateFleet
s {$sel:enableDefaultInternetAccess:CreateFleet' :: Maybe Bool
enableDefaultInternetAccess = Maybe Bool
a} :: CreateFleet)

-- | The name of the image used to create the fleet.
createFleet_imageName :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_imageName :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_imageName = (CreateFleet -> Maybe Text)
-> (CreateFleet -> Maybe Text -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Text
imageName :: Maybe Text
$sel:imageName:CreateFleet' :: CreateFleet -> Maybe Text
imageName} -> Maybe Text
imageName) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:imageName:CreateFleet' :: Maybe Text
imageName = Maybe Text
a} :: CreateFleet)

-- | The description to display.
createFleet_description :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_description :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_description = (CreateFleet -> Maybe Text)
-> (CreateFleet -> Maybe Text -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe Text
description :: Maybe Text
$sel:description:CreateFleet' :: CreateFleet -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:description:CreateFleet' :: Maybe Text
description = Maybe Text
a} :: CreateFleet)

-- | The AppStream 2.0 view that is displayed to your users when they stream
-- from the fleet. When @APP@ is specified, only the windows of
-- applications opened by users display. When @DESKTOP@ is specified, the
-- standard desktop that is provided by the operating system displays.
--
-- The default value is @APP@.
createFleet_streamView :: Lens.Lens' CreateFleet (Prelude.Maybe StreamView)
createFleet_streamView :: (Maybe StreamView -> f (Maybe StreamView))
-> CreateFleet -> f CreateFleet
createFleet_streamView = (CreateFleet -> Maybe StreamView)
-> (CreateFleet -> Maybe StreamView -> CreateFleet)
-> Lens
     CreateFleet CreateFleet (Maybe StreamView) (Maybe StreamView)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe StreamView
streamView :: Maybe StreamView
$sel:streamView:CreateFleet' :: CreateFleet -> Maybe StreamView
streamView} -> Maybe StreamView
streamView) (\s :: CreateFleet
s@CreateFleet' {} Maybe StreamView
a -> CreateFleet
s {$sel:streamView:CreateFleet' :: Maybe StreamView
streamView = Maybe StreamView
a} :: CreateFleet)

-- | The tags to associate with the fleet. A tag is a key-value pair, and the
-- value is optional. For example, Environment=Test. If you do not specify
-- a value, Environment=.
--
-- If you do not specify a value, the value is set to an empty string.
--
-- Generally allowed characters are: letters, numbers, and spaces
-- representable in UTF-8, and the following special characters:
--
-- _ . : \/ = + \\ - \@
--
-- For more information, see
-- <https://docs.aws.amazon.com/appstream2/latest/developerguide/tagging-basic.html Tagging Your Resources>
-- in the /Amazon AppStream 2.0 Administration Guide/.
createFleet_tags :: Lens.Lens' CreateFleet (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createFleet_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateFleet -> f CreateFleet
createFleet_tags = (CreateFleet -> Maybe (HashMap Text Text))
-> (CreateFleet -> Maybe (HashMap Text Text) -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateFleet' :: CreateFleet -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateFleet
s@CreateFleet' {} Maybe (HashMap Text Text)
a -> CreateFleet
s {$sel:tags:CreateFleet' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateFleet) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateFleet -> f CreateFleet)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateFleet
-> f CreateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique name for the fleet.
createFleet_name :: Lens.Lens' CreateFleet Prelude.Text
createFleet_name :: (Text -> f Text) -> CreateFleet -> f CreateFleet
createFleet_name = (CreateFleet -> Text)
-> (CreateFleet -> Text -> CreateFleet)
-> Lens CreateFleet CreateFleet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Text
name :: Text
$sel:name:CreateFleet' :: CreateFleet -> Text
name} -> Text
name) (\s :: CreateFleet
s@CreateFleet' {} Text
a -> CreateFleet
s {$sel:name:CreateFleet' :: Text
name = Text
a} :: CreateFleet)

-- | The instance type to use when launching fleet instances. The following
-- instance types are available:
--
-- -   stream.standard.small
--
-- -   stream.standard.medium
--
-- -   stream.standard.large
--
-- -   stream.compute.large
--
-- -   stream.compute.xlarge
--
-- -   stream.compute.2xlarge
--
-- -   stream.compute.4xlarge
--
-- -   stream.compute.8xlarge
--
-- -   stream.memory.large
--
-- -   stream.memory.xlarge
--
-- -   stream.memory.2xlarge
--
-- -   stream.memory.4xlarge
--
-- -   stream.memory.8xlarge
--
-- -   stream.memory.z1d.large
--
-- -   stream.memory.z1d.xlarge
--
-- -   stream.memory.z1d.2xlarge
--
-- -   stream.memory.z1d.3xlarge
--
-- -   stream.memory.z1d.6xlarge
--
-- -   stream.memory.z1d.12xlarge
--
-- -   stream.graphics-design.large
--
-- -   stream.graphics-design.xlarge
--
-- -   stream.graphics-design.2xlarge
--
-- -   stream.graphics-design.4xlarge
--
-- -   stream.graphics-desktop.2xlarge
--
-- -   stream.graphics.g4dn.xlarge
--
-- -   stream.graphics.g4dn.2xlarge
--
-- -   stream.graphics.g4dn.4xlarge
--
-- -   stream.graphics.g4dn.8xlarge
--
-- -   stream.graphics.g4dn.12xlarge
--
-- -   stream.graphics.g4dn.16xlarge
--
-- -   stream.graphics-pro.4xlarge
--
-- -   stream.graphics-pro.8xlarge
--
-- -   stream.graphics-pro.16xlarge
createFleet_instanceType :: Lens.Lens' CreateFleet Prelude.Text
createFleet_instanceType :: (Text -> f Text) -> CreateFleet -> f CreateFleet
createFleet_instanceType = (CreateFleet -> Text)
-> (CreateFleet -> Text -> CreateFleet)
-> Lens CreateFleet CreateFleet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Text
instanceType :: Text
$sel:instanceType:CreateFleet' :: CreateFleet -> Text
instanceType} -> Text
instanceType) (\s :: CreateFleet
s@CreateFleet' {} Text
a -> CreateFleet
s {$sel:instanceType:CreateFleet' :: Text
instanceType = Text
a} :: CreateFleet)

-- | The desired capacity for the fleet.
createFleet_computeCapacity :: Lens.Lens' CreateFleet ComputeCapacity
createFleet_computeCapacity :: (ComputeCapacity -> f ComputeCapacity)
-> CreateFleet -> f CreateFleet
createFleet_computeCapacity = (CreateFleet -> ComputeCapacity)
-> (CreateFleet -> ComputeCapacity -> CreateFleet)
-> Lens CreateFleet CreateFleet ComputeCapacity ComputeCapacity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {ComputeCapacity
computeCapacity :: ComputeCapacity
$sel:computeCapacity:CreateFleet' :: CreateFleet -> ComputeCapacity
computeCapacity} -> ComputeCapacity
computeCapacity) (\s :: CreateFleet
s@CreateFleet' {} ComputeCapacity
a -> CreateFleet
s {$sel:computeCapacity:CreateFleet' :: ComputeCapacity
computeCapacity = ComputeCapacity
a} :: CreateFleet)

instance Core.AWSRequest CreateFleet where
  type AWSResponse CreateFleet = CreateFleetResponse
  request :: CreateFleet -> Request CreateFleet
request = Service -> CreateFleet -> Request CreateFleet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateFleet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFleet)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateFleet))
-> Logger
-> Service
-> Proxy CreateFleet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFleet)))
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 Fleet -> Int -> CreateFleetResponse
CreateFleetResponse'
            (Maybe Fleet -> Int -> CreateFleetResponse)
-> Either String (Maybe Fleet)
-> Either String (Int -> CreateFleetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Fleet)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Fleet")
            Either String (Int -> CreateFleetResponse)
-> Either String Int -> Either String CreateFleetResponse
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 CreateFleet

instance Prelude.NFData CreateFleet

instance Core.ToHeaders CreateFleet where
  toHeaders :: CreateFleet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateFleet -> 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
"PhotonAdminProxyService.CreateFleet" ::
                          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 CreateFleet where
  toJSON :: CreateFleet -> Value
toJSON CreateFleet' {Maybe Bool
Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe DomainJoinInfo
Maybe FleetType
Maybe StreamView
Maybe VpcConfig
Text
ComputeCapacity
computeCapacity :: ComputeCapacity
instanceType :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
streamView :: Maybe StreamView
description :: Maybe Text
imageName :: Maybe Text
enableDefaultInternetAccess :: Maybe Bool
displayName :: Maybe Text
imageArn :: Maybe Text
vpcConfig :: Maybe VpcConfig
fleetType :: Maybe FleetType
idleDisconnectTimeoutInSeconds :: Maybe Int
maxUserDurationInSeconds :: Maybe Int
disconnectTimeoutInSeconds :: Maybe Int
iamRoleArn :: Maybe Text
domainJoinInfo :: Maybe DomainJoinInfo
$sel:computeCapacity:CreateFleet' :: CreateFleet -> ComputeCapacity
$sel:instanceType:CreateFleet' :: CreateFleet -> Text
$sel:name:CreateFleet' :: CreateFleet -> Text
$sel:tags:CreateFleet' :: CreateFleet -> Maybe (HashMap Text Text)
$sel:streamView:CreateFleet' :: CreateFleet -> Maybe StreamView
$sel:description:CreateFleet' :: CreateFleet -> Maybe Text
$sel:imageName:CreateFleet' :: CreateFleet -> Maybe Text
$sel:enableDefaultInternetAccess:CreateFleet' :: CreateFleet -> Maybe Bool
$sel:displayName:CreateFleet' :: CreateFleet -> Maybe Text
$sel:imageArn:CreateFleet' :: CreateFleet -> Maybe Text
$sel:vpcConfig:CreateFleet' :: CreateFleet -> Maybe VpcConfig
$sel:fleetType:CreateFleet' :: CreateFleet -> Maybe FleetType
$sel:idleDisconnectTimeoutInSeconds:CreateFleet' :: CreateFleet -> Maybe Int
$sel:maxUserDurationInSeconds:CreateFleet' :: CreateFleet -> Maybe Int
$sel:disconnectTimeoutInSeconds:CreateFleet' :: CreateFleet -> Maybe Int
$sel:iamRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
$sel:domainJoinInfo:CreateFleet' :: CreateFleet -> Maybe DomainJoinInfo
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DomainJoinInfo" Text -> DomainJoinInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (DomainJoinInfo -> Pair) -> Maybe DomainJoinInfo -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DomainJoinInfo
domainJoinInfo,
            (Text
"IamRoleArn" 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
iamRoleArn,
            (Text
"DisconnectTimeoutInSeconds" 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
disconnectTimeoutInSeconds,
            (Text
"MaxUserDurationInSeconds" 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
maxUserDurationInSeconds,
            (Text
"IdleDisconnectTimeoutInSeconds" 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
idleDisconnectTimeoutInSeconds,
            (Text
"FleetType" Text -> FleetType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (FleetType -> Pair) -> Maybe FleetType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FleetType
fleetType,
            (Text
"VpcConfig" Text -> VpcConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VpcConfig -> Pair) -> Maybe VpcConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfig
vpcConfig,
            (Text
"ImageArn" 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
imageArn,
            (Text
"DisplayName" 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
displayName,
            (Text
"EnableDefaultInternetAccess" 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
enableDefaultInternetAccess,
            (Text
"ImageName" 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
imageName,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"StreamView" Text -> StreamView -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (StreamView -> Pair) -> Maybe StreamView -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamView
streamView,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ComputeCapacity" Text -> ComputeCapacity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ComputeCapacity
computeCapacity)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateFleetResponse' 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:
--
-- 'fleet', 'createFleetResponse_fleet' - Information about the fleet.
--
-- 'httpStatus', 'createFleetResponse_httpStatus' - The response's http status code.
newCreateFleetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFleetResponse
newCreateFleetResponse :: Int -> CreateFleetResponse
newCreateFleetResponse Int
pHttpStatus_ =
  CreateFleetResponse' :: Maybe Fleet -> Int -> CreateFleetResponse
CreateFleetResponse'
    { $sel:fleet:CreateFleetResponse' :: Maybe Fleet
fleet = Maybe Fleet
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFleetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the fleet.
createFleetResponse_fleet :: Lens.Lens' CreateFleetResponse (Prelude.Maybe Fleet)
createFleetResponse_fleet :: (Maybe Fleet -> f (Maybe Fleet))
-> CreateFleetResponse -> f CreateFleetResponse
createFleetResponse_fleet = (CreateFleetResponse -> Maybe Fleet)
-> (CreateFleetResponse -> Maybe Fleet -> CreateFleetResponse)
-> Lens
     CreateFleetResponse CreateFleetResponse (Maybe Fleet) (Maybe Fleet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetResponse' {Maybe Fleet
fleet :: Maybe Fleet
$sel:fleet:CreateFleetResponse' :: CreateFleetResponse -> Maybe Fleet
fleet} -> Maybe Fleet
fleet) (\s :: CreateFleetResponse
s@CreateFleetResponse' {} Maybe Fleet
a -> CreateFleetResponse
s {$sel:fleet:CreateFleetResponse' :: Maybe Fleet
fleet = Maybe Fleet
a} :: CreateFleetResponse)

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

instance Prelude.NFData CreateFleetResponse