{-# 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-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)
module Amazonka.Panorama.Types.StorageLocation where

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

-- | A storage location.
--
-- /See:/ 'newStorageLocation' smart constructor.
data StorageLocation = StorageLocation'
  { -- | The location\'s bucket.
    StorageLocation -> Text
bucket :: Prelude.Text,
    -- | The location\'s repo prefix.
    StorageLocation -> Text
repoPrefixLocation :: Prelude.Text,
    -- | The location\'s generated prefix.
    StorageLocation -> Text
generatedPrefixLocation :: Prelude.Text,
    -- | The location\'s binary prefix.
    StorageLocation -> Text
binaryPrefixLocation :: Prelude.Text,
    -- | The location\'s manifest prefix.
    StorageLocation -> Text
manifestPrefixLocation :: Prelude.Text
  }
  deriving (StorageLocation -> StorageLocation -> Bool
(StorageLocation -> StorageLocation -> Bool)
-> (StorageLocation -> StorageLocation -> Bool)
-> Eq StorageLocation
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]
(Int -> ReadS StorageLocation)
-> ReadS [StorageLocation]
-> ReadPrec StorageLocation
-> ReadPrec [StorageLocation]
-> Read 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
(Int -> StorageLocation -> ShowS)
-> (StorageLocation -> String)
-> ([StorageLocation] -> ShowS)
-> Show StorageLocation
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. StorageLocation -> Rep StorageLocation x)
-> (forall x. Rep StorageLocation x -> StorageLocation)
-> Generic StorageLocation
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:
--
-- 'bucket', 'storageLocation_bucket' - The location\'s bucket.
--
-- 'repoPrefixLocation', 'storageLocation_repoPrefixLocation' - The location\'s repo prefix.
--
-- 'generatedPrefixLocation', 'storageLocation_generatedPrefixLocation' - The location\'s generated prefix.
--
-- 'binaryPrefixLocation', 'storageLocation_binaryPrefixLocation' - The location\'s binary prefix.
--
-- 'manifestPrefixLocation', 'storageLocation_manifestPrefixLocation' - The location\'s manifest prefix.
newStorageLocation ::
  -- | 'bucket'
  Prelude.Text ->
  -- | 'repoPrefixLocation'
  Prelude.Text ->
  -- | 'generatedPrefixLocation'
  Prelude.Text ->
  -- | 'binaryPrefixLocation'
  Prelude.Text ->
  -- | 'manifestPrefixLocation'
  Prelude.Text ->
  StorageLocation
newStorageLocation :: Text -> Text -> Text -> Text -> Text -> StorageLocation
newStorageLocation
  Text
pBucket_
  Text
pRepoPrefixLocation_
  Text
pGeneratedPrefixLocation_
  Text
pBinaryPrefixLocation_
  Text
pManifestPrefixLocation_ =
    StorageLocation' :: Text -> Text -> Text -> Text -> Text -> StorageLocation
StorageLocation'
      { $sel:bucket:StorageLocation' :: Text
bucket = Text
pBucket_,
        $sel:repoPrefixLocation:StorageLocation' :: Text
repoPrefixLocation = Text
pRepoPrefixLocation_,
        $sel:generatedPrefixLocation:StorageLocation' :: Text
generatedPrefixLocation = Text
pGeneratedPrefixLocation_,
        $sel:binaryPrefixLocation:StorageLocation' :: Text
binaryPrefixLocation = Text
pBinaryPrefixLocation_,
        $sel:manifestPrefixLocation:StorageLocation' :: Text
manifestPrefixLocation = Text
pManifestPrefixLocation_
      }

-- | The location\'s bucket.
storageLocation_bucket :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_bucket :: (Text -> f Text) -> StorageLocation -> f StorageLocation
storageLocation_bucket = (StorageLocation -> Text)
-> (StorageLocation -> Text -> StorageLocation)
-> Lens StorageLocation StorageLocation Text Text
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 repo prefix.
storageLocation_repoPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_repoPrefixLocation :: (Text -> f Text) -> StorageLocation -> f StorageLocation
storageLocation_repoPrefixLocation = (StorageLocation -> Text)
-> (StorageLocation -> Text -> StorageLocation)
-> Lens StorageLocation StorageLocation Text Text
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)

-- | The location\'s generated prefix.
storageLocation_generatedPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_generatedPrefixLocation :: (Text -> f Text) -> StorageLocation -> f StorageLocation
storageLocation_generatedPrefixLocation = (StorageLocation -> Text)
-> (StorageLocation -> Text -> StorageLocation)
-> Lens StorageLocation StorageLocation Text Text
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 binary prefix.
storageLocation_binaryPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_binaryPrefixLocation :: (Text -> f Text) -> StorageLocation -> f StorageLocation
storageLocation_binaryPrefixLocation = (StorageLocation -> Text)
-> (StorageLocation -> Text -> StorageLocation)
-> Lens StorageLocation StorageLocation Text Text
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 manifest prefix.
storageLocation_manifestPrefixLocation :: Lens.Lens' StorageLocation Prelude.Text
storageLocation_manifestPrefixLocation :: (Text -> f Text) -> StorageLocation -> f StorageLocation
storageLocation_manifestPrefixLocation = (StorageLocation -> Text)
-> (StorageLocation -> Text -> StorageLocation)
-> Lens StorageLocation StorageLocation Text Text
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)

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

instance Prelude.Hashable StorageLocation

instance Prelude.NFData StorageLocation