{-# 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.GameLift.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 of Amazon Elastic Compute Cloud (Amazon EC2) instances
-- to host your custom game server or Realtime Servers. Use this operation
-- to configure the computing resources for your fleet and provide
-- instructions for running game servers on each instance.
--
-- Most GameLift fleets can deploy instances to multiple locations,
-- including the home Region (where the fleet is created) and an optional
-- set of remote locations. Fleets that are created in the following AWS
-- Regions support multiple locations: us-east-1 (N. Virginia), us-west-2
-- (Oregon), eu-central-1 (Frankfurt), eu-west-1 (Ireland), ap-southeast-2
-- (Sydney), ap-northeast-1 (Tokyo), and ap-northeast-2 (Seoul). Fleets
-- that are created in other GameLift Regions can deploy instances in the
-- fleet\'s home Region only. All fleet instances use the same
-- configuration regardless of location; however, you can adjust capacity
-- settings and turn auto-scaling on\/off for each location.
--
-- To create a fleet, choose the hardware for your instances, specify a
-- game server build or Realtime script to deploy, and provide a runtime
-- configuration to direct GameLift how to start and run game servers on
-- each instance in the fleet. Set permissions for inbound traffic to your
-- game servers, and enable optional features as needed. When creating a
-- multi-location fleet, provide a list of additional remote locations.
--
-- If successful, this operation creates a new Fleet resource and places it
-- in @NEW@ status, which prompts GameLift to initiate the
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creation-workflow.html fleet creation workflow>.
-- You can track fleet creation by checking fleet status using
-- DescribeFleetAttributes and DescribeFleetLocationAttributes\/, or by
-- monitoring fleet creation events using DescribeFleetEvents. As soon as
-- the fleet status changes to @ACTIVE@, you can enable automatic scaling
-- for the fleet with PutScalingPolicy and set capacity for the home Region
-- with UpdateFleetCapacity. When the status of each remote location
-- reaches @ACTIVE@, you can set capacity by location using
-- UpdateFleetCapacity.
--
-- __Learn more__
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html Setting up fleets>
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation Debug fleet creation issues>
--
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html Multi-location fleets>
--
-- __Related actions__
--
-- CreateFleet | UpdateFleetCapacity | PutScalingPolicy |
-- DescribeEC2InstanceLimits | DescribeFleetAttributes |
-- DescribeFleetLocationAttributes | UpdateFleetAttributes |
-- StopFleetActions | DeleteFleet |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.CreateFleet
  ( -- * Creating a Request
    CreateFleet (..),
    newCreateFleet,

    -- * Request Lenses
    createFleet_serverLaunchParameters,
    createFleet_logPaths,
    createFleet_peerVpcId,
    createFleet_buildId,
    createFleet_fleetType,
    createFleet_peerVpcAwsAccountId,
    createFleet_eC2InboundPermissions,
    createFleet_runtimeConfiguration,
    createFleet_newGameSessionProtectionPolicy,
    createFleet_scriptId,
    createFleet_certificateConfiguration,
    createFleet_serverLaunchPath,
    createFleet_instanceRoleArn,
    createFleet_metricGroups,
    createFleet_description,
    createFleet_resourceCreationLimitPolicy,
    createFleet_locations,
    createFleet_tags,
    createFleet_name,
    createFleet_eC2InstanceType,

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

    -- * Response Lenses
    createFleetResponse_locationStates,
    createFleetResponse_fleetAttributes,
    createFleetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input for a request operation.
--
-- /See:/ 'newCreateFleet' smart constructor.
data CreateFleet = CreateFleet'
  { -- | __This parameter is no longer used.__ Specify server launch parameters
    -- using the @RuntimeConfiguration@ parameter. Requests that use this
    -- parameter instead continue to be valid.
    CreateFleet -> Maybe Text
serverLaunchParameters :: Prelude.Maybe Prelude.Text,
    -- | __This parameter is no longer used.__ To specify where GameLift should
    -- store log files once a server process shuts down, use the GameLift
    -- server API @ProcessReady()@ and specify one or more directory paths in
    -- @logParameters@. See more information in the
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api-ref.html#gamelift-sdk-server-api-ref-dataypes-process Server API Reference>.
    CreateFleet -> Maybe [Text]
logPaths :: Prelude.Maybe [Prelude.Text],
    -- | A unique identifier for a VPC with resources to be accessed by your
    -- GameLift fleet. The VPC must be in the same Region as your fleet. To
    -- look up a VPC ID, use the
    -- <https://console.aws.amazon.com/vpc/ VPC Dashboard> in the AWS
    -- Management Console. Learn more about VPC peering in
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
    CreateFleet -> Maybe Text
peerVpcId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for a custom game server build to be deployed on
    -- fleet instances. You can use either the build ID or ARN. The build must
    -- be uploaded to GameLift and in @READY@ status. This fleet property
    -- cannot be changed later.
    CreateFleet -> Maybe Text
buildId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether to use On-Demand or Spot instances for this fleet. By
    -- default, this property is set to @ON_DEMAND@. Learn more about when to
    -- use
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot On-Demand versus Spot Instances>.
    -- This property cannot be changed after the fleet is created.
    CreateFleet -> Maybe FleetType
fleetType :: Prelude.Maybe FleetType,
    -- | Used when peering your GameLift fleet with a VPC, the unique identifier
    -- for the AWS account that owns the VPC. You can find your account ID in
    -- the AWS Management Console under account settings.
    CreateFleet -> Maybe Text
peerVpcAwsAccountId :: Prelude.Maybe Prelude.Text,
    -- | The allowed IP address ranges and port settings that allow inbound
    -- traffic to access game sessions on this fleet. If the fleet is hosting a
    -- custom game build, this property must be set before players can connect
    -- to game sessions. For Realtime Servers fleets, GameLift automatically
    -- sets TCP and UDP ranges.
    CreateFleet -> Maybe [IpPermission]
eC2InboundPermissions :: Prelude.Maybe [IpPermission],
    -- | Instructions for how to launch and maintain server processes on
    -- instances in the fleet. The runtime configuration defines one or more
    -- server process configurations, each identifying a build executable or
    -- Realtime script file and the number of processes of that type to run
    -- concurrently.
    --
    -- The @RuntimeConfiguration@ parameter is required unless the fleet is
    -- being configured using the older parameters @ServerLaunchPath@ and
    -- @ServerLaunchParameters@, which are still supported for backward
    -- compatibility.
    CreateFleet -> Maybe RuntimeConfiguration
runtimeConfiguration :: Prelude.Maybe RuntimeConfiguration,
    -- | The status of termination protection for active game sessions on the
    -- fleet. By default, this property is set to @NoProtection@. You can also
    -- set game session protection for an individual game session by calling
    -- UpdateGameSession.
    --
    -- -   __NoProtection__ - Game sessions can be terminated during active
    --     gameplay as a result of a scale-down event.
    --
    -- -   __FullProtection__ - Game sessions in @ACTIVE@ status cannot be
    --     terminated during a scale-down event.
    CreateFleet -> Maybe ProtectionPolicy
newGameSessionProtectionPolicy' :: Prelude.Maybe ProtectionPolicy,
    -- | The unique identifier for a Realtime configuration script to be deployed
    -- on fleet instances. You can use either the script ID or ARN. Scripts
    -- must be uploaded to GameLift prior to creating the fleet. This fleet
    -- property cannot be changed later.
    CreateFleet -> Maybe Text
scriptId :: Prelude.Maybe Prelude.Text,
    -- | Prompts GameLift to generate a TLS\/SSL certificate for the fleet. TLS
    -- certificates are used for encrypting traffic between game clients and
    -- the game servers that are running on GameLift. By default, the
    -- @CertificateConfiguration@ is set to @DISABLED@. Learn more at
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-howitworks.html#gamelift-howitworks-security Securing Client\/Server Communication>.
    -- This property cannot be changed after the fleet is created.
    --
    -- Note: This feature requires the AWS Certificate Manager (ACM) service,
    -- which is not available in all AWS regions. When working in a region that
    -- does not support this feature, a fleet creation request with certificate
    -- generation fails with a 4xx error.
    CreateFleet -> Maybe CertificateConfiguration
certificateConfiguration :: Prelude.Maybe CertificateConfiguration,
    -- | __This parameter is no longer used.__ Specify a server launch path using
    -- the @RuntimeConfiguration@ parameter. Requests that use this parameter
    -- instead continue to be valid.
    CreateFleet -> Maybe Text
serverLaunchPath :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for an AWS IAM role that manages access to your AWS
    -- services. With an instance role ARN set, any application that runs on an
    -- instance in this fleet can assume the role, including install scripts,
    -- server processes, and daemons (background processes). Create a role or
    -- look up a role\'s ARN by using the
    -- <https://console.aws.amazon.com/iam/ IAM dashboard> in the AWS
    -- Management Console. Learn more about using on-box credentials for your
    -- game servers at
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html Access external resources from a game server>.
    -- This property cannot be changed after the fleet is created.
    CreateFleet -> Maybe Text
instanceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The name of an AWS CloudWatch metric group to add this fleet to. A
    -- metric group is used to aggregate the metrics for multiple fleets. You
    -- can specify an existing metric group name or set a new name to create a
    -- new metric group. A fleet can be included in only one metric group at a
    -- time.
    CreateFleet -> Maybe [Text]
metricGroups :: Prelude.Maybe [Prelude.Text],
    -- | A human-readable description of the fleet.
    CreateFleet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A policy that limits the number of game sessions that an individual
    -- player can create on instances in this fleet within a specified span of
    -- time.
    CreateFleet -> Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy :: Prelude.Maybe ResourceCreationLimitPolicy,
    -- | A set of remote locations to deploy additional instances to and manage
    -- as part of the fleet. This parameter can only be used when creating
    -- fleets in AWS Regions that support multiple locations. You can add any
    -- GameLift-supported AWS Region as a remote location, in the form of an
    -- AWS Region code such as @us-west-2@. To create a fleet with instances in
    -- the home Region only, omit this parameter.
    CreateFleet -> Maybe (NonEmpty LocationConfiguration)
locations :: Prelude.Maybe (Prelude.NonEmpty LocationConfiguration),
    -- | A list of labels to assign to the new fleet resource. Tags are
    -- developer-defined key-value pairs. Tagging AWS resources are useful for
    -- resource management, access management and cost allocation. For more
    -- information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
    -- in the /AWS General Reference/. Once the fleet is created, you can use
    -- TagResource, UntagResource, and ListTagsForResource to add, remove, and
    -- view tags. The maximum tag limit may be lower than stated. See the /AWS
    -- General Reference/ for actual tagging limits.
    CreateFleet -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | A descriptive label that is associated with a fleet. Fleet names do not
    -- need to be unique.
    CreateFleet -> Text
name :: Prelude.Text,
    -- | The GameLift-supported EC2 instance type to use for all fleet instances.
    -- Instance type determines the computing resources that will be used to
    -- host your game servers, including CPU, memory, storage, and networking
    -- capacity. See
    -- <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>
    -- for detailed descriptions of EC2 instance types.
    CreateFleet -> EC2InstanceType
eC2InstanceType :: EC2InstanceType
  }
  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:
--
-- 'serverLaunchParameters', 'createFleet_serverLaunchParameters' - __This parameter is no longer used.__ Specify server launch parameters
-- using the @RuntimeConfiguration@ parameter. Requests that use this
-- parameter instead continue to be valid.
--
-- 'logPaths', 'createFleet_logPaths' - __This parameter is no longer used.__ To specify where GameLift should
-- store log files once a server process shuts down, use the GameLift
-- server API @ProcessReady()@ and specify one or more directory paths in
-- @logParameters@. See more information in the
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api-ref.html#gamelift-sdk-server-api-ref-dataypes-process Server API Reference>.
--
-- 'peerVpcId', 'createFleet_peerVpcId' - A unique identifier for a VPC with resources to be accessed by your
-- GameLift fleet. The VPC must be in the same Region as your fleet. To
-- look up a VPC ID, use the
-- <https://console.aws.amazon.com/vpc/ VPC Dashboard> in the AWS
-- Management Console. Learn more about VPC peering in
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
--
-- 'buildId', 'createFleet_buildId' - The unique identifier for a custom game server build to be deployed on
-- fleet instances. You can use either the build ID or ARN. The build must
-- be uploaded to GameLift and in @READY@ status. This fleet property
-- cannot be changed later.
--
-- 'fleetType', 'createFleet_fleetType' - Indicates whether to use On-Demand or Spot instances for this fleet. By
-- default, this property is set to @ON_DEMAND@. Learn more about when to
-- use
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot On-Demand versus Spot Instances>.
-- This property cannot be changed after the fleet is created.
--
-- 'peerVpcAwsAccountId', 'createFleet_peerVpcAwsAccountId' - Used when peering your GameLift fleet with a VPC, the unique identifier
-- for the AWS account that owns the VPC. You can find your account ID in
-- the AWS Management Console under account settings.
--
-- 'eC2InboundPermissions', 'createFleet_eC2InboundPermissions' - The allowed IP address ranges and port settings that allow inbound
-- traffic to access game sessions on this fleet. If the fleet is hosting a
-- custom game build, this property must be set before players can connect
-- to game sessions. For Realtime Servers fleets, GameLift automatically
-- sets TCP and UDP ranges.
--
-- 'runtimeConfiguration', 'createFleet_runtimeConfiguration' - Instructions for how to launch and maintain server processes on
-- instances in the fleet. The runtime configuration defines one or more
-- server process configurations, each identifying a build executable or
-- Realtime script file and the number of processes of that type to run
-- concurrently.
--
-- The @RuntimeConfiguration@ parameter is required unless the fleet is
-- being configured using the older parameters @ServerLaunchPath@ and
-- @ServerLaunchParameters@, which are still supported for backward
-- compatibility.
--
-- 'newGameSessionProtectionPolicy'', 'createFleet_newGameSessionProtectionPolicy' - The status of termination protection for active game sessions on the
-- fleet. By default, this property is set to @NoProtection@. You can also
-- set game session protection for an individual game session by calling
-- UpdateGameSession.
--
-- -   __NoProtection__ - Game sessions can be terminated during active
--     gameplay as a result of a scale-down event.
--
-- -   __FullProtection__ - Game sessions in @ACTIVE@ status cannot be
--     terminated during a scale-down event.
--
-- 'scriptId', 'createFleet_scriptId' - The unique identifier for a Realtime configuration script to be deployed
-- on fleet instances. You can use either the script ID or ARN. Scripts
-- must be uploaded to GameLift prior to creating the fleet. This fleet
-- property cannot be changed later.
--
-- 'certificateConfiguration', 'createFleet_certificateConfiguration' - Prompts GameLift to generate a TLS\/SSL certificate for the fleet. TLS
-- certificates are used for encrypting traffic between game clients and
-- the game servers that are running on GameLift. By default, the
-- @CertificateConfiguration@ is set to @DISABLED@. Learn more at
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-howitworks.html#gamelift-howitworks-security Securing Client\/Server Communication>.
-- This property cannot be changed after the fleet is created.
--
-- Note: This feature requires the AWS Certificate Manager (ACM) service,
-- which is not available in all AWS regions. When working in a region that
-- does not support this feature, a fleet creation request with certificate
-- generation fails with a 4xx error.
--
-- 'serverLaunchPath', 'createFleet_serverLaunchPath' - __This parameter is no longer used.__ Specify a server launch path using
-- the @RuntimeConfiguration@ parameter. Requests that use this parameter
-- instead continue to be valid.
--
-- 'instanceRoleArn', 'createFleet_instanceRoleArn' - A unique identifier for an AWS IAM role that manages access to your AWS
-- services. With an instance role ARN set, any application that runs on an
-- instance in this fleet can assume the role, including install scripts,
-- server processes, and daemons (background processes). Create a role or
-- look up a role\'s ARN by using the
-- <https://console.aws.amazon.com/iam/ IAM dashboard> in the AWS
-- Management Console. Learn more about using on-box credentials for your
-- game servers at
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html Access external resources from a game server>.
-- This property cannot be changed after the fleet is created.
--
-- 'metricGroups', 'createFleet_metricGroups' - The name of an AWS CloudWatch metric group to add this fleet to. A
-- metric group is used to aggregate the metrics for multiple fleets. You
-- can specify an existing metric group name or set a new name to create a
-- new metric group. A fleet can be included in only one metric group at a
-- time.
--
-- 'description', 'createFleet_description' - A human-readable description of the fleet.
--
-- 'resourceCreationLimitPolicy', 'createFleet_resourceCreationLimitPolicy' - A policy that limits the number of game sessions that an individual
-- player can create on instances in this fleet within a specified span of
-- time.
--
-- 'locations', 'createFleet_locations' - A set of remote locations to deploy additional instances to and manage
-- as part of the fleet. This parameter can only be used when creating
-- fleets in AWS Regions that support multiple locations. You can add any
-- GameLift-supported AWS Region as a remote location, in the form of an
-- AWS Region code such as @us-west-2@. To create a fleet with instances in
-- the home Region only, omit this parameter.
--
-- 'tags', 'createFleet_tags' - A list of labels to assign to the new fleet resource. Tags are
-- developer-defined key-value pairs. Tagging AWS resources are useful for
-- resource management, access management and cost allocation. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- in the /AWS General Reference/. Once the fleet is created, you can use
-- TagResource, UntagResource, and ListTagsForResource to add, remove, and
-- view tags. The maximum tag limit may be lower than stated. See the /AWS
-- General Reference/ for actual tagging limits.
--
-- 'name', 'createFleet_name' - A descriptive label that is associated with a fleet. Fleet names do not
-- need to be unique.
--
-- 'eC2InstanceType', 'createFleet_eC2InstanceType' - The GameLift-supported EC2 instance type to use for all fleet instances.
-- Instance type determines the computing resources that will be used to
-- host your game servers, including CPU, memory, storage, and networking
-- capacity. See
-- <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>
-- for detailed descriptions of EC2 instance types.
newCreateFleet ::
  -- | 'name'
  Prelude.Text ->
  -- | 'eC2InstanceType'
  EC2InstanceType ->
  CreateFleet
newCreateFleet :: Text -> EC2InstanceType -> CreateFleet
newCreateFleet Text
pName_ EC2InstanceType
pEC2InstanceType_ =
  CreateFleet' :: Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe FleetType
-> Maybe Text
-> Maybe [IpPermission]
-> Maybe RuntimeConfiguration
-> Maybe ProtectionPolicy
-> Maybe Text
-> Maybe CertificateConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe ResourceCreationLimitPolicy
-> Maybe (NonEmpty LocationConfiguration)
-> Maybe [Tag]
-> Text
-> EC2InstanceType
-> CreateFleet
CreateFleet'
    { $sel:serverLaunchParameters:CreateFleet' :: Maybe Text
serverLaunchParameters =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:logPaths:CreateFleet' :: Maybe [Text]
logPaths = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:peerVpcId:CreateFleet' :: Maybe Text
peerVpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:buildId:CreateFleet' :: Maybe Text
buildId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetType:CreateFleet' :: Maybe FleetType
fleetType = Maybe FleetType
forall a. Maybe a
Prelude.Nothing,
      $sel:peerVpcAwsAccountId:CreateFleet' :: Maybe Text
peerVpcAwsAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eC2InboundPermissions:CreateFleet' :: Maybe [IpPermission]
eC2InboundPermissions = Maybe [IpPermission]
forall a. Maybe a
Prelude.Nothing,
      $sel:runtimeConfiguration:CreateFleet' :: Maybe RuntimeConfiguration
runtimeConfiguration = Maybe RuntimeConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:newGameSessionProtectionPolicy':CreateFleet' :: Maybe ProtectionPolicy
newGameSessionProtectionPolicy' = Maybe ProtectionPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:scriptId:CreateFleet' :: Maybe Text
scriptId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateConfiguration:CreateFleet' :: Maybe CertificateConfiguration
certificateConfiguration = Maybe CertificateConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:serverLaunchPath:CreateFleet' :: Maybe Text
serverLaunchPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRoleArn:CreateFleet' :: Maybe Text
instanceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:metricGroups:CreateFleet' :: Maybe [Text]
metricGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateFleet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceCreationLimitPolicy:CreateFleet' :: Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy = Maybe ResourceCreationLimitPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:locations:CreateFleet' :: Maybe (NonEmpty LocationConfiguration)
locations = Maybe (NonEmpty LocationConfiguration)
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateFleet' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateFleet' :: Text
name = Text
pName_,
      $sel:eC2InstanceType:CreateFleet' :: EC2InstanceType
eC2InstanceType = EC2InstanceType
pEC2InstanceType_
    }

-- | __This parameter is no longer used.__ Specify server launch parameters
-- using the @RuntimeConfiguration@ parameter. Requests that use this
-- parameter instead continue to be valid.
createFleet_serverLaunchParameters :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_serverLaunchParameters :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_serverLaunchParameters = (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
serverLaunchParameters :: Maybe Text
$sel:serverLaunchParameters:CreateFleet' :: CreateFleet -> Maybe Text
serverLaunchParameters} -> Maybe Text
serverLaunchParameters) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:serverLaunchParameters:CreateFleet' :: Maybe Text
serverLaunchParameters = Maybe Text
a} :: CreateFleet)

-- | __This parameter is no longer used.__ To specify where GameLift should
-- store log files once a server process shuts down, use the GameLift
-- server API @ProcessReady()@ and specify one or more directory paths in
-- @logParameters@. See more information in the
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api-ref.html#gamelift-sdk-server-api-ref-dataypes-process Server API Reference>.
createFleet_logPaths :: Lens.Lens' CreateFleet (Prelude.Maybe [Prelude.Text])
createFleet_logPaths :: (Maybe [Text] -> f (Maybe [Text])) -> CreateFleet -> f CreateFleet
createFleet_logPaths = (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]
logPaths :: Maybe [Text]
$sel:logPaths:CreateFleet' :: CreateFleet -> Maybe [Text]
logPaths} -> Maybe [Text]
logPaths) (\s :: CreateFleet
s@CreateFleet' {} Maybe [Text]
a -> CreateFleet
s {$sel:logPaths:CreateFleet' :: Maybe [Text]
logPaths = Maybe [Text]
a} :: CreateFleet) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateFleet -> f CreateFleet)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateFleet
-> f CreateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A unique identifier for a VPC with resources to be accessed by your
-- GameLift fleet. The VPC must be in the same Region as your fleet. To
-- look up a VPC ID, use the
-- <https://console.aws.amazon.com/vpc/ VPC Dashboard> in the AWS
-- Management Console. Learn more about VPC peering in
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
createFleet_peerVpcId :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_peerVpcId :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_peerVpcId = (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
peerVpcId :: Maybe Text
$sel:peerVpcId:CreateFleet' :: CreateFleet -> Maybe Text
peerVpcId} -> Maybe Text
peerVpcId) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:peerVpcId:CreateFleet' :: Maybe Text
peerVpcId = Maybe Text
a} :: CreateFleet)

-- | The unique identifier for a custom game server build to be deployed on
-- fleet instances. You can use either the build ID or ARN. The build must
-- be uploaded to GameLift and in @READY@ status. This fleet property
-- cannot be changed later.
createFleet_buildId :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_buildId :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_buildId = (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
buildId :: Maybe Text
$sel:buildId:CreateFleet' :: CreateFleet -> Maybe Text
buildId} -> Maybe Text
buildId) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:buildId:CreateFleet' :: Maybe Text
buildId = Maybe Text
a} :: CreateFleet)

-- | Indicates whether to use On-Demand or Spot instances for this fleet. By
-- default, this property is set to @ON_DEMAND@. Learn more about when to
-- use
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot On-Demand versus Spot Instances>.
-- This property cannot be changed after the fleet is created.
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)

-- | Used when peering your GameLift fleet with a VPC, the unique identifier
-- for the AWS account that owns the VPC. You can find your account ID in
-- the AWS Management Console under account settings.
createFleet_peerVpcAwsAccountId :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_peerVpcAwsAccountId :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_peerVpcAwsAccountId = (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
peerVpcAwsAccountId :: Maybe Text
$sel:peerVpcAwsAccountId:CreateFleet' :: CreateFleet -> Maybe Text
peerVpcAwsAccountId} -> Maybe Text
peerVpcAwsAccountId) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:peerVpcAwsAccountId:CreateFleet' :: Maybe Text
peerVpcAwsAccountId = Maybe Text
a} :: CreateFleet)

-- | The allowed IP address ranges and port settings that allow inbound
-- traffic to access game sessions on this fleet. If the fleet is hosting a
-- custom game build, this property must be set before players can connect
-- to game sessions. For Realtime Servers fleets, GameLift automatically
-- sets TCP and UDP ranges.
createFleet_eC2InboundPermissions :: Lens.Lens' CreateFleet (Prelude.Maybe [IpPermission])
createFleet_eC2InboundPermissions :: (Maybe [IpPermission] -> f (Maybe [IpPermission]))
-> CreateFleet -> f CreateFleet
createFleet_eC2InboundPermissions = (CreateFleet -> Maybe [IpPermission])
-> (CreateFleet -> Maybe [IpPermission] -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe [IpPermission])
     (Maybe [IpPermission])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe [IpPermission]
eC2InboundPermissions :: Maybe [IpPermission]
$sel:eC2InboundPermissions:CreateFleet' :: CreateFleet -> Maybe [IpPermission]
eC2InboundPermissions} -> Maybe [IpPermission]
eC2InboundPermissions) (\s :: CreateFleet
s@CreateFleet' {} Maybe [IpPermission]
a -> CreateFleet
s {$sel:eC2InboundPermissions:CreateFleet' :: Maybe [IpPermission]
eC2InboundPermissions = Maybe [IpPermission]
a} :: CreateFleet) ((Maybe [IpPermission] -> f (Maybe [IpPermission]))
 -> CreateFleet -> f CreateFleet)
-> ((Maybe [IpPermission] -> f (Maybe [IpPermission]))
    -> Maybe [IpPermission] -> f (Maybe [IpPermission]))
-> (Maybe [IpPermission] -> f (Maybe [IpPermission]))
-> CreateFleet
-> f CreateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IpPermission] [IpPermission] [IpPermission] [IpPermission]
-> Iso
     (Maybe [IpPermission])
     (Maybe [IpPermission])
     (Maybe [IpPermission])
     (Maybe [IpPermission])
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 [IpPermission] [IpPermission] [IpPermission] [IpPermission]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Instructions for how to launch and maintain server processes on
-- instances in the fleet. The runtime configuration defines one or more
-- server process configurations, each identifying a build executable or
-- Realtime script file and the number of processes of that type to run
-- concurrently.
--
-- The @RuntimeConfiguration@ parameter is required unless the fleet is
-- being configured using the older parameters @ServerLaunchPath@ and
-- @ServerLaunchParameters@, which are still supported for backward
-- compatibility.
createFleet_runtimeConfiguration :: Lens.Lens' CreateFleet (Prelude.Maybe RuntimeConfiguration)
createFleet_runtimeConfiguration :: (Maybe RuntimeConfiguration -> f (Maybe RuntimeConfiguration))
-> CreateFleet -> f CreateFleet
createFleet_runtimeConfiguration = (CreateFleet -> Maybe RuntimeConfiguration)
-> (CreateFleet -> Maybe RuntimeConfiguration -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe RuntimeConfiguration)
     (Maybe RuntimeConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe RuntimeConfiguration
runtimeConfiguration :: Maybe RuntimeConfiguration
$sel:runtimeConfiguration:CreateFleet' :: CreateFleet -> Maybe RuntimeConfiguration
runtimeConfiguration} -> Maybe RuntimeConfiguration
runtimeConfiguration) (\s :: CreateFleet
s@CreateFleet' {} Maybe RuntimeConfiguration
a -> CreateFleet
s {$sel:runtimeConfiguration:CreateFleet' :: Maybe RuntimeConfiguration
runtimeConfiguration = Maybe RuntimeConfiguration
a} :: CreateFleet)

-- | The status of termination protection for active game sessions on the
-- fleet. By default, this property is set to @NoProtection@. You can also
-- set game session protection for an individual game session by calling
-- UpdateGameSession.
--
-- -   __NoProtection__ - Game sessions can be terminated during active
--     gameplay as a result of a scale-down event.
--
-- -   __FullProtection__ - Game sessions in @ACTIVE@ status cannot be
--     terminated during a scale-down event.
createFleet_newGameSessionProtectionPolicy :: Lens.Lens' CreateFleet (Prelude.Maybe ProtectionPolicy)
createFleet_newGameSessionProtectionPolicy :: (Maybe ProtectionPolicy -> f (Maybe ProtectionPolicy))
-> CreateFleet -> f CreateFleet
createFleet_newGameSessionProtectionPolicy = (CreateFleet -> Maybe ProtectionPolicy)
-> (CreateFleet -> Maybe ProtectionPolicy -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe ProtectionPolicy)
     (Maybe ProtectionPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe ProtectionPolicy
newGameSessionProtectionPolicy' :: Maybe ProtectionPolicy
$sel:newGameSessionProtectionPolicy':CreateFleet' :: CreateFleet -> Maybe ProtectionPolicy
newGameSessionProtectionPolicy'} -> Maybe ProtectionPolicy
newGameSessionProtectionPolicy') (\s :: CreateFleet
s@CreateFleet' {} Maybe ProtectionPolicy
a -> CreateFleet
s {$sel:newGameSessionProtectionPolicy':CreateFleet' :: Maybe ProtectionPolicy
newGameSessionProtectionPolicy' = Maybe ProtectionPolicy
a} :: CreateFleet)

-- | The unique identifier for a Realtime configuration script to be deployed
-- on fleet instances. You can use either the script ID or ARN. Scripts
-- must be uploaded to GameLift prior to creating the fleet. This fleet
-- property cannot be changed later.
createFleet_scriptId :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_scriptId :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_scriptId = (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
scriptId :: Maybe Text
$sel:scriptId:CreateFleet' :: CreateFleet -> Maybe Text
scriptId} -> Maybe Text
scriptId) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:scriptId:CreateFleet' :: Maybe Text
scriptId = Maybe Text
a} :: CreateFleet)

-- | Prompts GameLift to generate a TLS\/SSL certificate for the fleet. TLS
-- certificates are used for encrypting traffic between game clients and
-- the game servers that are running on GameLift. By default, the
-- @CertificateConfiguration@ is set to @DISABLED@. Learn more at
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-howitworks.html#gamelift-howitworks-security Securing Client\/Server Communication>.
-- This property cannot be changed after the fleet is created.
--
-- Note: This feature requires the AWS Certificate Manager (ACM) service,
-- which is not available in all AWS regions. When working in a region that
-- does not support this feature, a fleet creation request with certificate
-- generation fails with a 4xx error.
createFleet_certificateConfiguration :: Lens.Lens' CreateFleet (Prelude.Maybe CertificateConfiguration)
createFleet_certificateConfiguration :: (Maybe CertificateConfiguration
 -> f (Maybe CertificateConfiguration))
-> CreateFleet -> f CreateFleet
createFleet_certificateConfiguration = (CreateFleet -> Maybe CertificateConfiguration)
-> (CreateFleet -> Maybe CertificateConfiguration -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe CertificateConfiguration)
     (Maybe CertificateConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe CertificateConfiguration
certificateConfiguration :: Maybe CertificateConfiguration
$sel:certificateConfiguration:CreateFleet' :: CreateFleet -> Maybe CertificateConfiguration
certificateConfiguration} -> Maybe CertificateConfiguration
certificateConfiguration) (\s :: CreateFleet
s@CreateFleet' {} Maybe CertificateConfiguration
a -> CreateFleet
s {$sel:certificateConfiguration:CreateFleet' :: Maybe CertificateConfiguration
certificateConfiguration = Maybe CertificateConfiguration
a} :: CreateFleet)

-- | __This parameter is no longer used.__ Specify a server launch path using
-- the @RuntimeConfiguration@ parameter. Requests that use this parameter
-- instead continue to be valid.
createFleet_serverLaunchPath :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_serverLaunchPath :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_serverLaunchPath = (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
serverLaunchPath :: Maybe Text
$sel:serverLaunchPath:CreateFleet' :: CreateFleet -> Maybe Text
serverLaunchPath} -> Maybe Text
serverLaunchPath) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:serverLaunchPath:CreateFleet' :: Maybe Text
serverLaunchPath = Maybe Text
a} :: CreateFleet)

-- | A unique identifier for an AWS IAM role that manages access to your AWS
-- services. With an instance role ARN set, any application that runs on an
-- instance in this fleet can assume the role, including install scripts,
-- server processes, and daemons (background processes). Create a role or
-- look up a role\'s ARN by using the
-- <https://console.aws.amazon.com/iam/ IAM dashboard> in the AWS
-- Management Console. Learn more about using on-box credentials for your
-- game servers at
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html Access external resources from a game server>.
-- This property cannot be changed after the fleet is created.
createFleet_instanceRoleArn :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_instanceRoleArn :: (Maybe Text -> f (Maybe Text)) -> CreateFleet -> f CreateFleet
createFleet_instanceRoleArn = (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
instanceRoleArn :: Maybe Text
$sel:instanceRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
instanceRoleArn} -> Maybe Text
instanceRoleArn) (\s :: CreateFleet
s@CreateFleet' {} Maybe Text
a -> CreateFleet
s {$sel:instanceRoleArn:CreateFleet' :: Maybe Text
instanceRoleArn = Maybe Text
a} :: CreateFleet)

-- | The name of an AWS CloudWatch metric group to add this fleet to. A
-- metric group is used to aggregate the metrics for multiple fleets. You
-- can specify an existing metric group name or set a new name to create a
-- new metric group. A fleet can be included in only one metric group at a
-- time.
createFleet_metricGroups :: Lens.Lens' CreateFleet (Prelude.Maybe [Prelude.Text])
createFleet_metricGroups :: (Maybe [Text] -> f (Maybe [Text])) -> CreateFleet -> f CreateFleet
createFleet_metricGroups = (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]
metricGroups :: Maybe [Text]
$sel:metricGroups:CreateFleet' :: CreateFleet -> Maybe [Text]
metricGroups} -> Maybe [Text]
metricGroups) (\s :: CreateFleet
s@CreateFleet' {} Maybe [Text]
a -> CreateFleet
s {$sel:metricGroups:CreateFleet' :: Maybe [Text]
metricGroups = Maybe [Text]
a} :: CreateFleet) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateFleet -> f CreateFleet)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateFleet
-> f CreateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A human-readable description of the fleet.
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)

-- | A policy that limits the number of game sessions that an individual
-- player can create on instances in this fleet within a specified span of
-- time.
createFleet_resourceCreationLimitPolicy :: Lens.Lens' CreateFleet (Prelude.Maybe ResourceCreationLimitPolicy)
createFleet_resourceCreationLimitPolicy :: (Maybe ResourceCreationLimitPolicy
 -> f (Maybe ResourceCreationLimitPolicy))
-> CreateFleet -> f CreateFleet
createFleet_resourceCreationLimitPolicy = (CreateFleet -> Maybe ResourceCreationLimitPolicy)
-> (CreateFleet
    -> Maybe ResourceCreationLimitPolicy -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe ResourceCreationLimitPolicy)
     (Maybe ResourceCreationLimitPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy :: Maybe ResourceCreationLimitPolicy
$sel:resourceCreationLimitPolicy:CreateFleet' :: CreateFleet -> Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy} -> Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy) (\s :: CreateFleet
s@CreateFleet' {} Maybe ResourceCreationLimitPolicy
a -> CreateFleet
s {$sel:resourceCreationLimitPolicy:CreateFleet' :: Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy = Maybe ResourceCreationLimitPolicy
a} :: CreateFleet)

-- | A set of remote locations to deploy additional instances to and manage
-- as part of the fleet. This parameter can only be used when creating
-- fleets in AWS Regions that support multiple locations. You can add any
-- GameLift-supported AWS Region as a remote location, in the form of an
-- AWS Region code such as @us-west-2@. To create a fleet with instances in
-- the home Region only, omit this parameter.
createFleet_locations :: Lens.Lens' CreateFleet (Prelude.Maybe (Prelude.NonEmpty LocationConfiguration))
createFleet_locations :: (Maybe (NonEmpty LocationConfiguration)
 -> f (Maybe (NonEmpty LocationConfiguration)))
-> CreateFleet -> f CreateFleet
createFleet_locations = (CreateFleet -> Maybe (NonEmpty LocationConfiguration))
-> (CreateFleet
    -> Maybe (NonEmpty LocationConfiguration) -> CreateFleet)
-> Lens
     CreateFleet
     CreateFleet
     (Maybe (NonEmpty LocationConfiguration))
     (Maybe (NonEmpty LocationConfiguration))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe (NonEmpty LocationConfiguration)
locations :: Maybe (NonEmpty LocationConfiguration)
$sel:locations:CreateFleet' :: CreateFleet -> Maybe (NonEmpty LocationConfiguration)
locations} -> Maybe (NonEmpty LocationConfiguration)
locations) (\s :: CreateFleet
s@CreateFleet' {} Maybe (NonEmpty LocationConfiguration)
a -> CreateFleet
s {$sel:locations:CreateFleet' :: Maybe (NonEmpty LocationConfiguration)
locations = Maybe (NonEmpty LocationConfiguration)
a} :: CreateFleet) ((Maybe (NonEmpty LocationConfiguration)
  -> f (Maybe (NonEmpty LocationConfiguration)))
 -> CreateFleet -> f CreateFleet)
-> ((Maybe (NonEmpty LocationConfiguration)
     -> f (Maybe (NonEmpty LocationConfiguration)))
    -> Maybe (NonEmpty LocationConfiguration)
    -> f (Maybe (NonEmpty LocationConfiguration)))
-> (Maybe (NonEmpty LocationConfiguration)
    -> f (Maybe (NonEmpty LocationConfiguration)))
-> CreateFleet
-> f CreateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty LocationConfiguration)
  (NonEmpty LocationConfiguration)
  (NonEmpty LocationConfiguration)
  (NonEmpty LocationConfiguration)
-> Iso
     (Maybe (NonEmpty LocationConfiguration))
     (Maybe (NonEmpty LocationConfiguration))
     (Maybe (NonEmpty LocationConfiguration))
     (Maybe (NonEmpty LocationConfiguration))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty LocationConfiguration)
  (NonEmpty LocationConfiguration)
  (NonEmpty LocationConfiguration)
  (NonEmpty LocationConfiguration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A list of labels to assign to the new fleet resource. Tags are
-- developer-defined key-value pairs. Tagging AWS resources are useful for
-- resource management, access management and cost allocation. For more
-- information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging AWS Resources>
-- in the /AWS General Reference/. Once the fleet is created, you can use
-- TagResource, UntagResource, and ListTagsForResource to add, remove, and
-- view tags. The maximum tag limit may be lower than stated. See the /AWS
-- General Reference/ for actual tagging limits.
createFleet_tags :: Lens.Lens' CreateFleet (Prelude.Maybe [Tag])
createFleet_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateFleet -> f CreateFleet
createFleet_tags = (CreateFleet -> Maybe [Tag])
-> (CreateFleet -> Maybe [Tag] -> CreateFleet)
-> Lens CreateFleet CreateFleet (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateFleet' :: CreateFleet -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateFleet
s@CreateFleet' {} Maybe [Tag]
a -> CreateFleet
s {$sel:tags:CreateFleet' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateFleet) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateFleet -> f CreateFleet)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateFleet
-> f CreateFleet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A descriptive label that is associated with a fleet. Fleet names do not
-- need to be unique.
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 GameLift-supported EC2 instance type to use for all fleet instances.
-- Instance type determines the computing resources that will be used to
-- host your game servers, including CPU, memory, storage, and networking
-- capacity. See
-- <http://aws.amazon.com/ec2/instance-types/ Amazon EC2 Instance Types>
-- for detailed descriptions of EC2 instance types.
createFleet_eC2InstanceType :: Lens.Lens' CreateFleet EC2InstanceType
createFleet_eC2InstanceType :: (EC2InstanceType -> f EC2InstanceType)
-> CreateFleet -> f CreateFleet
createFleet_eC2InstanceType = (CreateFleet -> EC2InstanceType)
-> (CreateFleet -> EC2InstanceType -> CreateFleet)
-> Lens CreateFleet CreateFleet EC2InstanceType EC2InstanceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {EC2InstanceType
eC2InstanceType :: EC2InstanceType
$sel:eC2InstanceType:CreateFleet' :: CreateFleet -> EC2InstanceType
eC2InstanceType} -> EC2InstanceType
eC2InstanceType) (\s :: CreateFleet
s@CreateFleet' {} EC2InstanceType
a -> CreateFleet
s {$sel:eC2InstanceType:CreateFleet' :: EC2InstanceType
eC2InstanceType = EC2InstanceType
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 [LocationState]
-> Maybe FleetAttributes -> Int -> CreateFleetResponse
CreateFleetResponse'
            (Maybe [LocationState]
 -> Maybe FleetAttributes -> Int -> CreateFleetResponse)
-> Either String (Maybe [LocationState])
-> Either
     String (Maybe FleetAttributes -> Int -> CreateFleetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [LocationState]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LocationStates" Either String (Maybe (Maybe [LocationState]))
-> Maybe [LocationState] -> Either String (Maybe [LocationState])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LocationState]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe FleetAttributes -> Int -> CreateFleetResponse)
-> Either String (Maybe FleetAttributes)
-> Either String (Int -> CreateFleetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe FleetAttributes)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FleetAttributes")
            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
"GameLift.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 [Text]
Maybe [IpPermission]
Maybe [Tag]
Maybe (NonEmpty LocationConfiguration)
Maybe Text
Maybe CertificateConfiguration
Maybe FleetType
Maybe ProtectionPolicy
Maybe ResourceCreationLimitPolicy
Maybe RuntimeConfiguration
Text
EC2InstanceType
eC2InstanceType :: EC2InstanceType
name :: Text
tags :: Maybe [Tag]
locations :: Maybe (NonEmpty LocationConfiguration)
resourceCreationLimitPolicy :: Maybe ResourceCreationLimitPolicy
description :: Maybe Text
metricGroups :: Maybe [Text]
instanceRoleArn :: Maybe Text
serverLaunchPath :: Maybe Text
certificateConfiguration :: Maybe CertificateConfiguration
scriptId :: Maybe Text
newGameSessionProtectionPolicy' :: Maybe ProtectionPolicy
runtimeConfiguration :: Maybe RuntimeConfiguration
eC2InboundPermissions :: Maybe [IpPermission]
peerVpcAwsAccountId :: Maybe Text
fleetType :: Maybe FleetType
buildId :: Maybe Text
peerVpcId :: Maybe Text
logPaths :: Maybe [Text]
serverLaunchParameters :: Maybe Text
$sel:eC2InstanceType:CreateFleet' :: CreateFleet -> EC2InstanceType
$sel:name:CreateFleet' :: CreateFleet -> Text
$sel:tags:CreateFleet' :: CreateFleet -> Maybe [Tag]
$sel:locations:CreateFleet' :: CreateFleet -> Maybe (NonEmpty LocationConfiguration)
$sel:resourceCreationLimitPolicy:CreateFleet' :: CreateFleet -> Maybe ResourceCreationLimitPolicy
$sel:description:CreateFleet' :: CreateFleet -> Maybe Text
$sel:metricGroups:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:instanceRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
$sel:serverLaunchPath:CreateFleet' :: CreateFleet -> Maybe Text
$sel:certificateConfiguration:CreateFleet' :: CreateFleet -> Maybe CertificateConfiguration
$sel:scriptId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:newGameSessionProtectionPolicy':CreateFleet' :: CreateFleet -> Maybe ProtectionPolicy
$sel:runtimeConfiguration:CreateFleet' :: CreateFleet -> Maybe RuntimeConfiguration
$sel:eC2InboundPermissions:CreateFleet' :: CreateFleet -> Maybe [IpPermission]
$sel:peerVpcAwsAccountId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:fleetType:CreateFleet' :: CreateFleet -> Maybe FleetType
$sel:buildId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:peerVpcId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:logPaths:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:serverLaunchParameters:CreateFleet' :: CreateFleet -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServerLaunchParameters" 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
serverLaunchParameters,
            (Text
"LogPaths" 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]
logPaths,
            (Text
"PeerVpcId" 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
peerVpcId,
            (Text
"BuildId" 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
buildId,
            (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
"PeerVpcAwsAccountId" 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
peerVpcAwsAccountId,
            (Text
"EC2InboundPermissions" Text -> [IpPermission] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([IpPermission] -> Pair) -> Maybe [IpPermission] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IpPermission]
eC2InboundPermissions,
            (Text
"RuntimeConfiguration" Text -> RuntimeConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RuntimeConfiguration -> Pair)
-> Maybe RuntimeConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RuntimeConfiguration
runtimeConfiguration,
            (Text
"NewGameSessionProtectionPolicy" Text -> ProtectionPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ProtectionPolicy -> Pair) -> Maybe ProtectionPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProtectionPolicy
newGameSessionProtectionPolicy',
            (Text
"ScriptId" 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
scriptId,
            (Text
"CertificateConfiguration" Text -> CertificateConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CertificateConfiguration -> Pair)
-> Maybe CertificateConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CertificateConfiguration
certificateConfiguration,
            (Text
"ServerLaunchPath" 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
serverLaunchPath,
            (Text
"InstanceRoleArn" 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
instanceRoleArn,
            (Text
"MetricGroups" 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]
metricGroups,
            (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
"ResourceCreationLimitPolicy" Text -> ResourceCreationLimitPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ResourceCreationLimitPolicy -> Pair)
-> Maybe ResourceCreationLimitPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy,
            (Text
"Locations" Text -> NonEmpty LocationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty LocationConfiguration -> Pair)
-> Maybe (NonEmpty LocationConfiguration) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty LocationConfiguration)
locations,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"EC2InstanceType" Text -> EC2InstanceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EC2InstanceType
eC2InstanceType)
          ]
      )

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

-- | Represents the returned data in response to a request operation.
--
-- /See:/ 'newCreateFleetResponse' smart constructor.
data CreateFleetResponse = CreateFleetResponse'
  { -- | The fleet\'s locations and life-cycle status of each location. For new
    -- fleets, the status of all locations is set to @NEW@. During fleet
    -- creation, GameLift updates each location status as instances are
    -- deployed there and prepared for game hosting. This list includes an
    -- entry for the fleet\'s home Region. For fleets with no remote locations,
    -- only one entry, representing the home Region, is returned.
    CreateFleetResponse -> Maybe [LocationState]
locationStates :: Prelude.Maybe [LocationState],
    -- | The properties for the new fleet, including the current status. All
    -- fleets are placed in @NEW@ status on creation.
    CreateFleetResponse -> Maybe FleetAttributes
fleetAttributes :: Prelude.Maybe FleetAttributes,
    -- | 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:
--
-- 'locationStates', 'createFleetResponse_locationStates' - The fleet\'s locations and life-cycle status of each location. For new
-- fleets, the status of all locations is set to @NEW@. During fleet
-- creation, GameLift updates each location status as instances are
-- deployed there and prepared for game hosting. This list includes an
-- entry for the fleet\'s home Region. For fleets with no remote locations,
-- only one entry, representing the home Region, is returned.
--
-- 'fleetAttributes', 'createFleetResponse_fleetAttributes' - The properties for the new fleet, including the current status. All
-- fleets are placed in @NEW@ status on creation.
--
-- 'httpStatus', 'createFleetResponse_httpStatus' - The response's http status code.
newCreateFleetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFleetResponse
newCreateFleetResponse :: Int -> CreateFleetResponse
newCreateFleetResponse Int
pHttpStatus_ =
  CreateFleetResponse' :: Maybe [LocationState]
-> Maybe FleetAttributes -> Int -> CreateFleetResponse
CreateFleetResponse'
    { $sel:locationStates:CreateFleetResponse' :: Maybe [LocationState]
locationStates =
        Maybe [LocationState]
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetAttributes:CreateFleetResponse' :: Maybe FleetAttributes
fleetAttributes = Maybe FleetAttributes
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFleetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The fleet\'s locations and life-cycle status of each location. For new
-- fleets, the status of all locations is set to @NEW@. During fleet
-- creation, GameLift updates each location status as instances are
-- deployed there and prepared for game hosting. This list includes an
-- entry for the fleet\'s home Region. For fleets with no remote locations,
-- only one entry, representing the home Region, is returned.
createFleetResponse_locationStates :: Lens.Lens' CreateFleetResponse (Prelude.Maybe [LocationState])
createFleetResponse_locationStates :: (Maybe [LocationState] -> f (Maybe [LocationState]))
-> CreateFleetResponse -> f CreateFleetResponse
createFleetResponse_locationStates = (CreateFleetResponse -> Maybe [LocationState])
-> (CreateFleetResponse
    -> Maybe [LocationState] -> CreateFleetResponse)
-> Lens
     CreateFleetResponse
     CreateFleetResponse
     (Maybe [LocationState])
     (Maybe [LocationState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetResponse' {Maybe [LocationState]
locationStates :: Maybe [LocationState]
$sel:locationStates:CreateFleetResponse' :: CreateFleetResponse -> Maybe [LocationState]
locationStates} -> Maybe [LocationState]
locationStates) (\s :: CreateFleetResponse
s@CreateFleetResponse' {} Maybe [LocationState]
a -> CreateFleetResponse
s {$sel:locationStates:CreateFleetResponse' :: Maybe [LocationState]
locationStates = Maybe [LocationState]
a} :: CreateFleetResponse) ((Maybe [LocationState] -> f (Maybe [LocationState]))
 -> CreateFleetResponse -> f CreateFleetResponse)
-> ((Maybe [LocationState] -> f (Maybe [LocationState]))
    -> Maybe [LocationState] -> f (Maybe [LocationState]))
-> (Maybe [LocationState] -> f (Maybe [LocationState]))
-> CreateFleetResponse
-> f CreateFleetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [LocationState] [LocationState] [LocationState] [LocationState]
-> Iso
     (Maybe [LocationState])
     (Maybe [LocationState])
     (Maybe [LocationState])
     (Maybe [LocationState])
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
  [LocationState] [LocationState] [LocationState] [LocationState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The properties for the new fleet, including the current status. All
-- fleets are placed in @NEW@ status on creation.
createFleetResponse_fleetAttributes :: Lens.Lens' CreateFleetResponse (Prelude.Maybe FleetAttributes)
createFleetResponse_fleetAttributes :: (Maybe FleetAttributes -> f (Maybe FleetAttributes))
-> CreateFleetResponse -> f CreateFleetResponse
createFleetResponse_fleetAttributes = (CreateFleetResponse -> Maybe FleetAttributes)
-> (CreateFleetResponse
    -> Maybe FleetAttributes -> CreateFleetResponse)
-> Lens
     CreateFleetResponse
     CreateFleetResponse
     (Maybe FleetAttributes)
     (Maybe FleetAttributes)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetResponse' {Maybe FleetAttributes
fleetAttributes :: Maybe FleetAttributes
$sel:fleetAttributes:CreateFleetResponse' :: CreateFleetResponse -> Maybe FleetAttributes
fleetAttributes} -> Maybe FleetAttributes
fleetAttributes) (\s :: CreateFleetResponse
s@CreateFleetResponse' {} Maybe FleetAttributes
a -> CreateFleetResponse
s {$sel:fleetAttributes:CreateFleetResponse' :: Maybe FleetAttributes
fleetAttributes = Maybe FleetAttributes
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