{-# 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.CustomerManagedDatastoreS3StorageSummary
-- 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.CustomerManagedDatastoreS3StorageSummary 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.
--
-- /See:/ 'newCustomerManagedDatastoreS3StorageSummary' smart constructor.
data CustomerManagedDatastoreS3StorageSummary = CustomerManagedDatastoreS3StorageSummary'
  { -- | The name of the Amazon S3 bucket where your data is stored.
    CustomerManagedDatastoreS3StorageSummary -> 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 (\/).
    CustomerManagedDatastoreS3StorageSummary -> Maybe Text
keyPrefix :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the role that grants IoT Analytics permission to interact
    -- with your Amazon S3 resources.
    CustomerManagedDatastoreS3StorageSummary -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (CustomerManagedDatastoreS3StorageSummary
-> CustomerManagedDatastoreS3StorageSummary -> Bool
(CustomerManagedDatastoreS3StorageSummary
 -> CustomerManagedDatastoreS3StorageSummary -> Bool)
-> (CustomerManagedDatastoreS3StorageSummary
    -> CustomerManagedDatastoreS3StorageSummary -> Bool)
-> Eq CustomerManagedDatastoreS3StorageSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomerManagedDatastoreS3StorageSummary
-> CustomerManagedDatastoreS3StorageSummary -> Bool
$c/= :: CustomerManagedDatastoreS3StorageSummary
-> CustomerManagedDatastoreS3StorageSummary -> Bool
== :: CustomerManagedDatastoreS3StorageSummary
-> CustomerManagedDatastoreS3StorageSummary -> Bool
$c== :: CustomerManagedDatastoreS3StorageSummary
-> CustomerManagedDatastoreS3StorageSummary -> Bool
Prelude.Eq, ReadPrec [CustomerManagedDatastoreS3StorageSummary]
ReadPrec CustomerManagedDatastoreS3StorageSummary
Int -> ReadS CustomerManagedDatastoreS3StorageSummary
ReadS [CustomerManagedDatastoreS3StorageSummary]
(Int -> ReadS CustomerManagedDatastoreS3StorageSummary)
-> ReadS [CustomerManagedDatastoreS3StorageSummary]
-> ReadPrec CustomerManagedDatastoreS3StorageSummary
-> ReadPrec [CustomerManagedDatastoreS3StorageSummary]
-> Read CustomerManagedDatastoreS3StorageSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomerManagedDatastoreS3StorageSummary]
$creadListPrec :: ReadPrec [CustomerManagedDatastoreS3StorageSummary]
readPrec :: ReadPrec CustomerManagedDatastoreS3StorageSummary
$creadPrec :: ReadPrec CustomerManagedDatastoreS3StorageSummary
readList :: ReadS [CustomerManagedDatastoreS3StorageSummary]
$creadList :: ReadS [CustomerManagedDatastoreS3StorageSummary]
readsPrec :: Int -> ReadS CustomerManagedDatastoreS3StorageSummary
$creadsPrec :: Int -> ReadS CustomerManagedDatastoreS3StorageSummary
Prelude.Read, Int -> CustomerManagedDatastoreS3StorageSummary -> ShowS
[CustomerManagedDatastoreS3StorageSummary] -> ShowS
CustomerManagedDatastoreS3StorageSummary -> String
(Int -> CustomerManagedDatastoreS3StorageSummary -> ShowS)
-> (CustomerManagedDatastoreS3StorageSummary -> String)
-> ([CustomerManagedDatastoreS3StorageSummary] -> ShowS)
-> Show CustomerManagedDatastoreS3StorageSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomerManagedDatastoreS3StorageSummary] -> ShowS
$cshowList :: [CustomerManagedDatastoreS3StorageSummary] -> ShowS
show :: CustomerManagedDatastoreS3StorageSummary -> String
$cshow :: CustomerManagedDatastoreS3StorageSummary -> String
showsPrec :: Int -> CustomerManagedDatastoreS3StorageSummary -> ShowS
$cshowsPrec :: Int -> CustomerManagedDatastoreS3StorageSummary -> ShowS
Prelude.Show, (forall x.
 CustomerManagedDatastoreS3StorageSummary
 -> Rep CustomerManagedDatastoreS3StorageSummary x)
-> (forall x.
    Rep CustomerManagedDatastoreS3StorageSummary x
    -> CustomerManagedDatastoreS3StorageSummary)
-> Generic CustomerManagedDatastoreS3StorageSummary
forall x.
Rep CustomerManagedDatastoreS3StorageSummary x
-> CustomerManagedDatastoreS3StorageSummary
forall x.
CustomerManagedDatastoreS3StorageSummary
-> Rep CustomerManagedDatastoreS3StorageSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomerManagedDatastoreS3StorageSummary x
-> CustomerManagedDatastoreS3StorageSummary
$cfrom :: forall x.
CustomerManagedDatastoreS3StorageSummary
-> Rep CustomerManagedDatastoreS3StorageSummary x
Prelude.Generic)

-- |
-- Create a value of 'CustomerManagedDatastoreS3StorageSummary' 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', 'customerManagedDatastoreS3StorageSummary_bucket' - The name of the Amazon S3 bucket where your data is stored.
--
-- 'keyPrefix', 'customerManagedDatastoreS3StorageSummary_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 (\/).
--
-- 'roleArn', 'customerManagedDatastoreS3StorageSummary_roleArn' - The ARN of the role that grants IoT Analytics permission to interact
-- with your Amazon S3 resources.
newCustomerManagedDatastoreS3StorageSummary ::
  CustomerManagedDatastoreS3StorageSummary
newCustomerManagedDatastoreS3StorageSummary :: CustomerManagedDatastoreS3StorageSummary
newCustomerManagedDatastoreS3StorageSummary =
  CustomerManagedDatastoreS3StorageSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomerManagedDatastoreS3StorageSummary
CustomerManagedDatastoreS3StorageSummary'
    { $sel:bucket:CustomerManagedDatastoreS3StorageSummary' :: Maybe Text
bucket =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keyPrefix:CustomerManagedDatastoreS3StorageSummary' :: Maybe Text
keyPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:CustomerManagedDatastoreS3StorageSummary' :: Maybe Text
roleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | (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 (\/).
customerManagedDatastoreS3StorageSummary_keyPrefix :: Lens.Lens' CustomerManagedDatastoreS3StorageSummary (Prelude.Maybe Prelude.Text)
customerManagedDatastoreS3StorageSummary_keyPrefix :: (Maybe Text -> f (Maybe Text))
-> CustomerManagedDatastoreS3StorageSummary
-> f CustomerManagedDatastoreS3StorageSummary
customerManagedDatastoreS3StorageSummary_keyPrefix = (CustomerManagedDatastoreS3StorageSummary -> Maybe Text)
-> (CustomerManagedDatastoreS3StorageSummary
    -> Maybe Text -> CustomerManagedDatastoreS3StorageSummary)
-> Lens
     CustomerManagedDatastoreS3StorageSummary
     CustomerManagedDatastoreS3StorageSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerManagedDatastoreS3StorageSummary' {Maybe Text
keyPrefix :: Maybe Text
$sel:keyPrefix:CustomerManagedDatastoreS3StorageSummary' :: CustomerManagedDatastoreS3StorageSummary -> Maybe Text
keyPrefix} -> Maybe Text
keyPrefix) (\s :: CustomerManagedDatastoreS3StorageSummary
s@CustomerManagedDatastoreS3StorageSummary' {} Maybe Text
a -> CustomerManagedDatastoreS3StorageSummary
s {$sel:keyPrefix:CustomerManagedDatastoreS3StorageSummary' :: Maybe Text
keyPrefix = Maybe Text
a} :: CustomerManagedDatastoreS3StorageSummary)

-- | The ARN of the role that grants IoT Analytics permission to interact
-- with your Amazon S3 resources.
customerManagedDatastoreS3StorageSummary_roleArn :: Lens.Lens' CustomerManagedDatastoreS3StorageSummary (Prelude.Maybe Prelude.Text)
customerManagedDatastoreS3StorageSummary_roleArn :: (Maybe Text -> f (Maybe Text))
-> CustomerManagedDatastoreS3StorageSummary
-> f CustomerManagedDatastoreS3StorageSummary
customerManagedDatastoreS3StorageSummary_roleArn = (CustomerManagedDatastoreS3StorageSummary -> Maybe Text)
-> (CustomerManagedDatastoreS3StorageSummary
    -> Maybe Text -> CustomerManagedDatastoreS3StorageSummary)
-> Lens
     CustomerManagedDatastoreS3StorageSummary
     CustomerManagedDatastoreS3StorageSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerManagedDatastoreS3StorageSummary' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:CustomerManagedDatastoreS3StorageSummary' :: CustomerManagedDatastoreS3StorageSummary -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: CustomerManagedDatastoreS3StorageSummary
s@CustomerManagedDatastoreS3StorageSummary' {} Maybe Text
a -> CustomerManagedDatastoreS3StorageSummary
s {$sel:roleArn:CustomerManagedDatastoreS3StorageSummary' :: Maybe Text
roleArn = Maybe Text
a} :: CustomerManagedDatastoreS3StorageSummary)

instance
  Core.FromJSON
    CustomerManagedDatastoreS3StorageSummary
  where
  parseJSON :: Value -> Parser CustomerManagedDatastoreS3StorageSummary
parseJSON =
    String
-> (Object -> Parser CustomerManagedDatastoreS3StorageSummary)
-> Value
-> Parser CustomerManagedDatastoreS3StorageSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CustomerManagedDatastoreS3StorageSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> CustomerManagedDatastoreS3StorageSummary
CustomerManagedDatastoreS3StorageSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> CustomerManagedDatastoreS3StorageSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> CustomerManagedDatastoreS3StorageSummary)
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
   -> Maybe Text -> CustomerManagedDatastoreS3StorageSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> CustomerManagedDatastoreS3StorageSummary)
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")
            Parser (Maybe Text -> CustomerManagedDatastoreS3StorageSummary)
-> Parser (Maybe Text)
-> Parser CustomerManagedDatastoreS3StorageSummary
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
"roleArn")
      )

instance
  Prelude.Hashable
    CustomerManagedDatastoreS3StorageSummary

instance
  Prelude.NFData
    CustomerManagedDatastoreS3StorageSummary