{-# 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.CreateFleetLocations
-- 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)
--
-- Adds remote locations to a fleet and begins populating the new locations
-- with EC2 instances. The new instances conform to the fleet\'s instance
-- type, auto-scaling, and other configuration settings.
--
-- This operation cannot be used with fleets that don\'t support remote
-- locations. Fleets can have multiple locations only if they reside in AWS
-- Regions that support this feature (see CreateFleet for the complete
-- list) and were created after the feature was released in March 2021.
--
-- To add fleet locations, specify the fleet to be updated and provide a
-- list of one or more locations.
--
-- If successful, this operation returns the list of added locations with
-- their status set to @NEW@. GameLift initiates the process of starting an
-- instance in each added location. You can track the status of each new
-- location by monitoring location creation events using
-- DescribeFleetEvents. Alternatively, you can poll location status by
-- calling DescribeFleetLocationAttributes. After a location status becomes
-- @ACTIVE@, you can adjust the location\'s capacity as needed with
-- 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-intro.html Multi-location fleets>
--
-- __Related actions__
--
-- CreateFleetLocations | DescribeFleetLocationAttributes |
-- DescribeFleetLocationCapacity | DescribeFleetLocationUtilization |
-- DescribeFleetAttributes | DescribeFleetCapacity |
-- DescribeFleetUtilization | UpdateFleetCapacity | StopFleetActions |
-- DeleteFleetLocations |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
module Amazonka.GameLift.CreateFleetLocations
  ( -- * Creating a Request
    CreateFleetLocations (..),
    newCreateFleetLocations,

    -- * Request Lenses
    createFleetLocations_fleetId,
    createFleetLocations_locations,

    -- * Destructuring the Response
    CreateFleetLocationsResponse (..),
    newCreateFleetLocationsResponse,

    -- * Response Lenses
    createFleetLocationsResponse_fleetArn,
    createFleetLocationsResponse_locationStates,
    createFleetLocationsResponse_fleetId,
    createFleetLocationsResponse_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:/ 'newCreateFleetLocations' smart constructor.
data CreateFleetLocations = CreateFleetLocations'
  { -- | A unique identifier for the fleet to add locations to. You can use
    -- either the fleet ID or ARN value.
    CreateFleetLocations -> Text
fleetId :: Prelude.Text,
    -- | A list of locations to deploy additional instances to and manage as part
    -- of the fleet. 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@.
    CreateFleetLocations -> NonEmpty LocationConfiguration
locations :: Prelude.NonEmpty LocationConfiguration
  }
  deriving (CreateFleetLocations -> CreateFleetLocations -> Bool
(CreateFleetLocations -> CreateFleetLocations -> Bool)
-> (CreateFleetLocations -> CreateFleetLocations -> Bool)
-> Eq CreateFleetLocations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFleetLocations -> CreateFleetLocations -> Bool
$c/= :: CreateFleetLocations -> CreateFleetLocations -> Bool
== :: CreateFleetLocations -> CreateFleetLocations -> Bool
$c== :: CreateFleetLocations -> CreateFleetLocations -> Bool
Prelude.Eq, ReadPrec [CreateFleetLocations]
ReadPrec CreateFleetLocations
Int -> ReadS CreateFleetLocations
ReadS [CreateFleetLocations]
(Int -> ReadS CreateFleetLocations)
-> ReadS [CreateFleetLocations]
-> ReadPrec CreateFleetLocations
-> ReadPrec [CreateFleetLocations]
-> Read CreateFleetLocations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFleetLocations]
$creadListPrec :: ReadPrec [CreateFleetLocations]
readPrec :: ReadPrec CreateFleetLocations
$creadPrec :: ReadPrec CreateFleetLocations
readList :: ReadS [CreateFleetLocations]
$creadList :: ReadS [CreateFleetLocations]
readsPrec :: Int -> ReadS CreateFleetLocations
$creadsPrec :: Int -> ReadS CreateFleetLocations
Prelude.Read, Int -> CreateFleetLocations -> ShowS
[CreateFleetLocations] -> ShowS
CreateFleetLocations -> String
(Int -> CreateFleetLocations -> ShowS)
-> (CreateFleetLocations -> String)
-> ([CreateFleetLocations] -> ShowS)
-> Show CreateFleetLocations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFleetLocations] -> ShowS
$cshowList :: [CreateFleetLocations] -> ShowS
show :: CreateFleetLocations -> String
$cshow :: CreateFleetLocations -> String
showsPrec :: Int -> CreateFleetLocations -> ShowS
$cshowsPrec :: Int -> CreateFleetLocations -> ShowS
Prelude.Show, (forall x. CreateFleetLocations -> Rep CreateFleetLocations x)
-> (forall x. Rep CreateFleetLocations x -> CreateFleetLocations)
-> Generic CreateFleetLocations
forall x. Rep CreateFleetLocations x -> CreateFleetLocations
forall x. CreateFleetLocations -> Rep CreateFleetLocations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFleetLocations x -> CreateFleetLocations
$cfrom :: forall x. CreateFleetLocations -> Rep CreateFleetLocations x
Prelude.Generic)

-- |
-- Create a value of 'CreateFleetLocations' 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:
--
-- 'fleetId', 'createFleetLocations_fleetId' - A unique identifier for the fleet to add locations to. You can use
-- either the fleet ID or ARN value.
--
-- 'locations', 'createFleetLocations_locations' - A list of locations to deploy additional instances to and manage as part
-- of the fleet. 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@.
newCreateFleetLocations ::
  -- | 'fleetId'
  Prelude.Text ->
  -- | 'locations'
  Prelude.NonEmpty LocationConfiguration ->
  CreateFleetLocations
newCreateFleetLocations :: Text -> NonEmpty LocationConfiguration -> CreateFleetLocations
newCreateFleetLocations Text
pFleetId_ NonEmpty LocationConfiguration
pLocations_ =
  CreateFleetLocations' :: Text -> NonEmpty LocationConfiguration -> CreateFleetLocations
CreateFleetLocations'
    { $sel:fleetId:CreateFleetLocations' :: Text
fleetId = Text
pFleetId_,
      $sel:locations:CreateFleetLocations' :: NonEmpty LocationConfiguration
locations = Tagged
  (NonEmpty LocationConfiguration)
  (Identity (NonEmpty LocationConfiguration))
-> Tagged
     (NonEmpty LocationConfiguration)
     (Identity (NonEmpty LocationConfiguration))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty LocationConfiguration)
   (Identity (NonEmpty LocationConfiguration))
 -> Tagged
      (NonEmpty LocationConfiguration)
      (Identity (NonEmpty LocationConfiguration)))
-> NonEmpty LocationConfiguration -> NonEmpty LocationConfiguration
forall t b. AReview t b -> b -> t
Lens.# NonEmpty LocationConfiguration
pLocations_
    }

-- | A unique identifier for the fleet to add locations to. You can use
-- either the fleet ID or ARN value.
createFleetLocations_fleetId :: Lens.Lens' CreateFleetLocations Prelude.Text
createFleetLocations_fleetId :: (Text -> f Text) -> CreateFleetLocations -> f CreateFleetLocations
createFleetLocations_fleetId = (CreateFleetLocations -> Text)
-> (CreateFleetLocations -> Text -> CreateFleetLocations)
-> Lens CreateFleetLocations CreateFleetLocations Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetLocations' {Text
fleetId :: Text
$sel:fleetId:CreateFleetLocations' :: CreateFleetLocations -> Text
fleetId} -> Text
fleetId) (\s :: CreateFleetLocations
s@CreateFleetLocations' {} Text
a -> CreateFleetLocations
s {$sel:fleetId:CreateFleetLocations' :: Text
fleetId = Text
a} :: CreateFleetLocations)

-- | A list of locations to deploy additional instances to and manage as part
-- of the fleet. 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@.
createFleetLocations_locations :: Lens.Lens' CreateFleetLocations (Prelude.NonEmpty LocationConfiguration)
createFleetLocations_locations :: (NonEmpty LocationConfiguration
 -> f (NonEmpty LocationConfiguration))
-> CreateFleetLocations -> f CreateFleetLocations
createFleetLocations_locations = (CreateFleetLocations -> NonEmpty LocationConfiguration)
-> (CreateFleetLocations
    -> NonEmpty LocationConfiguration -> CreateFleetLocations)
-> Lens
     CreateFleetLocations
     CreateFleetLocations
     (NonEmpty LocationConfiguration)
     (NonEmpty LocationConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetLocations' {NonEmpty LocationConfiguration
locations :: NonEmpty LocationConfiguration
$sel:locations:CreateFleetLocations' :: CreateFleetLocations -> NonEmpty LocationConfiguration
locations} -> NonEmpty LocationConfiguration
locations) (\s :: CreateFleetLocations
s@CreateFleetLocations' {} NonEmpty LocationConfiguration
a -> CreateFleetLocations
s {$sel:locations:CreateFleetLocations' :: NonEmpty LocationConfiguration
locations = NonEmpty LocationConfiguration
a} :: CreateFleetLocations) ((NonEmpty LocationConfiguration
  -> f (NonEmpty LocationConfiguration))
 -> CreateFleetLocations -> f CreateFleetLocations)
-> ((NonEmpty LocationConfiguration
     -> f (NonEmpty LocationConfiguration))
    -> NonEmpty LocationConfiguration
    -> f (NonEmpty LocationConfiguration))
-> (NonEmpty LocationConfiguration
    -> f (NonEmpty LocationConfiguration))
-> CreateFleetLocations
-> f CreateFleetLocations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty LocationConfiguration
 -> f (NonEmpty LocationConfiguration))
-> NonEmpty LocationConfiguration
-> f (NonEmpty LocationConfiguration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateFleetLocations where
  type
    AWSResponse CreateFleetLocations =
      CreateFleetLocationsResponse
  request :: CreateFleetLocations -> Request CreateFleetLocations
request = Service -> CreateFleetLocations -> Request CreateFleetLocations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateFleetLocations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFleetLocations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateFleetLocations))
-> Logger
-> Service
-> Proxy CreateFleetLocations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateFleetLocations)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [LocationState]
-> Maybe Text
-> Int
-> CreateFleetLocationsResponse
CreateFleetLocationsResponse'
            (Maybe Text
 -> Maybe [LocationState]
 -> Maybe Text
 -> Int
 -> CreateFleetLocationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [LocationState]
      -> Maybe Text -> Int -> CreateFleetLocationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FleetArn")
            Either
  String
  (Maybe [LocationState]
   -> Maybe Text -> Int -> CreateFleetLocationsResponse)
-> Either String (Maybe [LocationState])
-> Either
     String (Maybe Text -> Int -> CreateFleetLocationsResponse)
forall (f :: * -> *) a b. Applicative f => 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 Text -> Int -> CreateFleetLocationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateFleetLocationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FleetId")
            Either String (Int -> CreateFleetLocationsResponse)
-> Either String Int -> Either String CreateFleetLocationsResponse
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 CreateFleetLocations

instance Prelude.NFData CreateFleetLocations

instance Core.ToHeaders CreateFleetLocations where
  toHeaders :: CreateFleetLocations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateFleetLocations -> 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.CreateFleetLocations" ::
                          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 CreateFleetLocations where
  toJSON :: CreateFleetLocations -> Value
toJSON CreateFleetLocations' {NonEmpty LocationConfiguration
Text
locations :: NonEmpty LocationConfiguration
fleetId :: Text
$sel:locations:CreateFleetLocations' :: CreateFleetLocations -> NonEmpty LocationConfiguration
$sel:fleetId:CreateFleetLocations' :: CreateFleetLocations -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FleetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fleetId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Locations" Text -> NonEmpty LocationConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty LocationConfiguration
locations)
          ]
      )

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

instance Core.ToQuery CreateFleetLocations where
  toQuery :: CreateFleetLocations -> QueryString
toQuery = QueryString -> CreateFleetLocations -> 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:/ 'newCreateFleetLocationsResponse' smart constructor.
data CreateFleetLocationsResponse = CreateFleetLocationsResponse'
  { -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- that is assigned to a GameLift fleet resource and uniquely identifies
    -- it. ARNs are unique across all Regions. Format is
    -- @arn:aws:gamelift:\<region>::fleet\/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
    CreateFleetLocationsResponse -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
    -- | The remote locations that are being added to the fleet, and the
    -- life-cycle status of each location. For new locations, the status is set
    -- to @NEW@. During location creation, GameLift updates each location\'s
    -- status as instances are deployed there and prepared for game hosting.
    -- This list does not include the fleet home Region or any remote locations
    -- that were already added to the fleet.
    CreateFleetLocationsResponse -> Maybe [LocationState]
locationStates :: Prelude.Maybe [LocationState],
    -- | A unique identifier for the fleet that was updated with new locations.
    CreateFleetLocationsResponse -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateFleetLocationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateFleetLocationsResponse
-> CreateFleetLocationsResponse -> Bool
(CreateFleetLocationsResponse
 -> CreateFleetLocationsResponse -> Bool)
-> (CreateFleetLocationsResponse
    -> CreateFleetLocationsResponse -> Bool)
-> Eq CreateFleetLocationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFleetLocationsResponse
-> CreateFleetLocationsResponse -> Bool
$c/= :: CreateFleetLocationsResponse
-> CreateFleetLocationsResponse -> Bool
== :: CreateFleetLocationsResponse
-> CreateFleetLocationsResponse -> Bool
$c== :: CreateFleetLocationsResponse
-> CreateFleetLocationsResponse -> Bool
Prelude.Eq, ReadPrec [CreateFleetLocationsResponse]
ReadPrec CreateFleetLocationsResponse
Int -> ReadS CreateFleetLocationsResponse
ReadS [CreateFleetLocationsResponse]
(Int -> ReadS CreateFleetLocationsResponse)
-> ReadS [CreateFleetLocationsResponse]
-> ReadPrec CreateFleetLocationsResponse
-> ReadPrec [CreateFleetLocationsResponse]
-> Read CreateFleetLocationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFleetLocationsResponse]
$creadListPrec :: ReadPrec [CreateFleetLocationsResponse]
readPrec :: ReadPrec CreateFleetLocationsResponse
$creadPrec :: ReadPrec CreateFleetLocationsResponse
readList :: ReadS [CreateFleetLocationsResponse]
$creadList :: ReadS [CreateFleetLocationsResponse]
readsPrec :: Int -> ReadS CreateFleetLocationsResponse
$creadsPrec :: Int -> ReadS CreateFleetLocationsResponse
Prelude.Read, Int -> CreateFleetLocationsResponse -> ShowS
[CreateFleetLocationsResponse] -> ShowS
CreateFleetLocationsResponse -> String
(Int -> CreateFleetLocationsResponse -> ShowS)
-> (CreateFleetLocationsResponse -> String)
-> ([CreateFleetLocationsResponse] -> ShowS)
-> Show CreateFleetLocationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFleetLocationsResponse] -> ShowS
$cshowList :: [CreateFleetLocationsResponse] -> ShowS
show :: CreateFleetLocationsResponse -> String
$cshow :: CreateFleetLocationsResponse -> String
showsPrec :: Int -> CreateFleetLocationsResponse -> ShowS
$cshowsPrec :: Int -> CreateFleetLocationsResponse -> ShowS
Prelude.Show, (forall x.
 CreateFleetLocationsResponse -> Rep CreateFleetLocationsResponse x)
-> (forall x.
    Rep CreateFleetLocationsResponse x -> CreateFleetLocationsResponse)
-> Generic CreateFleetLocationsResponse
forall x.
Rep CreateFleetLocationsResponse x -> CreateFleetLocationsResponse
forall x.
CreateFleetLocationsResponse -> Rep CreateFleetLocationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateFleetLocationsResponse x -> CreateFleetLocationsResponse
$cfrom :: forall x.
CreateFleetLocationsResponse -> Rep CreateFleetLocationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateFleetLocationsResponse' 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:
--
-- 'fleetArn', 'createFleetLocationsResponse_fleetArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift fleet resource and uniquely identifies
-- it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::fleet\/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
--
-- 'locationStates', 'createFleetLocationsResponse_locationStates' - The remote locations that are being added to the fleet, and the
-- life-cycle status of each location. For new locations, the status is set
-- to @NEW@. During location creation, GameLift updates each location\'s
-- status as instances are deployed there and prepared for game hosting.
-- This list does not include the fleet home Region or any remote locations
-- that were already added to the fleet.
--
-- 'fleetId', 'createFleetLocationsResponse_fleetId' - A unique identifier for the fleet that was updated with new locations.
--
-- 'httpStatus', 'createFleetLocationsResponse_httpStatus' - The response's http status code.
newCreateFleetLocationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFleetLocationsResponse
newCreateFleetLocationsResponse :: Int -> CreateFleetLocationsResponse
newCreateFleetLocationsResponse Int
pHttpStatus_ =
  CreateFleetLocationsResponse' :: Maybe Text
-> Maybe [LocationState]
-> Maybe Text
-> Int
-> CreateFleetLocationsResponse
CreateFleetLocationsResponse'
    { $sel:fleetArn:CreateFleetLocationsResponse' :: Maybe Text
fleetArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:locationStates:CreateFleetLocationsResponse' :: Maybe [LocationState]
locationStates = Maybe [LocationState]
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetId:CreateFleetLocationsResponse' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFleetLocationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift fleet resource and uniquely identifies
-- it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::fleet\/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
createFleetLocationsResponse_fleetArn :: Lens.Lens' CreateFleetLocationsResponse (Prelude.Maybe Prelude.Text)
createFleetLocationsResponse_fleetArn :: (Maybe Text -> f (Maybe Text))
-> CreateFleetLocationsResponse -> f CreateFleetLocationsResponse
createFleetLocationsResponse_fleetArn = (CreateFleetLocationsResponse -> Maybe Text)
-> (CreateFleetLocationsResponse
    -> Maybe Text -> CreateFleetLocationsResponse)
-> Lens
     CreateFleetLocationsResponse
     CreateFleetLocationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetLocationsResponse' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:CreateFleetLocationsResponse' :: CreateFleetLocationsResponse -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: CreateFleetLocationsResponse
s@CreateFleetLocationsResponse' {} Maybe Text
a -> CreateFleetLocationsResponse
s {$sel:fleetArn:CreateFleetLocationsResponse' :: Maybe Text
fleetArn = Maybe Text
a} :: CreateFleetLocationsResponse)

-- | The remote locations that are being added to the fleet, and the
-- life-cycle status of each location. For new locations, the status is set
-- to @NEW@. During location creation, GameLift updates each location\'s
-- status as instances are deployed there and prepared for game hosting.
-- This list does not include the fleet home Region or any remote locations
-- that were already added to the fleet.
createFleetLocationsResponse_locationStates :: Lens.Lens' CreateFleetLocationsResponse (Prelude.Maybe [LocationState])
createFleetLocationsResponse_locationStates :: (Maybe [LocationState] -> f (Maybe [LocationState]))
-> CreateFleetLocationsResponse -> f CreateFleetLocationsResponse
createFleetLocationsResponse_locationStates = (CreateFleetLocationsResponse -> Maybe [LocationState])
-> (CreateFleetLocationsResponse
    -> Maybe [LocationState] -> CreateFleetLocationsResponse)
-> Lens
     CreateFleetLocationsResponse
     CreateFleetLocationsResponse
     (Maybe [LocationState])
     (Maybe [LocationState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetLocationsResponse' {Maybe [LocationState]
locationStates :: Maybe [LocationState]
$sel:locationStates:CreateFleetLocationsResponse' :: CreateFleetLocationsResponse -> Maybe [LocationState]
locationStates} -> Maybe [LocationState]
locationStates) (\s :: CreateFleetLocationsResponse
s@CreateFleetLocationsResponse' {} Maybe [LocationState]
a -> CreateFleetLocationsResponse
s {$sel:locationStates:CreateFleetLocationsResponse' :: Maybe [LocationState]
locationStates = Maybe [LocationState]
a} :: CreateFleetLocationsResponse) ((Maybe [LocationState] -> f (Maybe [LocationState]))
 -> CreateFleetLocationsResponse -> f CreateFleetLocationsResponse)
-> ((Maybe [LocationState] -> f (Maybe [LocationState]))
    -> Maybe [LocationState] -> f (Maybe [LocationState]))
-> (Maybe [LocationState] -> f (Maybe [LocationState]))
-> CreateFleetLocationsResponse
-> f CreateFleetLocationsResponse
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

-- | A unique identifier for the fleet that was updated with new locations.
createFleetLocationsResponse_fleetId :: Lens.Lens' CreateFleetLocationsResponse (Prelude.Maybe Prelude.Text)
createFleetLocationsResponse_fleetId :: (Maybe Text -> f (Maybe Text))
-> CreateFleetLocationsResponse -> f CreateFleetLocationsResponse
createFleetLocationsResponse_fleetId = (CreateFleetLocationsResponse -> Maybe Text)
-> (CreateFleetLocationsResponse
    -> Maybe Text -> CreateFleetLocationsResponse)
-> Lens
     CreateFleetLocationsResponse
     CreateFleetLocationsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFleetLocationsResponse' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:CreateFleetLocationsResponse' :: CreateFleetLocationsResponse -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: CreateFleetLocationsResponse
s@CreateFleetLocationsResponse' {} Maybe Text
a -> CreateFleetLocationsResponse
s {$sel:fleetId:CreateFleetLocationsResponse' :: Maybe Text
fleetId = Maybe Text
a} :: CreateFleetLocationsResponse)

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

instance Prelude.NFData CreateFleetLocationsResponse