{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a fleet of Amazon Elastic Compute Cloud (Amazon Elastic Compute
-- Cloud) 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 Amazon
-- Web Services 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 you need to debug your fleet, fetch logs, view performance metrics or
-- other actions on the fleet, create the development fleet with port
-- 22\/3389 open. As a best practice, we recommend opening ports for remote
-- access only when you need them and closing them when you\'re finished.
--
-- 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>.
--
-- __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>
module Amazonka.GameLift.CreateFleet
  ( -- * Creating a Request
    CreateFleet (..),
    newCreateFleet,

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

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

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

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

-- | /See:/ 'newCreateFleet' smart constructor.
data CreateFleet = CreateFleet'
  { -- | GameLift Anywhere configuration options.
    CreateFleet -> Maybe AnywhereConfiguration
anywhereConfiguration :: Prelude.Maybe AnywhereConfiguration,
    -- | 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,
    -- | Prompts GameLift to generate a TLS\/SSL certificate for the fleet.
    -- GameLift uses the certificates to encrypt traffic between game clients
    -- and the game servers running on GameLift. By default, the
    -- @CertificateConfiguration@ is @DISABLED@. You can\'t change this
    -- property after you create the fleet.
    --
    -- Certificate Manager (ACM) certificates expire after 13 months.
    -- Certificate expiration can cause fleets to fail, preventing players from
    -- connecting to instances in the fleet. We recommend you replace fleets
    -- before 13 months, consider using fleet aliases for a smooth transition.
    --
    -- ACM isn\'t available in all Amazon Web Services regions. A fleet
    -- creation request with certificate generation enabled in an unsupported
    -- Region, fails with a 4xx error. For more information about the supported
    -- Regions, see
    -- <https://docs.aws.amazon.com/acm/latest/userguide/acm-regions.html Supported Regions>
    -- in the /Certificate Manager User Guide/.
    CreateFleet -> Maybe CertificateConfiguration
certificateConfiguration :: Prelude.Maybe CertificateConfiguration,
    -- | The type of compute resource used to host your game servers. You can use
    -- your own compute resources with GameLift Anywhere or use Amazon EC2
    -- instances with managed GameLift.
    CreateFleet -> Maybe ComputeType
computeType :: Prelude.Maybe ComputeType,
    -- | A description for the fleet.
    CreateFleet -> Maybe Text
description :: 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],
    -- | The GameLift-supported Amazon 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 Elastic Compute Cloud Instance Types>
    -- for detailed descriptions of Amazon EC2 instance types.
    CreateFleet -> Maybe EC2InstanceType
eC2InstanceType :: Prelude.Maybe EC2InstanceType,
    -- | 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,
    -- | A unique identifier for an IAM role that manages access to your Amazon
    -- Web Services 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 Amazon Web
    -- Services 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,
    -- | 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 Amazon Web Services Regions that support multiple locations.
    -- You can add any GameLift-supported Amazon Web Services Region as a
    -- remote location, in the form of an Amazon Web Services 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),
    -- | __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@. For more information, see
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-initialize Initialize the server process>
    -- in the /GameLift Developer Guide/.
    CreateFleet -> Maybe [Text]
logPaths :: Prelude.Maybe [Prelude.Text],
    -- | The name of an Amazon Web Services 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],
    -- | 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
    -- <gamelift/latest/apireference/API_UpdateGameSession.html 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,
    -- | Used when peering your GameLift fleet with a VPC, the unique identifier
    -- for the Amazon Web Services account that owns the VPC. You can find your
    -- account ID in the Amazon Web Services Management Console under account
    -- settings.
    CreateFleet -> Maybe Text
peerVpcAwsAccountId :: 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 Amazon Web
    -- Services 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,
    -- | 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,
    -- | 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 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,
    -- | __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.__ 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 list of labels to assign to the new fleet resource. Tags are
    -- developer-defined key-value pairs. Tagging Amazon Web Services 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 Amazon Web Services Resources>
    -- in the /Amazon Web Services General Reference/.
    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
  }
  deriving (CreateFleet -> CreateFleet -> Bool
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]
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
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. 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:
--
-- 'anywhereConfiguration', 'createFleet_anywhereConfiguration' - GameLift Anywhere configuration options.
--
-- '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.
--
-- 'certificateConfiguration', 'createFleet_certificateConfiguration' - Prompts GameLift to generate a TLS\/SSL certificate for the fleet.
-- GameLift uses the certificates to encrypt traffic between game clients
-- and the game servers running on GameLift. By default, the
-- @CertificateConfiguration@ is @DISABLED@. You can\'t change this
-- property after you create the fleet.
--
-- Certificate Manager (ACM) certificates expire after 13 months.
-- Certificate expiration can cause fleets to fail, preventing players from
-- connecting to instances in the fleet. We recommend you replace fleets
-- before 13 months, consider using fleet aliases for a smooth transition.
--
-- ACM isn\'t available in all Amazon Web Services regions. A fleet
-- creation request with certificate generation enabled in an unsupported
-- Region, fails with a 4xx error. For more information about the supported
-- Regions, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/acm-regions.html Supported Regions>
-- in the /Certificate Manager User Guide/.
--
-- 'computeType', 'createFleet_computeType' - The type of compute resource used to host your game servers. You can use
-- your own compute resources with GameLift Anywhere or use Amazon EC2
-- instances with managed GameLift.
--
-- 'description', 'createFleet_description' - A description for the fleet.
--
-- '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.
--
-- 'eC2InstanceType', 'createFleet_eC2InstanceType' - The GameLift-supported Amazon 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 Elastic Compute Cloud Instance Types>
-- for detailed descriptions of Amazon EC2 instance types.
--
-- '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.
--
-- 'instanceRoleArn', 'createFleet_instanceRoleArn' - A unique identifier for an IAM role that manages access to your Amazon
-- Web Services 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 Amazon Web
-- Services 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.
--
-- '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 Amazon Web Services Regions that support multiple locations.
-- You can add any GameLift-supported Amazon Web Services Region as a
-- remote location, in the form of an Amazon Web Services Region code such
-- as @us-west-2@. To create a fleet with instances in the home Region
-- only, omit this parameter.
--
-- '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@. For more information, see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-initialize Initialize the server process>
-- in the /GameLift Developer Guide/.
--
-- 'metricGroups', 'createFleet_metricGroups' - The name of an Amazon Web Services 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.
--
-- '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
-- <gamelift/latest/apireference/API_UpdateGameSession.html 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.
--
-- 'peerVpcAwsAccountId', 'createFleet_peerVpcAwsAccountId' - Used when peering your GameLift fleet with a VPC, the unique identifier
-- for the Amazon Web Services account that owns the VPC. You can find your
-- account ID in the Amazon Web Services Management Console under account
-- settings.
--
-- '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 Amazon Web
-- Services Management Console. Learn more about VPC peering in
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html VPC Peering with GameLift Fleets>.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- 'tags', 'createFleet_tags' - A list of labels to assign to the new fleet resource. Tags are
-- developer-defined key-value pairs. Tagging Amazon Web Services 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 Amazon Web Services Resources>
-- in the /Amazon Web Services General Reference/.
--
-- 'name', 'createFleet_name' - A descriptive label that is associated with a fleet. Fleet names do not
-- need to be unique.
newCreateFleet ::
  -- | 'name'
  Prelude.Text ->
  CreateFleet
newCreateFleet :: Text -> CreateFleet
newCreateFleet Text
pName_ =
  CreateFleet'
    { $sel:anywhereConfiguration:CreateFleet' :: Maybe AnywhereConfiguration
anywhereConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:buildId:CreateFleet' :: Maybe Text
buildId = forall a. Maybe a
Prelude.Nothing,
      $sel:certificateConfiguration:CreateFleet' :: Maybe CertificateConfiguration
certificateConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:computeType:CreateFleet' :: Maybe ComputeType
computeType = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateFleet' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:eC2InboundPermissions:CreateFleet' :: Maybe [IpPermission]
eC2InboundPermissions = forall a. Maybe a
Prelude.Nothing,
      $sel:eC2InstanceType:CreateFleet' :: Maybe EC2InstanceType
eC2InstanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:fleetType:CreateFleet' :: Maybe FleetType
fleetType = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceRoleArn:CreateFleet' :: Maybe Text
instanceRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:locations:CreateFleet' :: Maybe (NonEmpty LocationConfiguration)
locations = forall a. Maybe a
Prelude.Nothing,
      $sel:logPaths:CreateFleet' :: Maybe [Text]
logPaths = forall a. Maybe a
Prelude.Nothing,
      $sel:metricGroups:CreateFleet' :: Maybe [Text]
metricGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:newGameSessionProtectionPolicy':CreateFleet' :: Maybe ProtectionPolicy
newGameSessionProtectionPolicy' = forall a. Maybe a
Prelude.Nothing,
      $sel:peerVpcAwsAccountId:CreateFleet' :: Maybe Text
peerVpcAwsAccountId = forall a. Maybe a
Prelude.Nothing,
      $sel:peerVpcId:CreateFleet' :: Maybe Text
peerVpcId = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceCreationLimitPolicy:CreateFleet' :: Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy = forall a. Maybe a
Prelude.Nothing,
      $sel:runtimeConfiguration:CreateFleet' :: Maybe RuntimeConfiguration
runtimeConfiguration = forall a. Maybe a
Prelude.Nothing,
      $sel:scriptId:CreateFleet' :: Maybe Text
scriptId = forall a. Maybe a
Prelude.Nothing,
      $sel:serverLaunchParameters:CreateFleet' :: Maybe Text
serverLaunchParameters = forall a. Maybe a
Prelude.Nothing,
      $sel:serverLaunchPath:CreateFleet' :: Maybe Text
serverLaunchPath = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateFleet' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateFleet' :: Text
name = Text
pName_
    }

-- | GameLift Anywhere configuration options.
createFleet_anywhereConfiguration :: Lens.Lens' CreateFleet (Prelude.Maybe AnywhereConfiguration)
createFleet_anywhereConfiguration :: Lens' CreateFleet (Maybe AnywhereConfiguration)
createFleet_anywhereConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe AnywhereConfiguration
anywhereConfiguration :: Maybe AnywhereConfiguration
$sel:anywhereConfiguration:CreateFleet' :: CreateFleet -> Maybe AnywhereConfiguration
anywhereConfiguration} -> Maybe AnywhereConfiguration
anywhereConfiguration) (\s :: CreateFleet
s@CreateFleet' {} Maybe AnywhereConfiguration
a -> CreateFleet
s {$sel:anywhereConfiguration:CreateFleet' :: Maybe AnywhereConfiguration
anywhereConfiguration = Maybe AnywhereConfiguration
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 :: Lens' CreateFleet (Maybe Text)
createFleet_buildId = 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)

-- | Prompts GameLift to generate a TLS\/SSL certificate for the fleet.
-- GameLift uses the certificates to encrypt traffic between game clients
-- and the game servers running on GameLift. By default, the
-- @CertificateConfiguration@ is @DISABLED@. You can\'t change this
-- property after you create the fleet.
--
-- Certificate Manager (ACM) certificates expire after 13 months.
-- Certificate expiration can cause fleets to fail, preventing players from
-- connecting to instances in the fleet. We recommend you replace fleets
-- before 13 months, consider using fleet aliases for a smooth transition.
--
-- ACM isn\'t available in all Amazon Web Services regions. A fleet
-- creation request with certificate generation enabled in an unsupported
-- Region, fails with a 4xx error. For more information about the supported
-- Regions, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/acm-regions.html Supported Regions>
-- in the /Certificate Manager User Guide/.
createFleet_certificateConfiguration :: Lens.Lens' CreateFleet (Prelude.Maybe CertificateConfiguration)
createFleet_certificateConfiguration :: Lens' CreateFleet (Maybe CertificateConfiguration)
createFleet_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)

-- | The type of compute resource used to host your game servers. You can use
-- your own compute resources with GameLift Anywhere or use Amazon EC2
-- instances with managed GameLift.
createFleet_computeType :: Lens.Lens' CreateFleet (Prelude.Maybe ComputeType)
createFleet_computeType :: Lens' CreateFleet (Maybe ComputeType)
createFleet_computeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe ComputeType
computeType :: Maybe ComputeType
$sel:computeType:CreateFleet' :: CreateFleet -> Maybe ComputeType
computeType} -> Maybe ComputeType
computeType) (\s :: CreateFleet
s@CreateFleet' {} Maybe ComputeType
a -> CreateFleet
s {$sel:computeType:CreateFleet' :: Maybe ComputeType
computeType = Maybe ComputeType
a} :: CreateFleet)

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

-- | The 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 :: Lens' CreateFleet (Maybe [IpPermission])
createFleet_eC2InboundPermissions = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The GameLift-supported Amazon 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 Elastic Compute Cloud Instance Types>
-- for detailed descriptions of Amazon EC2 instance types.
createFleet_eC2InstanceType :: Lens.Lens' CreateFleet (Prelude.Maybe EC2InstanceType)
createFleet_eC2InstanceType :: Lens' CreateFleet (Maybe EC2InstanceType)
createFleet_eC2InstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleet' {Maybe EC2InstanceType
eC2InstanceType :: Maybe EC2InstanceType
$sel:eC2InstanceType:CreateFleet' :: CreateFleet -> Maybe EC2InstanceType
eC2InstanceType} -> Maybe EC2InstanceType
eC2InstanceType) (\s :: CreateFleet
s@CreateFleet' {} Maybe EC2InstanceType
a -> CreateFleet
s {$sel:eC2InstanceType:CreateFleet' :: Maybe EC2InstanceType
eC2InstanceType = Maybe EC2InstanceType
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 :: Lens' CreateFleet (Maybe FleetType)
createFleet_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)

-- | A unique identifier for an IAM role that manages access to your Amazon
-- Web Services 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 Amazon Web
-- Services 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 :: Lens' CreateFleet (Maybe Text)
createFleet_instanceRoleArn = 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)

-- | 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 Amazon Web Services Regions that support multiple locations.
-- You can add any GameLift-supported Amazon Web Services Region as a
-- remote location, in the form of an Amazon Web Services 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 :: Lens' CreateFleet (Maybe (NonEmpty LocationConfiguration))
createFleet_locations = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | __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@. For more information, see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-initialize Initialize the server process>
-- in the /GameLift Developer Guide/.
createFleet_logPaths :: Lens.Lens' CreateFleet (Prelude.Maybe [Prelude.Text])
createFleet_logPaths :: Lens' CreateFleet (Maybe [Text])
createFleet_logPaths = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of an Amazon Web Services 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 :: Lens' CreateFleet (Maybe [Text])
createFleet_metricGroups = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The 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
-- <gamelift/latest/apireference/API_UpdateGameSession.html 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 :: Lens' CreateFleet (Maybe ProtectionPolicy)
createFleet_newGameSessionProtectionPolicy = 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)

-- | Used when peering your GameLift fleet with a VPC, the unique identifier
-- for the Amazon Web Services account that owns the VPC. You can find your
-- account ID in the Amazon Web Services Management Console under account
-- settings.
createFleet_peerVpcAwsAccountId :: Lens.Lens' CreateFleet (Prelude.Maybe Prelude.Text)
createFleet_peerVpcAwsAccountId :: Lens' CreateFleet (Maybe Text)
createFleet_peerVpcAwsAccountId = 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)

-- | 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 Amazon Web
-- Services 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 :: Lens' CreateFleet (Maybe Text)
createFleet_peerVpcId = 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)

-- | 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 :: Lens' CreateFleet (Maybe ResourceCreationLimitPolicy)
createFleet_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)

-- | 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 :: Lens' CreateFleet (Maybe RuntimeConfiguration)
createFleet_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 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 :: Lens' CreateFleet (Maybe Text)
createFleet_scriptId = 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)

-- | __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 :: Lens' CreateFleet (Maybe Text)
createFleet_serverLaunchParameters = 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.__ 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 :: Lens' CreateFleet (Maybe Text)
createFleet_serverLaunchPath = 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 list of labels to assign to the new fleet resource. Tags are
-- developer-defined key-value pairs. Tagging Amazon Web Services 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 Amazon Web Services Resources>
-- in the /Amazon Web Services General Reference/.
createFleet_tags :: Lens.Lens' CreateFleet (Prelude.Maybe [Tag])
createFleet_tags :: Lens' CreateFleet (Maybe [Tag])
createFleet_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: Lens' CreateFleet Text
createFleet_name = 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)

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

instance Prelude.Hashable CreateFleet where
  hashWithSalt :: Int -> CreateFleet -> Int
hashWithSalt Int
_salt CreateFleet' {Maybe [Text]
Maybe [IpPermission]
Maybe [Tag]
Maybe (NonEmpty LocationConfiguration)
Maybe Text
Maybe AnywhereConfiguration
Maybe CertificateConfiguration
Maybe ComputeType
Maybe EC2InstanceType
Maybe FleetType
Maybe ProtectionPolicy
Maybe ResourceCreationLimitPolicy
Maybe RuntimeConfiguration
Text
name :: Text
tags :: Maybe [Tag]
serverLaunchPath :: Maybe Text
serverLaunchParameters :: Maybe Text
scriptId :: Maybe Text
runtimeConfiguration :: Maybe RuntimeConfiguration
resourceCreationLimitPolicy :: Maybe ResourceCreationLimitPolicy
peerVpcId :: Maybe Text
peerVpcAwsAccountId :: Maybe Text
newGameSessionProtectionPolicy' :: Maybe ProtectionPolicy
metricGroups :: Maybe [Text]
logPaths :: Maybe [Text]
locations :: Maybe (NonEmpty LocationConfiguration)
instanceRoleArn :: Maybe Text
fleetType :: Maybe FleetType
eC2InstanceType :: Maybe EC2InstanceType
eC2InboundPermissions :: Maybe [IpPermission]
description :: Maybe Text
computeType :: Maybe ComputeType
certificateConfiguration :: Maybe CertificateConfiguration
buildId :: Maybe Text
anywhereConfiguration :: Maybe AnywhereConfiguration
$sel:name:CreateFleet' :: CreateFleet -> Text
$sel:tags:CreateFleet' :: CreateFleet -> Maybe [Tag]
$sel:serverLaunchPath:CreateFleet' :: CreateFleet -> Maybe Text
$sel:serverLaunchParameters:CreateFleet' :: CreateFleet -> Maybe Text
$sel:scriptId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:runtimeConfiguration:CreateFleet' :: CreateFleet -> Maybe RuntimeConfiguration
$sel:resourceCreationLimitPolicy:CreateFleet' :: CreateFleet -> Maybe ResourceCreationLimitPolicy
$sel:peerVpcId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:peerVpcAwsAccountId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:newGameSessionProtectionPolicy':CreateFleet' :: CreateFleet -> Maybe ProtectionPolicy
$sel:metricGroups:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:logPaths:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:locations:CreateFleet' :: CreateFleet -> Maybe (NonEmpty LocationConfiguration)
$sel:instanceRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
$sel:fleetType:CreateFleet' :: CreateFleet -> Maybe FleetType
$sel:eC2InstanceType:CreateFleet' :: CreateFleet -> Maybe EC2InstanceType
$sel:eC2InboundPermissions:CreateFleet' :: CreateFleet -> Maybe [IpPermission]
$sel:description:CreateFleet' :: CreateFleet -> Maybe Text
$sel:computeType:CreateFleet' :: CreateFleet -> Maybe ComputeType
$sel:certificateConfiguration:CreateFleet' :: CreateFleet -> Maybe CertificateConfiguration
$sel:buildId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:anywhereConfiguration:CreateFleet' :: CreateFleet -> Maybe AnywhereConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnywhereConfiguration
anywhereConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
buildId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CertificateConfiguration
certificateConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComputeType
computeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [IpPermission]
eC2InboundPermissions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EC2InstanceType
eC2InstanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FleetType
fleetType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty LocationConfiguration)
locations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
logPaths
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
metricGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProtectionPolicy
newGameSessionProtectionPolicy'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
peerVpcAwsAccountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
peerVpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RuntimeConfiguration
runtimeConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scriptId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serverLaunchParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serverLaunchPath
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData CreateFleet where
  rnf :: CreateFleet -> ()
rnf CreateFleet' {Maybe [Text]
Maybe [IpPermission]
Maybe [Tag]
Maybe (NonEmpty LocationConfiguration)
Maybe Text
Maybe AnywhereConfiguration
Maybe CertificateConfiguration
Maybe ComputeType
Maybe EC2InstanceType
Maybe FleetType
Maybe ProtectionPolicy
Maybe ResourceCreationLimitPolicy
Maybe RuntimeConfiguration
Text
name :: Text
tags :: Maybe [Tag]
serverLaunchPath :: Maybe Text
serverLaunchParameters :: Maybe Text
scriptId :: Maybe Text
runtimeConfiguration :: Maybe RuntimeConfiguration
resourceCreationLimitPolicy :: Maybe ResourceCreationLimitPolicy
peerVpcId :: Maybe Text
peerVpcAwsAccountId :: Maybe Text
newGameSessionProtectionPolicy' :: Maybe ProtectionPolicy
metricGroups :: Maybe [Text]
logPaths :: Maybe [Text]
locations :: Maybe (NonEmpty LocationConfiguration)
instanceRoleArn :: Maybe Text
fleetType :: Maybe FleetType
eC2InstanceType :: Maybe EC2InstanceType
eC2InboundPermissions :: Maybe [IpPermission]
description :: Maybe Text
computeType :: Maybe ComputeType
certificateConfiguration :: Maybe CertificateConfiguration
buildId :: Maybe Text
anywhereConfiguration :: Maybe AnywhereConfiguration
$sel:name:CreateFleet' :: CreateFleet -> Text
$sel:tags:CreateFleet' :: CreateFleet -> Maybe [Tag]
$sel:serverLaunchPath:CreateFleet' :: CreateFleet -> Maybe Text
$sel:serverLaunchParameters:CreateFleet' :: CreateFleet -> Maybe Text
$sel:scriptId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:runtimeConfiguration:CreateFleet' :: CreateFleet -> Maybe RuntimeConfiguration
$sel:resourceCreationLimitPolicy:CreateFleet' :: CreateFleet -> Maybe ResourceCreationLimitPolicy
$sel:peerVpcId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:peerVpcAwsAccountId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:newGameSessionProtectionPolicy':CreateFleet' :: CreateFleet -> Maybe ProtectionPolicy
$sel:metricGroups:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:logPaths:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:locations:CreateFleet' :: CreateFleet -> Maybe (NonEmpty LocationConfiguration)
$sel:instanceRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
$sel:fleetType:CreateFleet' :: CreateFleet -> Maybe FleetType
$sel:eC2InstanceType:CreateFleet' :: CreateFleet -> Maybe EC2InstanceType
$sel:eC2InboundPermissions:CreateFleet' :: CreateFleet -> Maybe [IpPermission]
$sel:description:CreateFleet' :: CreateFleet -> Maybe Text
$sel:computeType:CreateFleet' :: CreateFleet -> Maybe ComputeType
$sel:certificateConfiguration:CreateFleet' :: CreateFleet -> Maybe CertificateConfiguration
$sel:buildId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:anywhereConfiguration:CreateFleet' :: CreateFleet -> Maybe AnywhereConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AnywhereConfiguration
anywhereConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
buildId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CertificateConfiguration
certificateConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ComputeType
computeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [IpPermission]
eC2InboundPermissions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EC2InstanceType
eC2InstanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FleetType
fleetType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty LocationConfiguration)
locations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
logPaths
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
metricGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProtectionPolicy
newGameSessionProtectionPolicy'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
peerVpcAwsAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
peerVpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuntimeConfiguration
runtimeConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scriptId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe Text
serverLaunchParameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serverLaunchPath
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name

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

instance Data.ToJSON CreateFleet where
  toJSON :: CreateFleet -> Value
toJSON CreateFleet' {Maybe [Text]
Maybe [IpPermission]
Maybe [Tag]
Maybe (NonEmpty LocationConfiguration)
Maybe Text
Maybe AnywhereConfiguration
Maybe CertificateConfiguration
Maybe ComputeType
Maybe EC2InstanceType
Maybe FleetType
Maybe ProtectionPolicy
Maybe ResourceCreationLimitPolicy
Maybe RuntimeConfiguration
Text
name :: Text
tags :: Maybe [Tag]
serverLaunchPath :: Maybe Text
serverLaunchParameters :: Maybe Text
scriptId :: Maybe Text
runtimeConfiguration :: Maybe RuntimeConfiguration
resourceCreationLimitPolicy :: Maybe ResourceCreationLimitPolicy
peerVpcId :: Maybe Text
peerVpcAwsAccountId :: Maybe Text
newGameSessionProtectionPolicy' :: Maybe ProtectionPolicy
metricGroups :: Maybe [Text]
logPaths :: Maybe [Text]
locations :: Maybe (NonEmpty LocationConfiguration)
instanceRoleArn :: Maybe Text
fleetType :: Maybe FleetType
eC2InstanceType :: Maybe EC2InstanceType
eC2InboundPermissions :: Maybe [IpPermission]
description :: Maybe Text
computeType :: Maybe ComputeType
certificateConfiguration :: Maybe CertificateConfiguration
buildId :: Maybe Text
anywhereConfiguration :: Maybe AnywhereConfiguration
$sel:name:CreateFleet' :: CreateFleet -> Text
$sel:tags:CreateFleet' :: CreateFleet -> Maybe [Tag]
$sel:serverLaunchPath:CreateFleet' :: CreateFleet -> Maybe Text
$sel:serverLaunchParameters:CreateFleet' :: CreateFleet -> Maybe Text
$sel:scriptId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:runtimeConfiguration:CreateFleet' :: CreateFleet -> Maybe RuntimeConfiguration
$sel:resourceCreationLimitPolicy:CreateFleet' :: CreateFleet -> Maybe ResourceCreationLimitPolicy
$sel:peerVpcId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:peerVpcAwsAccountId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:newGameSessionProtectionPolicy':CreateFleet' :: CreateFleet -> Maybe ProtectionPolicy
$sel:metricGroups:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:logPaths:CreateFleet' :: CreateFleet -> Maybe [Text]
$sel:locations:CreateFleet' :: CreateFleet -> Maybe (NonEmpty LocationConfiguration)
$sel:instanceRoleArn:CreateFleet' :: CreateFleet -> Maybe Text
$sel:fleetType:CreateFleet' :: CreateFleet -> Maybe FleetType
$sel:eC2InstanceType:CreateFleet' :: CreateFleet -> Maybe EC2InstanceType
$sel:eC2InboundPermissions:CreateFleet' :: CreateFleet -> Maybe [IpPermission]
$sel:description:CreateFleet' :: CreateFleet -> Maybe Text
$sel:computeType:CreateFleet' :: CreateFleet -> Maybe ComputeType
$sel:certificateConfiguration:CreateFleet' :: CreateFleet -> Maybe CertificateConfiguration
$sel:buildId:CreateFleet' :: CreateFleet -> Maybe Text
$sel:anywhereConfiguration:CreateFleet' :: CreateFleet -> Maybe AnywhereConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AnywhereConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AnywhereConfiguration
anywhereConfiguration,
            (Key
"BuildId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
buildId,
            (Key
"CertificateConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CertificateConfiguration
certificateConfiguration,
            (Key
"ComputeType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComputeType
computeType,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"EC2InboundPermissions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [IpPermission]
eC2InboundPermissions,
            (Key
"EC2InstanceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EC2InstanceType
eC2InstanceType,
            (Key
"FleetType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FleetType
fleetType,
            (Key
"InstanceRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
instanceRoleArn,
            (Key
"Locations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty LocationConfiguration)
locations,
            (Key
"LogPaths" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
logPaths,
            (Key
"MetricGroups" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
metricGroups,
            (Key
"NewGameSessionProtectionPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProtectionPolicy
newGameSessionProtectionPolicy',
            (Key
"PeerVpcAwsAccountId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
peerVpcAwsAccountId,
            (Key
"PeerVpcId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
peerVpcId,
            (Key
"ResourceCreationLimitPolicy" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResourceCreationLimitPolicy
resourceCreationLimitPolicy,
            (Key
"RuntimeConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RuntimeConfiguration
runtimeConfiguration,
            (Key
"ScriptId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
scriptId,
            (Key
"ServerLaunchParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serverLaunchParameters,
            (Key
"ServerLaunchPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serverLaunchPath,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
          ]
      )

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

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

-- | /See:/ 'newCreateFleetResponse' smart constructor.
data CreateFleetResponse = CreateFleetResponse'
  { -- | 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 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 response's http status code.
    CreateFleetResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateFleetResponse -> CreateFleetResponse -> Bool
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]
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
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. 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:
--
-- 'fleetAttributes', 'createFleetResponse_fleetAttributes' - The properties for the new fleet, including the current status. All
-- fleets are placed in @NEW@ status on creation.
--
-- '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.
--
-- 'httpStatus', 'createFleetResponse_httpStatus' - The response's http status code.
newCreateFleetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFleetResponse
newCreateFleetResponse :: Int -> CreateFleetResponse
newCreateFleetResponse Int
pHttpStatus_ =
  CreateFleetResponse'
    { $sel:fleetAttributes:CreateFleetResponse' :: Maybe FleetAttributes
fleetAttributes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:locationStates:CreateFleetResponse' :: Maybe [LocationState]
locationStates = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFleetResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: Lens' CreateFleetResponse (Maybe FleetAttributes)
createFleetResponse_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 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 :: Lens' CreateFleetResponse (Maybe [LocationState])
createFleetResponse_locationStates = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
createFleetResponse_httpStatus :: Lens.Lens' CreateFleetResponse Prelude.Int
createFleetResponse_httpStatus :: Lens' CreateFleetResponse Int
createFleetResponse_httpStatus = 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 where
  rnf :: CreateFleetResponse -> ()
rnf CreateFleetResponse' {Int
Maybe [LocationState]
Maybe FleetAttributes
httpStatus :: Int
locationStates :: Maybe [LocationState]
fleetAttributes :: Maybe FleetAttributes
$sel:httpStatus:CreateFleetResponse' :: CreateFleetResponse -> Int
$sel:locationStates:CreateFleetResponse' :: CreateFleetResponse -> Maybe [LocationState]
$sel:fleetAttributes:CreateFleetResponse' :: CreateFleetResponse -> Maybe FleetAttributes
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe FleetAttributes
fleetAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [LocationState]
locationStates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus