{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.LocationModel
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GameLift.Types.LocationModel where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Properties of a location
--
-- /See:/ 'newLocationModel' smart constructor.
data LocationModel = LocationModel'
  { -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- that is assigned to a GameLift location resource and uniquely identifies
    -- it. ARNs are unique across all Regions. Format is
    -- @arn:aws:gamelift:\<region>::location\/location-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
    LocationModel -> Maybe Text
locationArn :: Prelude.Maybe Prelude.Text,
    -- | The location\'s name.
    LocationModel -> Maybe Text
locationName :: Prelude.Maybe Prelude.Text
  }
  deriving (LocationModel -> LocationModel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocationModel -> LocationModel -> Bool
$c/= :: LocationModel -> LocationModel -> Bool
== :: LocationModel -> LocationModel -> Bool
$c== :: LocationModel -> LocationModel -> Bool
Prelude.Eq, ReadPrec [LocationModel]
ReadPrec LocationModel
Int -> ReadS LocationModel
ReadS [LocationModel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocationModel]
$creadListPrec :: ReadPrec [LocationModel]
readPrec :: ReadPrec LocationModel
$creadPrec :: ReadPrec LocationModel
readList :: ReadS [LocationModel]
$creadList :: ReadS [LocationModel]
readsPrec :: Int -> ReadS LocationModel
$creadsPrec :: Int -> ReadS LocationModel
Prelude.Read, Int -> LocationModel -> ShowS
[LocationModel] -> ShowS
LocationModel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocationModel] -> ShowS
$cshowList :: [LocationModel] -> ShowS
show :: LocationModel -> String
$cshow :: LocationModel -> String
showsPrec :: Int -> LocationModel -> ShowS
$cshowsPrec :: Int -> LocationModel -> ShowS
Prelude.Show, forall x. Rep LocationModel x -> LocationModel
forall x. LocationModel -> Rep LocationModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocationModel x -> LocationModel
$cfrom :: forall x. LocationModel -> Rep LocationModel x
Prelude.Generic)

-- |
-- Create a value of 'LocationModel' 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:
--
-- 'locationArn', 'locationModel_locationArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- that is assigned to a GameLift location resource and uniquely identifies
-- it. ARNs are unique across all Regions. Format is
-- @arn:aws:gamelift:\<region>::location\/location-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912@.
--
-- 'locationName', 'locationModel_locationName' - The location\'s name.
newLocationModel ::
  LocationModel
newLocationModel :: LocationModel
newLocationModel =
  LocationModel'
    { $sel:locationArn:LocationModel' :: Maybe Text
locationArn = forall a. Maybe a
Prelude.Nothing,
      $sel:locationName:LocationModel' :: Maybe Text
locationName = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The location\'s name.
locationModel_locationName :: Lens.Lens' LocationModel (Prelude.Maybe Prelude.Text)
locationModel_locationName :: Lens' LocationModel (Maybe Text)
locationModel_locationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocationModel' {Maybe Text
locationName :: Maybe Text
$sel:locationName:LocationModel' :: LocationModel -> Maybe Text
locationName} -> Maybe Text
locationName) (\s :: LocationModel
s@LocationModel' {} Maybe Text
a -> LocationModel
s {$sel:locationName:LocationModel' :: Maybe Text
locationName = Maybe Text
a} :: LocationModel)

instance Data.FromJSON LocationModel where
  parseJSON :: Value -> Parser LocationModel
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LocationModel"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> LocationModel
LocationModel'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LocationArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LocationName")
      )

instance Prelude.Hashable LocationModel where
  hashWithSalt :: Int -> LocationModel -> Int
hashWithSalt Int
_salt LocationModel' {Maybe Text
locationName :: Maybe Text
locationArn :: Maybe Text
$sel:locationName:LocationModel' :: LocationModel -> Maybe Text
$sel:locationArn:LocationModel' :: LocationModel -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
locationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
locationName

instance Prelude.NFData LocationModel where
  rnf :: LocationModel -> ()
rnf LocationModel' {Maybe Text
locationName :: Maybe Text
locationArn :: Maybe Text
$sel:locationName:LocationModel' :: LocationModel -> Maybe Text
$sel:locationArn:LocationModel' :: LocationModel -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locationName