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

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

-- |
-- Create a value of 'CustomerManagedChannelS3StorageSummary' 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', 'customerManagedChannelS3StorageSummary_bucket' - The name of the S3 bucket in which channel data is stored.
--
-- 'keyPrefix', 'customerManagedChannelS3StorageSummary_keyPrefix' - (Optional) The prefix used to create the keys of the channel data
-- objects. Each object in an S3 bucket has a key that is its unique
-- identifier within the bucket (each object in a bucket has exactly one
-- key). The prefix must end with a forward slash (\/).
--
-- 'roleArn', 'customerManagedChannelS3StorageSummary_roleArn' - The ARN of the role that grants IoT Analytics permission to interact
-- with your Amazon S3 resources.
newCustomerManagedChannelS3StorageSummary ::
  CustomerManagedChannelS3StorageSummary
newCustomerManagedChannelS3StorageSummary :: CustomerManagedChannelS3StorageSummary
newCustomerManagedChannelS3StorageSummary =
  CustomerManagedChannelS3StorageSummary'
    { $sel:bucket:CustomerManagedChannelS3StorageSummary' :: Maybe Text
bucket =
        forall a. Maybe a
Prelude.Nothing,
      $sel:keyPrefix:CustomerManagedChannelS3StorageSummary' :: Maybe Text
keyPrefix = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:CustomerManagedChannelS3StorageSummary' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the S3 bucket in which channel data is stored.
customerManagedChannelS3StorageSummary_bucket :: Lens.Lens' CustomerManagedChannelS3StorageSummary (Prelude.Maybe Prelude.Text)
customerManagedChannelS3StorageSummary_bucket :: Lens' CustomerManagedChannelS3StorageSummary (Maybe Text)
customerManagedChannelS3StorageSummary_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomerManagedChannelS3StorageSummary' {Maybe Text
bucket :: Maybe Text
$sel:bucket:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
bucket} -> Maybe Text
bucket) (\s :: CustomerManagedChannelS3StorageSummary
s@CustomerManagedChannelS3StorageSummary' {} Maybe Text
a -> CustomerManagedChannelS3StorageSummary
s {$sel:bucket:CustomerManagedChannelS3StorageSummary' :: Maybe Text
bucket = Maybe Text
a} :: CustomerManagedChannelS3StorageSummary)

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

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

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

instance
  Prelude.Hashable
    CustomerManagedChannelS3StorageSummary
  where
  hashWithSalt :: Int -> CustomerManagedChannelS3StorageSummary -> Int
hashWithSalt
    Int
_salt
    CustomerManagedChannelS3StorageSummary' {Maybe Text
roleArn :: Maybe Text
keyPrefix :: Maybe Text
bucket :: Maybe Text
$sel:roleArn:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
$sel:keyPrefix:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
$sel:bucket:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucket
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
keyPrefix
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn

instance
  Prelude.NFData
    CustomerManagedChannelS3StorageSummary
  where
  rnf :: CustomerManagedChannelS3StorageSummary -> ()
rnf CustomerManagedChannelS3StorageSummary' {Maybe Text
roleArn :: Maybe Text
keyPrefix :: Maybe Text
bucket :: Maybe Text
$sel:roleArn:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
$sel:keyPrefix:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
$sel:bucket:CustomerManagedChannelS3StorageSummary' :: CustomerManagedChannelS3StorageSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucket
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
keyPrefix
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn