{-# 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.IoTAnalytics.Types.IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-- 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.IoTAnalytics.Types.IotSiteWiseCustomerManagedDatastoreS3StorageSummary where

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

-- | Contains information about the data store that you manage, which stores
-- data used by IoT SiteWise.
--
-- /See:/ 'newIotSiteWiseCustomerManagedDatastoreS3StorageSummary' smart constructor.
data IotSiteWiseCustomerManagedDatastoreS3StorageSummary = IotSiteWiseCustomerManagedDatastoreS3StorageSummary'
  { -- | The name of the Amazon S3 bucket where your data is stored.
    IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Maybe Text
bucket :: Prelude.Maybe Prelude.Text,
    -- | (Optional) The prefix used to create the keys of the data store data
    -- objects. Each object in an Amazon S3 bucket has a key that is its unique
    -- identifier in the bucket. Each object in a bucket has exactly one key.
    -- The prefix must end with a forward slash (\/).
    IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Maybe Text
keyPrefix :: Prelude.Maybe Prelude.Text
  }
  deriving (IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool
(IotSiteWiseCustomerManagedDatastoreS3StorageSummary
 -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool)
-> (IotSiteWiseCustomerManagedDatastoreS3StorageSummary
    -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool)
-> Eq IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool
$c/= :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool
== :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool
$c== :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Bool
Prelude.Eq, ReadPrec [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
ReadPrec IotSiteWiseCustomerManagedDatastoreS3StorageSummary
Int -> ReadS IotSiteWiseCustomerManagedDatastoreS3StorageSummary
ReadS [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
(Int -> ReadS IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> ReadS [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
-> ReadPrec IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> ReadPrec [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
-> Read IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
$creadListPrec :: ReadPrec [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
readPrec :: ReadPrec IotSiteWiseCustomerManagedDatastoreS3StorageSummary
$creadPrec :: ReadPrec IotSiteWiseCustomerManagedDatastoreS3StorageSummary
readList :: ReadS [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
$creadList :: ReadS [IotSiteWiseCustomerManagedDatastoreS3StorageSummary]
readsPrec :: Int -> ReadS IotSiteWiseCustomerManagedDatastoreS3StorageSummary
$creadsPrec :: Int -> ReadS IotSiteWiseCustomerManagedDatastoreS3StorageSummary
Prelude.Read, Int -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> ShowS
[IotSiteWiseCustomerManagedDatastoreS3StorageSummary] -> ShowS
IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> String
(Int
 -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> ShowS)
-> (IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> String)
-> ([IotSiteWiseCustomerManagedDatastoreS3StorageSummary] -> ShowS)
-> Show IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IotSiteWiseCustomerManagedDatastoreS3StorageSummary] -> ShowS
$cshowList :: [IotSiteWiseCustomerManagedDatastoreS3StorageSummary] -> ShowS
show :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> String
$cshow :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> String
showsPrec :: Int -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> ShowS
$cshowsPrec :: Int -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> ShowS
Prelude.Show, (forall x.
 IotSiteWiseCustomerManagedDatastoreS3StorageSummary
 -> Rep IotSiteWiseCustomerManagedDatastoreS3StorageSummary x)
-> (forall x.
    Rep IotSiteWiseCustomerManagedDatastoreS3StorageSummary x
    -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> Generic IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall x.
Rep IotSiteWiseCustomerManagedDatastoreS3StorageSummary x
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall x.
IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> Rep IotSiteWiseCustomerManagedDatastoreS3StorageSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep IotSiteWiseCustomerManagedDatastoreS3StorageSummary x
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
$cfrom :: forall x.
IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> Rep IotSiteWiseCustomerManagedDatastoreS3StorageSummary x
Prelude.Generic)

-- |
-- Create a value of 'IotSiteWiseCustomerManagedDatastoreS3StorageSummary' 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', 'iotSiteWiseCustomerManagedDatastoreS3StorageSummary_bucket' - The name of the Amazon S3 bucket where your data is stored.
--
-- 'keyPrefix', 'iotSiteWiseCustomerManagedDatastoreS3StorageSummary_keyPrefix' - (Optional) The prefix used to create the keys of the data store data
-- objects. Each object in an Amazon S3 bucket has a key that is its unique
-- identifier in the bucket. Each object in a bucket has exactly one key.
-- The prefix must end with a forward slash (\/).
newIotSiteWiseCustomerManagedDatastoreS3StorageSummary ::
  IotSiteWiseCustomerManagedDatastoreS3StorageSummary
newIotSiteWiseCustomerManagedDatastoreS3StorageSummary :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
newIotSiteWiseCustomerManagedDatastoreS3StorageSummary =
  IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: Maybe Text
-> Maybe Text
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
IotSiteWiseCustomerManagedDatastoreS3StorageSummary'
    { $sel:bucket:IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: Maybe Text
bucket =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keyPrefix:IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: Maybe Text
keyPrefix =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the Amazon S3 bucket where your data is stored.
iotSiteWiseCustomerManagedDatastoreS3StorageSummary_bucket :: Lens.Lens' IotSiteWiseCustomerManagedDatastoreS3StorageSummary (Prelude.Maybe Prelude.Text)
iotSiteWiseCustomerManagedDatastoreS3StorageSummary_bucket :: (Maybe Text -> f (Maybe Text))
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> f IotSiteWiseCustomerManagedDatastoreS3StorageSummary
iotSiteWiseCustomerManagedDatastoreS3StorageSummary_bucket = (IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Maybe Text)
-> (IotSiteWiseCustomerManagedDatastoreS3StorageSummary
    -> Maybe Text
    -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> Lens
     IotSiteWiseCustomerManagedDatastoreS3StorageSummary
     IotSiteWiseCustomerManagedDatastoreS3StorageSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseCustomerManagedDatastoreS3StorageSummary' {Maybe Text
bucket :: Maybe Text
$sel:bucket:IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Maybe Text
bucket} -> Maybe Text
bucket) (\s :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
s@IotSiteWiseCustomerManagedDatastoreS3StorageSummary' {} Maybe Text
a -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
s {$sel:bucket:IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: Maybe Text
bucket = Maybe Text
a} :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary)

-- | (Optional) The prefix used to create the keys of the data store data
-- objects. Each object in an Amazon S3 bucket has a key that is its unique
-- identifier in the bucket. Each object in a bucket has exactly one key.
-- The prefix must end with a forward slash (\/).
iotSiteWiseCustomerManagedDatastoreS3StorageSummary_keyPrefix :: Lens.Lens' IotSiteWiseCustomerManagedDatastoreS3StorageSummary (Prelude.Maybe Prelude.Text)
iotSiteWiseCustomerManagedDatastoreS3StorageSummary_keyPrefix :: (Maybe Text -> f (Maybe Text))
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
-> f IotSiteWiseCustomerManagedDatastoreS3StorageSummary
iotSiteWiseCustomerManagedDatastoreS3StorageSummary_keyPrefix = (IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Maybe Text)
-> (IotSiteWiseCustomerManagedDatastoreS3StorageSummary
    -> Maybe Text
    -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> Lens
     IotSiteWiseCustomerManagedDatastoreS3StorageSummary
     IotSiteWiseCustomerManagedDatastoreS3StorageSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IotSiteWiseCustomerManagedDatastoreS3StorageSummary' {Maybe Text
keyPrefix :: Maybe Text
$sel:keyPrefix:IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary -> Maybe Text
keyPrefix} -> Maybe Text
keyPrefix) (\s :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary
s@IotSiteWiseCustomerManagedDatastoreS3StorageSummary' {} Maybe Text
a -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
s {$sel:keyPrefix:IotSiteWiseCustomerManagedDatastoreS3StorageSummary' :: Maybe Text
keyPrefix = Maybe Text
a} :: IotSiteWiseCustomerManagedDatastoreS3StorageSummary)

instance
  Core.FromJSON
    IotSiteWiseCustomerManagedDatastoreS3StorageSummary
  where
  parseJSON :: Value -> Parser IotSiteWiseCustomerManagedDatastoreS3StorageSummary
parseJSON =
    String
-> (Object
    -> Parser IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> Value
-> Parser IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IotSiteWiseCustomerManagedDatastoreS3StorageSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> IotSiteWiseCustomerManagedDatastoreS3StorageSummary
IotSiteWiseCustomerManagedDatastoreS3StorageSummary'
            (Maybe Text
 -> Maybe Text
 -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucket")
              Parser
  (Maybe Text -> IotSiteWiseCustomerManagedDatastoreS3StorageSummary)
-> Parser (Maybe Text)
-> Parser IotSiteWiseCustomerManagedDatastoreS3StorageSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"keyPrefix")
      )

instance
  Prelude.Hashable
    IotSiteWiseCustomerManagedDatastoreS3StorageSummary

instance
  Prelude.NFData
    IotSiteWiseCustomerManagedDatastoreS3StorageSummary