{-# 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.Panorama.Types.StorageLocation
-- 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.Panorama.Types.StorageLocation 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

-- | A storage location.
--
-- /See:/ 'newStorageLocation' smart constructor.
data StorageLocation = StorageLocation'
  { -- | The location\'s binary prefix.
    StorageLocation -> Text
binaryPrefixLocation :: Prelude.Text,
    -- | The location\'s bucket.
    StorageLocation -> Text
bucket :: Prelude.Text,
    -- | The location\'s generated prefix.
    StorageLocation -> Text
generatedPrefixLocation :: Prelude.Text,
    -- | The location\'s manifest prefix.
    StorageLocation -> Text
manifestPrefixLocation :: Prelude.Text,
    -- | The location\'s repo prefix.
    StorageLocation -> Text
repoPrefixLocation :: Prelude.Text
  }
  deriving (StorageLocation -> StorageLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StorageLocation -> StorageLocation -> Bool
$c/= :: StorageLocation -> StorageLocation -> Bool
== :: StorageLocation -> StorageLocation -> Bool
$c== :: StorageLocation -> StorageLocation -> Bool
Prelude.Eq, ReadPrec [StorageLocation]
ReadPrec StorageLocation
Int -> ReadS StorageLocation
ReadS [StorageLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StorageLocation]
$creadListPrec :: ReadPrec [StorageLocation]
readPrec :: ReadPrec StorageLocation
$creadPrec :: ReadPrec StorageLocation
readList :: ReadS [StorageLocation]
$creadList :: ReadS [StorageLocation]
readsPrec :: Int -> ReadS StorageLocation
$creadsPrec :: Int -> ReadS StorageLocation
Prelude.Read, Int -> StorageLocation -> ShowS
[StorageLocation] -> ShowS
StorageLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StorageLocation] -> ShowS
$cshowList :: [StorageLocation] -> ShowS
show :: StorageLocation -> String
$cshow :: StorageLocation -> String
showsPrec :: Int -> StorageLocation -> ShowS
$cshowsPrec :: Int -> StorageLocation -> ShowS
Prelude.Show, forall x. Rep StorageLocation x -> StorageLocation
forall x. StorageLocation -> Rep StorageLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StorageLocation x -> StorageLocation
$cfrom :: forall x. StorageLocation -> Rep StorageLocation x
Prelude.Generic)

-- |
-- Create a value of 'StorageLocation' 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:
--
-- 'binaryPrefixLocation', 'storageLocation_binaryPrefixLocation' - The location\'s binary prefix.
--
-- 'bucket', 'storageLocation_bucket' - The location\'s bucket.
--
-- 'generatedPrefixLocation', 'storageLocation_generatedPrefixLocation' - The location\'s generated prefix.
--
-- 'manifestPrefixLocation', 'storageLocation_manifestPrefixLocation' - The location\'s manifest prefix.
--
-- 'repoPrefixLocation', 'storageLocation_repoPrefixLocation' - The location\'s repo prefix.
newStorageLocation ::
  -- | 'binaryPrefixLocation'
  Prelude.Text ->
  -- | 'bucket'
  Prelude.Text ->
  -- | 'generatedPrefixLocation'
  Prelude.Text ->
  -- | 'manifestPrefixLocation'
  Prelude.Text ->
  -- | 'repoPrefixLocation'
  Prelude.Text ->
  StorageLocation
newStorageLocation :: Text -> Text -> Text -> Text -> Text -> StorageLocation
newStorageLocation
  Text
pBinaryPrefixLocation_
  Text
pBucket_
  Text
pGeneratedPrefixLocation_
  Text
pManifestPrefixLocation_
  Text
pRepoPrefixLocation_ =
    StorageLocation'
      { $sel:binaryPrefixLocation:StorageLocation' :: Text
binaryPrefixLocation =
          Text
pBinaryPrefixLocation_,
        $sel:bucket:StorageLocation' :: Text
bucket = Text
pBucket_,
        $sel:generatedPrefixLocation:StorageLocation' :: Text
generatedPrefixLocation = Text
pGeneratedPrefixLocation_,
        $sel:manifestPrefixLocation:StorageLocation' :: Text
manifestPrefixLocation = Text
pManifestPrefixLocation_,
        $sel:repoPrefixLocation:StorageLocation' :: Text
repoPrefixLocation = Text
pRepoPrefixLocation_
      }

-- | The location\'s binary prefix.
storageLocation_binaryPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_binaryPrefixLocation :: Lens' StorageLocation Text
storageLocation_binaryPrefixLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageLocation' {Text
binaryPrefixLocation :: Text
$sel:binaryPrefixLocation:StorageLocation' :: StorageLocation -> Text
binaryPrefixLocation} -> Text
binaryPrefixLocation) (\s :: StorageLocation
s@StorageLocation' {} Text
a -> StorageLocation
s {$sel:binaryPrefixLocation:StorageLocation' :: Text
binaryPrefixLocation = Text
a} :: StorageLocation)

-- | The location\'s bucket.
storageLocation_bucket :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_bucket :: Lens' StorageLocation Text
storageLocation_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageLocation' {Text
bucket :: Text
$sel:bucket:StorageLocation' :: StorageLocation -> Text
bucket} -> Text
bucket) (\s :: StorageLocation
s@StorageLocation' {} Text
a -> StorageLocation
s {$sel:bucket:StorageLocation' :: Text
bucket = Text
a} :: StorageLocation)

-- | The location\'s generated prefix.
storageLocation_generatedPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_generatedPrefixLocation :: Lens' StorageLocation Text
storageLocation_generatedPrefixLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageLocation' {Text
generatedPrefixLocation :: Text
$sel:generatedPrefixLocation:StorageLocation' :: StorageLocation -> Text
generatedPrefixLocation} -> Text
generatedPrefixLocation) (\s :: StorageLocation
s@StorageLocation' {} Text
a -> StorageLocation
s {$sel:generatedPrefixLocation:StorageLocation' :: Text
generatedPrefixLocation = Text
a} :: StorageLocation)

-- | The location\'s manifest prefix.
storageLocation_manifestPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_manifestPrefixLocation :: Lens' StorageLocation Text
storageLocation_manifestPrefixLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageLocation' {Text
manifestPrefixLocation :: Text
$sel:manifestPrefixLocation:StorageLocation' :: StorageLocation -> Text
manifestPrefixLocation} -> Text
manifestPrefixLocation) (\s :: StorageLocation
s@StorageLocation' {} Text
a -> StorageLocation
s {$sel:manifestPrefixLocation:StorageLocation' :: Text
manifestPrefixLocation = Text
a} :: StorageLocation)

-- | The location\'s repo prefix.
storageLocation_repoPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_repoPrefixLocation :: Lens' StorageLocation Text
storageLocation_repoPrefixLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StorageLocation' {Text
repoPrefixLocation :: Text
$sel:repoPrefixLocation:StorageLocation' :: StorageLocation -> Text
repoPrefixLocation} -> Text
repoPrefixLocation) (\s :: StorageLocation
s@StorageLocation' {} Text
a -> StorageLocation
s {$sel:repoPrefixLocation:StorageLocation' :: Text
repoPrefixLocation = Text
a} :: StorageLocation)

instance Data.FromJSON StorageLocation where
  parseJSON :: Value -> Parser StorageLocation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StorageLocation"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> Text -> StorageLocation
StorageLocation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"BinaryPrefixLocation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Bucket")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"GeneratedPrefixLocation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ManifestPrefixLocation")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RepoPrefixLocation")
      )

instance Prelude.Hashable StorageLocation where
  hashWithSalt :: Int -> StorageLocation -> Int
hashWithSalt Int
_salt StorageLocation' {Text
repoPrefixLocation :: Text
manifestPrefixLocation :: Text
generatedPrefixLocation :: Text
bucket :: Text
binaryPrefixLocation :: Text
$sel:repoPrefixLocation:StorageLocation' :: StorageLocation -> Text
$sel:manifestPrefixLocation:StorageLocation' :: StorageLocation -> Text
$sel:generatedPrefixLocation:StorageLocation' :: StorageLocation -> Text
$sel:bucket:StorageLocation' :: StorageLocation -> Text
$sel:binaryPrefixLocation:StorageLocation' :: StorageLocation -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
binaryPrefixLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bucket
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
generatedPrefixLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
manifestPrefixLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repoPrefixLocation

instance Prelude.NFData StorageLocation where
  rnf :: StorageLocation -> ()
rnf StorageLocation' {Text
repoPrefixLocation :: Text
manifestPrefixLocation :: Text
generatedPrefixLocation :: Text
bucket :: Text
binaryPrefixLocation :: Text
$sel:repoPrefixLocation:StorageLocation' :: StorageLocation -> Text
$sel:manifestPrefixLocation:StorageLocation' :: StorageLocation -> Text
$sel:generatedPrefixLocation:StorageLocation' :: StorageLocation -> Text
$sel:bucket:StorageLocation' :: StorageLocation -> Text
$sel:binaryPrefixLocation:StorageLocation' :: StorageLocation -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
binaryPrefixLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
generatedPrefixLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
manifestPrefixLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
repoPrefixLocation