{-# 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.UpdateFleet
-- 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)
--
-- Updates the specified fleet.
--
-- If the fleet is in the @STOPPED@ state, you can update any attribute
-- except the fleet name. If the fleet is in the @RUNNING@ state, you can
-- update the @DisplayName@, @ComputeCapacity@, @ImageARN@, @ImageName@,
-- @IdleDisconnectTimeoutInSeconds@, and @DisconnectTimeoutInSeconds@
-- attributes. If the fleet is in the @STARTING@ or @STOPPING@ state, you
-- can\'t update it.
module Amazonka.AppStream.UpdateFleet
  ( -- * Creating a Request
    UpdateFleet (..),
    newUpdateFleet,

    -- * Request Lenses
    updateFleet_domainJoinInfo,
    updateFleet_iamRoleArn,
    updateFleet_disconnectTimeoutInSeconds,
    updateFleet_maxUserDurationInSeconds,
    updateFleet_attributesToDelete,
    updateFleet_idleDisconnectTimeoutInSeconds,
    updateFleet_deleteVpcConfig,
    updateFleet_instanceType,
    updateFleet_vpcConfig,
    updateFleet_name,
    updateFleet_imageArn,
    updateFleet_displayName,
    updateFleet_enableDefaultInternetAccess,
    updateFleet_imageName,
    updateFleet_description,
    updateFleet_streamView,
    updateFleet_computeCapacity,

    -- * Destructuring the Response
    UpdateFleetResponse (..),
    newUpdateFleetResponse,

    -- * Response Lenses
    updateFleetResponse_fleet,
    updateFleetResponse_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:/ 'newUpdateFleet' smart constructor.
data UpdateFleet = UpdateFleet'
  { -- | The name of the directory and organizational unit (OU) to use to join
    -- the fleet to a Microsoft Active Directory domain.
    UpdateFleet -> 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/.
    UpdateFleet -> 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.
    UpdateFleet -> 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.
    UpdateFleet -> Maybe Int
maxUserDurationInSeconds :: Prelude.Maybe Prelude.Int,
    -- | The fleet attributes to delete.
    UpdateFleet -> Maybe [FleetAttribute]
attributesToDelete :: Prelude.Maybe [FleetAttribute],
    -- | 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 users 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.
    UpdateFleet -> Maybe Int
idleDisconnectTimeoutInSeconds :: Prelude.Maybe Prelude.Int,
    -- | Deletes the VPC association for the specified fleet.
    UpdateFleet -> Maybe Bool
deleteVpcConfig :: Prelude.Maybe Prelude.Bool,
    -- | 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
    UpdateFleet -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The VPC configuration for the fleet.
    UpdateFleet -> Maybe VpcConfig
vpcConfig :: Prelude.Maybe VpcConfig,
    -- | A unique name for the fleet.
    UpdateFleet -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the public, private, or shared image to use.
    UpdateFleet -> Maybe Text
imageArn :: Prelude.Maybe Prelude.Text,
    -- | The fleet name to display.
    UpdateFleet -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | Enables or disables default internet access for the fleet.
    UpdateFleet -> Maybe Bool
enableDefaultInternetAccess :: Prelude.Maybe Prelude.Bool,
    -- | The name of the image used to create the fleet.
    UpdateFleet -> Maybe Text
imageName :: Prelude.Maybe Prelude.Text,
    -- | The description to display.
    UpdateFleet -> 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@.
    UpdateFleet -> Maybe StreamView
streamView :: Prelude.Maybe StreamView,
    -- | The desired capacity for the fleet.
    UpdateFleet -> Maybe ComputeCapacity
computeCapacity :: Prelude.Maybe ComputeCapacity
  }
  deriving (UpdateFleet -> UpdateFleet -> Bool
(UpdateFleet -> UpdateFleet -> Bool)
-> (UpdateFleet -> UpdateFleet -> Bool) -> Eq UpdateFleet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFleet -> UpdateFleet -> Bool
$c/= :: UpdateFleet -> UpdateFleet -> Bool
== :: UpdateFleet -> UpdateFleet -> Bool
$c== :: UpdateFleet -> UpdateFleet -> Bool
Prelude.Eq, ReadPrec [UpdateFleet]
ReadPrec UpdateFleet
Int -> ReadS UpdateFleet
ReadS [UpdateFleet]
(Int -> ReadS UpdateFleet)
-> ReadS [UpdateFleet]
-> ReadPrec UpdateFleet
-> ReadPrec [UpdateFleet]
-> Read UpdateFleet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFleet]
$creadListPrec :: ReadPrec [UpdateFleet]
readPrec :: ReadPrec UpdateFleet
$creadPrec :: ReadPrec UpdateFleet
readList :: ReadS [UpdateFleet]
$creadList :: ReadS [UpdateFleet]
readsPrec :: Int -> ReadS UpdateFleet
$creadsPrec :: Int -> ReadS UpdateFleet
Prelude.Read, Int -> UpdateFleet -> ShowS
[UpdateFleet] -> ShowS
UpdateFleet -> String
(Int -> UpdateFleet -> ShowS)
-> (UpdateFleet -> String)
-> ([UpdateFleet] -> ShowS)
-> Show UpdateFleet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFleet] -> ShowS
$cshowList :: [UpdateFleet] -> ShowS
show :: UpdateFleet -> String
$cshow :: UpdateFleet -> String
showsPrec :: Int -> UpdateFleet -> ShowS
$cshowsPrec :: Int -> UpdateFleet -> ShowS
Prelude.Show, (forall x. UpdateFleet -> Rep UpdateFleet x)
-> (forall x. Rep UpdateFleet x -> UpdateFleet)
-> Generic UpdateFleet
forall x. Rep UpdateFleet x -> UpdateFleet
forall x. UpdateFleet -> Rep UpdateFleet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFleet x -> UpdateFleet
$cfrom :: forall x. UpdateFleet -> Rep UpdateFleet x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFleet' 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', 'updateFleet_domainJoinInfo' - The name of the directory and organizational unit (OU) to use to join
-- the fleet to a Microsoft Active Directory domain.
--
-- 'iamRoleArn', 'updateFleet_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', 'updateFleet_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', 'updateFleet_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.
--
-- 'attributesToDelete', 'updateFleet_attributesToDelete' - The fleet attributes to delete.
--
-- 'idleDisconnectTimeoutInSeconds', 'updateFleet_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 users 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.
--
-- 'deleteVpcConfig', 'updateFleet_deleteVpcConfig' - Deletes the VPC association for the specified fleet.
--
-- 'instanceType', 'updateFleet_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
--
-- 'vpcConfig', 'updateFleet_vpcConfig' - The VPC configuration for the fleet.
--
-- 'name', 'updateFleet_name' - A unique name for the fleet.
--
-- 'imageArn', 'updateFleet_imageArn' - The ARN of the public, private, or shared image to use.
--
-- 'displayName', 'updateFleet_displayName' - The fleet name to display.
--
-- 'enableDefaultInternetAccess', 'updateFleet_enableDefaultInternetAccess' - Enables or disables default internet access for the fleet.
--
-- 'imageName', 'updateFleet_imageName' - The name of the image used to create the fleet.
--
-- 'description', 'updateFleet_description' - The description to display.
--
-- 'streamView', 'updateFleet_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@.
--
-- 'computeCapacity', 'updateFleet_computeCapacity' - The desired capacity for the fleet.
newUpdateFleet ::
  UpdateFleet
newUpdateFleet :: UpdateFleet
newUpdateFleet =
  UpdateFleet' :: Maybe DomainJoinInfo
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe [FleetAttribute]
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe VpcConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe StreamView
-> Maybe ComputeCapacity
-> UpdateFleet
UpdateFleet'
    { $sel:domainJoinInfo:UpdateFleet' :: Maybe DomainJoinInfo
domainJoinInfo = Maybe DomainJoinInfo
forall a. Maybe a
Prelude.Nothing,
      $sel:iamRoleArn:UpdateFleet' :: Maybe Text
iamRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disconnectTimeoutInSeconds:UpdateFleet' :: Maybe Int
disconnectTimeoutInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maxUserDurationInSeconds:UpdateFleet' :: Maybe Int
maxUserDurationInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:attributesToDelete:UpdateFleet' :: Maybe [FleetAttribute]
attributesToDelete = Maybe [FleetAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:idleDisconnectTimeoutInSeconds:UpdateFleet' :: Maybe Int
idleDisconnectTimeoutInSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteVpcConfig:UpdateFleet' :: Maybe Bool
deleteVpcConfig = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:UpdateFleet' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcConfig:UpdateFleet' :: Maybe VpcConfig
vpcConfig = Maybe VpcConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateFleet' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageArn:UpdateFleet' :: Maybe Text
imageArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateFleet' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableDefaultInternetAccess:UpdateFleet' :: Maybe Bool
enableDefaultInternetAccess = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:imageName:UpdateFleet' :: Maybe Text
imageName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateFleet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:streamView:UpdateFleet' :: Maybe StreamView
streamView = Maybe StreamView
forall a. Maybe a
Prelude.Nothing,
      $sel:computeCapacity:UpdateFleet' :: Maybe ComputeCapacity
computeCapacity = Maybe ComputeCapacity
forall a. Maybe a
Prelude.Nothing
    }

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

-- | 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/.
updateFleet_iamRoleArn :: Lens.Lens' UpdateFleet (Prelude.Maybe Prelude.Text)
updateFleet_iamRoleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateFleet -> f UpdateFleet
updateFleet_iamRoleArn = (UpdateFleet -> Maybe Text)
-> (UpdateFleet -> Maybe Text -> UpdateFleet)
-> Lens UpdateFleet UpdateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe Text
iamRoleArn :: Maybe Text
$sel:iamRoleArn:UpdateFleet' :: UpdateFleet -> Maybe Text
iamRoleArn} -> Maybe Text
iamRoleArn) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe Text
a -> UpdateFleet
s {$sel:iamRoleArn:UpdateFleet' :: Maybe Text
iamRoleArn = Maybe Text
a} :: UpdateFleet)

-- | 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.
updateFleet_disconnectTimeoutInSeconds :: Lens.Lens' UpdateFleet (Prelude.Maybe Prelude.Int)
updateFleet_disconnectTimeoutInSeconds :: (Maybe Int -> f (Maybe Int)) -> UpdateFleet -> f UpdateFleet
updateFleet_disconnectTimeoutInSeconds = (UpdateFleet -> Maybe Int)
-> (UpdateFleet -> Maybe Int -> UpdateFleet)
-> Lens UpdateFleet UpdateFleet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe Int
disconnectTimeoutInSeconds :: Maybe Int
$sel:disconnectTimeoutInSeconds:UpdateFleet' :: UpdateFleet -> Maybe Int
disconnectTimeoutInSeconds} -> Maybe Int
disconnectTimeoutInSeconds) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe Int
a -> UpdateFleet
s {$sel:disconnectTimeoutInSeconds:UpdateFleet' :: Maybe Int
disconnectTimeoutInSeconds = Maybe Int
a} :: UpdateFleet)

-- | 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.
updateFleet_maxUserDurationInSeconds :: Lens.Lens' UpdateFleet (Prelude.Maybe Prelude.Int)
updateFleet_maxUserDurationInSeconds :: (Maybe Int -> f (Maybe Int)) -> UpdateFleet -> f UpdateFleet
updateFleet_maxUserDurationInSeconds = (UpdateFleet -> Maybe Int)
-> (UpdateFleet -> Maybe Int -> UpdateFleet)
-> Lens UpdateFleet UpdateFleet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe Int
maxUserDurationInSeconds :: Maybe Int
$sel:maxUserDurationInSeconds:UpdateFleet' :: UpdateFleet -> Maybe Int
maxUserDurationInSeconds} -> Maybe Int
maxUserDurationInSeconds) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe Int
a -> UpdateFleet
s {$sel:maxUserDurationInSeconds:UpdateFleet' :: Maybe Int
maxUserDurationInSeconds = Maybe Int
a} :: UpdateFleet)

-- | The fleet attributes to delete.
updateFleet_attributesToDelete :: Lens.Lens' UpdateFleet (Prelude.Maybe [FleetAttribute])
updateFleet_attributesToDelete :: (Maybe [FleetAttribute] -> f (Maybe [FleetAttribute]))
-> UpdateFleet -> f UpdateFleet
updateFleet_attributesToDelete = (UpdateFleet -> Maybe [FleetAttribute])
-> (UpdateFleet -> Maybe [FleetAttribute] -> UpdateFleet)
-> Lens
     UpdateFleet
     UpdateFleet
     (Maybe [FleetAttribute])
     (Maybe [FleetAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe [FleetAttribute]
attributesToDelete :: Maybe [FleetAttribute]
$sel:attributesToDelete:UpdateFleet' :: UpdateFleet -> Maybe [FleetAttribute]
attributesToDelete} -> Maybe [FleetAttribute]
attributesToDelete) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe [FleetAttribute]
a -> UpdateFleet
s {$sel:attributesToDelete:UpdateFleet' :: Maybe [FleetAttribute]
attributesToDelete = Maybe [FleetAttribute]
a} :: UpdateFleet) ((Maybe [FleetAttribute] -> f (Maybe [FleetAttribute]))
 -> UpdateFleet -> f UpdateFleet)
-> ((Maybe [FleetAttribute] -> f (Maybe [FleetAttribute]))
    -> Maybe [FleetAttribute] -> f (Maybe [FleetAttribute]))
-> (Maybe [FleetAttribute] -> f (Maybe [FleetAttribute]))
-> UpdateFleet
-> f UpdateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FleetAttribute] [FleetAttribute] [FleetAttribute] [FleetAttribute]
-> Iso
     (Maybe [FleetAttribute])
     (Maybe [FleetAttribute])
     (Maybe [FleetAttribute])
     (Maybe [FleetAttribute])
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
  [FleetAttribute] [FleetAttribute] [FleetAttribute] [FleetAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 users 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.
updateFleet_idleDisconnectTimeoutInSeconds :: Lens.Lens' UpdateFleet (Prelude.Maybe Prelude.Int)
updateFleet_idleDisconnectTimeoutInSeconds :: (Maybe Int -> f (Maybe Int)) -> UpdateFleet -> f UpdateFleet
updateFleet_idleDisconnectTimeoutInSeconds = (UpdateFleet -> Maybe Int)
-> (UpdateFleet -> Maybe Int -> UpdateFleet)
-> Lens UpdateFleet UpdateFleet (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe Int
idleDisconnectTimeoutInSeconds :: Maybe Int
$sel:idleDisconnectTimeoutInSeconds:UpdateFleet' :: UpdateFleet -> Maybe Int
idleDisconnectTimeoutInSeconds} -> Maybe Int
idleDisconnectTimeoutInSeconds) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe Int
a -> UpdateFleet
s {$sel:idleDisconnectTimeoutInSeconds:UpdateFleet' :: Maybe Int
idleDisconnectTimeoutInSeconds = Maybe Int
a} :: UpdateFleet)

-- | Deletes the VPC association for the specified fleet.
updateFleet_deleteVpcConfig :: Lens.Lens' UpdateFleet (Prelude.Maybe Prelude.Bool)
updateFleet_deleteVpcConfig :: (Maybe Bool -> f (Maybe Bool)) -> UpdateFleet -> f UpdateFleet
updateFleet_deleteVpcConfig = (UpdateFleet -> Maybe Bool)
-> (UpdateFleet -> Maybe Bool -> UpdateFleet)
-> Lens UpdateFleet UpdateFleet (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe Bool
deleteVpcConfig :: Maybe Bool
$sel:deleteVpcConfig:UpdateFleet' :: UpdateFleet -> Maybe Bool
deleteVpcConfig} -> Maybe Bool
deleteVpcConfig) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe Bool
a -> UpdateFleet
s {$sel:deleteVpcConfig:UpdateFleet' :: Maybe Bool
deleteVpcConfig = Maybe Bool
a} :: UpdateFleet)

-- | 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
updateFleet_instanceType :: Lens.Lens' UpdateFleet (Prelude.Maybe Prelude.Text)
updateFleet_instanceType :: (Maybe Text -> f (Maybe Text)) -> UpdateFleet -> f UpdateFleet
updateFleet_instanceType = (UpdateFleet -> Maybe Text)
-> (UpdateFleet -> Maybe Text -> UpdateFleet)
-> Lens UpdateFleet UpdateFleet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:UpdateFleet' :: UpdateFleet -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe Text
a -> UpdateFleet
s {$sel:instanceType:UpdateFleet' :: Maybe Text
instanceType = Maybe Text
a} :: UpdateFleet)

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

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

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

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

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

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

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

-- | 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@.
updateFleet_streamView :: Lens.Lens' UpdateFleet (Prelude.Maybe StreamView)
updateFleet_streamView :: (Maybe StreamView -> f (Maybe StreamView))
-> UpdateFleet -> f UpdateFleet
updateFleet_streamView = (UpdateFleet -> Maybe StreamView)
-> (UpdateFleet -> Maybe StreamView -> UpdateFleet)
-> Lens
     UpdateFleet UpdateFleet (Maybe StreamView) (Maybe StreamView)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleet' {Maybe StreamView
streamView :: Maybe StreamView
$sel:streamView:UpdateFleet' :: UpdateFleet -> Maybe StreamView
streamView} -> Maybe StreamView
streamView) (\s :: UpdateFleet
s@UpdateFleet' {} Maybe StreamView
a -> UpdateFleet
s {$sel:streamView:UpdateFleet' :: Maybe StreamView
streamView = Maybe StreamView
a} :: UpdateFleet)

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

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

instance Prelude.NFData UpdateFleet

instance Core.ToHeaders UpdateFleet where
  toHeaders :: UpdateFleet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateFleet -> 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.UpdateFleet" ::
                          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 UpdateFleet where
  toJSON :: UpdateFleet -> Value
toJSON UpdateFleet' {Maybe Bool
Maybe Int
Maybe [FleetAttribute]
Maybe Text
Maybe ComputeCapacity
Maybe DomainJoinInfo
Maybe StreamView
Maybe VpcConfig
computeCapacity :: Maybe ComputeCapacity
streamView :: Maybe StreamView
description :: Maybe Text
imageName :: Maybe Text
enableDefaultInternetAccess :: Maybe Bool
displayName :: Maybe Text
imageArn :: Maybe Text
name :: Maybe Text
vpcConfig :: Maybe VpcConfig
instanceType :: Maybe Text
deleteVpcConfig :: Maybe Bool
idleDisconnectTimeoutInSeconds :: Maybe Int
attributesToDelete :: Maybe [FleetAttribute]
maxUserDurationInSeconds :: Maybe Int
disconnectTimeoutInSeconds :: Maybe Int
iamRoleArn :: Maybe Text
domainJoinInfo :: Maybe DomainJoinInfo
$sel:computeCapacity:UpdateFleet' :: UpdateFleet -> Maybe ComputeCapacity
$sel:streamView:UpdateFleet' :: UpdateFleet -> Maybe StreamView
$sel:description:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:imageName:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:enableDefaultInternetAccess:UpdateFleet' :: UpdateFleet -> Maybe Bool
$sel:displayName:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:imageArn:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:name:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:vpcConfig:UpdateFleet' :: UpdateFleet -> Maybe VpcConfig
$sel:instanceType:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:deleteVpcConfig:UpdateFleet' :: UpdateFleet -> Maybe Bool
$sel:idleDisconnectTimeoutInSeconds:UpdateFleet' :: UpdateFleet -> Maybe Int
$sel:attributesToDelete:UpdateFleet' :: UpdateFleet -> Maybe [FleetAttribute]
$sel:maxUserDurationInSeconds:UpdateFleet' :: UpdateFleet -> Maybe Int
$sel:disconnectTimeoutInSeconds:UpdateFleet' :: UpdateFleet -> Maybe Int
$sel:iamRoleArn:UpdateFleet' :: UpdateFleet -> Maybe Text
$sel:domainJoinInfo:UpdateFleet' :: UpdateFleet -> 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
"AttributesToDelete" Text -> [FleetAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([FleetAttribute] -> Pair) -> Maybe [FleetAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FleetAttribute]
attributesToDelete,
            (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
"DeleteVpcConfig" 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
deleteVpcConfig,
            (Text
"InstanceType" 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
instanceType,
            (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
"Name" 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
name,
            (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
"ComputeCapacity" Text -> ComputeCapacity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ComputeCapacity -> Pair) -> Maybe ComputeCapacity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComputeCapacity
computeCapacity
          ]
      )

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

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

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

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

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

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

instance Prelude.NFData UpdateFleetResponse