{-# 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.SecurityLake.Types.SubscriberResource
-- 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.SecurityLake.Types.SubscriberResource 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
import Amazonka.SecurityLake.Types.AccessType
import Amazonka.SecurityLake.Types.EndpointProtocol
import Amazonka.SecurityLake.Types.SourceType
import Amazonka.SecurityLake.Types.SubscriptionStatus

-- | Provides details about the Amazon Security Lake account subscription.
-- Subscribers are notified of new objects for a source as the data is
-- written to your Amazon S3 bucket for Security Lake.
--
-- /See:/ 'newSubscriberResource' smart constructor.
data SubscriberResource = SubscriberResource'
  { -- | You can choose to notify subscribers of new objects with an Amazon
    -- Simple Queue Service (Amazon SQS) queue or through messaging to an HTTPS
    -- endpoint provided by the subscriber.
    --
    -- Subscribers can consume data by directly querying Lake Formation tables
    -- in your Amazon S3 bucket through services like Amazon Athena. This
    -- subscription type is defined as @LAKEFORMATION@.
    SubscriberResource -> Maybe [AccessType]
accessTypes :: Prelude.Maybe [AccessType],
    -- | The date and time when the subscription was created.
    SubscriberResource -> Maybe ISO8601
createdAt :: Prelude.Maybe Data.ISO8601,
    -- | The external ID of the subscriber. The external ID lets the user that is
    -- assuming the role assert the circumstances in which they are operating.
    -- It also provides a way for the account owner to permit the role to be
    -- assumed only under specific circumstances.
    SubscriberResource -> Maybe Text
externalId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) specifying the role of the subscriber.
    SubscriberResource -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN for the Amazon S3 bucket.
    SubscriberResource -> Maybe Text
s3BucketArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN for the Amazon Simple Notification Service.
    SubscriberResource -> Maybe Text
snsArn :: Prelude.Maybe Prelude.Text,
    -- | The subscriber descriptions for a subscriber account. The description
    -- for a subscriber includes @subscriberName@, @accountID@, @externalID@,
    -- and @subscriptionId@.
    SubscriberResource -> Maybe Text
subscriberDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of your Amazon Security Lake subscriber account.
    SubscriberResource -> Maybe Text
subscriberName :: Prelude.Maybe Prelude.Text,
    -- | The subscription endpoint to which exception messages are posted.
    SubscriberResource -> Maybe Text
subscriptionEndpoint :: Prelude.Maybe Prelude.Text,
    -- | The subscription protocol to which exception messages are posted.
    SubscriberResource -> Maybe EndpointProtocol
subscriptionProtocol :: Prelude.Maybe EndpointProtocol,
    -- | The subscription status of the Amazon Security Lake subscriber account.
    SubscriberResource -> Maybe SubscriptionStatus
subscriptionStatus :: Prelude.Maybe SubscriptionStatus,
    -- | The date and time when the subscription was created.
    SubscriberResource -> Maybe ISO8601
updatedAt :: Prelude.Maybe Data.ISO8601,
    -- | The Amazon Web Services account ID you are using to create your Amazon
    -- Security Lake account.
    SubscriberResource -> Text
accountId :: Prelude.Text,
    -- | Amazon Security Lake supports log and event collection for natively
    -- supported Amazon Web Services. For more information, see the Amazon
    -- Security Lake User Guide.
    SubscriberResource -> [SourceType]
sourceTypes :: [SourceType],
    -- | The subscription ID of the Amazon Security Lake subscriber account.
    SubscriberResource -> Text
subscriptionId :: Prelude.Text
  }
  deriving (SubscriberResource -> SubscriberResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubscriberResource -> SubscriberResource -> Bool
$c/= :: SubscriberResource -> SubscriberResource -> Bool
== :: SubscriberResource -> SubscriberResource -> Bool
$c== :: SubscriberResource -> SubscriberResource -> Bool
Prelude.Eq, ReadPrec [SubscriberResource]
ReadPrec SubscriberResource
Int -> ReadS SubscriberResource
ReadS [SubscriberResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubscriberResource]
$creadListPrec :: ReadPrec [SubscriberResource]
readPrec :: ReadPrec SubscriberResource
$creadPrec :: ReadPrec SubscriberResource
readList :: ReadS [SubscriberResource]
$creadList :: ReadS [SubscriberResource]
readsPrec :: Int -> ReadS SubscriberResource
$creadsPrec :: Int -> ReadS SubscriberResource
Prelude.Read, Int -> SubscriberResource -> ShowS
[SubscriberResource] -> ShowS
SubscriberResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubscriberResource] -> ShowS
$cshowList :: [SubscriberResource] -> ShowS
show :: SubscriberResource -> String
$cshow :: SubscriberResource -> String
showsPrec :: Int -> SubscriberResource -> ShowS
$cshowsPrec :: Int -> SubscriberResource -> ShowS
Prelude.Show, forall x. Rep SubscriberResource x -> SubscriberResource
forall x. SubscriberResource -> Rep SubscriberResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SubscriberResource x -> SubscriberResource
$cfrom :: forall x. SubscriberResource -> Rep SubscriberResource x
Prelude.Generic)

-- |
-- Create a value of 'SubscriberResource' 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:
--
-- 'accessTypes', 'subscriberResource_accessTypes' - You can choose to notify subscribers of new objects with an Amazon
-- Simple Queue Service (Amazon SQS) queue or through messaging to an HTTPS
-- endpoint provided by the subscriber.
--
-- Subscribers can consume data by directly querying Lake Formation tables
-- in your Amazon S3 bucket through services like Amazon Athena. This
-- subscription type is defined as @LAKEFORMATION@.
--
-- 'createdAt', 'subscriberResource_createdAt' - The date and time when the subscription was created.
--
-- 'externalId', 'subscriberResource_externalId' - The external ID of the subscriber. The external ID lets the user that is
-- assuming the role assert the circumstances in which they are operating.
-- It also provides a way for the account owner to permit the role to be
-- assumed only under specific circumstances.
--
-- 'roleArn', 'subscriberResource_roleArn' - The Amazon Resource Name (ARN) specifying the role of the subscriber.
--
-- 's3BucketArn', 'subscriberResource_s3BucketArn' - The ARN for the Amazon S3 bucket.
--
-- 'snsArn', 'subscriberResource_snsArn' - The ARN for the Amazon Simple Notification Service.
--
-- 'subscriberDescription', 'subscriberResource_subscriberDescription' - The subscriber descriptions for a subscriber account. The description
-- for a subscriber includes @subscriberName@, @accountID@, @externalID@,
-- and @subscriptionId@.
--
-- 'subscriberName', 'subscriberResource_subscriberName' - The name of your Amazon Security Lake subscriber account.
--
-- 'subscriptionEndpoint', 'subscriberResource_subscriptionEndpoint' - The subscription endpoint to which exception messages are posted.
--
-- 'subscriptionProtocol', 'subscriberResource_subscriptionProtocol' - The subscription protocol to which exception messages are posted.
--
-- 'subscriptionStatus', 'subscriberResource_subscriptionStatus' - The subscription status of the Amazon Security Lake subscriber account.
--
-- 'updatedAt', 'subscriberResource_updatedAt' - The date and time when the subscription was created.
--
-- 'accountId', 'subscriberResource_accountId' - The Amazon Web Services account ID you are using to create your Amazon
-- Security Lake account.
--
-- 'sourceTypes', 'subscriberResource_sourceTypes' - Amazon Security Lake supports log and event collection for natively
-- supported Amazon Web Services. For more information, see the Amazon
-- Security Lake User Guide.
--
-- 'subscriptionId', 'subscriberResource_subscriptionId' - The subscription ID of the Amazon Security Lake subscriber account.
newSubscriberResource ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'subscriptionId'
  Prelude.Text ->
  SubscriberResource
newSubscriberResource :: Text -> Text -> SubscriberResource
newSubscriberResource Text
pAccountId_ Text
pSubscriptionId_ =
  SubscriberResource'
    { $sel:accessTypes:SubscriberResource' :: Maybe [AccessType]
accessTypes = forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:SubscriberResource' :: Maybe ISO8601
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:externalId:SubscriberResource' :: Maybe Text
externalId = forall a. Maybe a
Prelude.Nothing,
      $sel:roleArn:SubscriberResource' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:s3BucketArn:SubscriberResource' :: Maybe Text
s3BucketArn = forall a. Maybe a
Prelude.Nothing,
      $sel:snsArn:SubscriberResource' :: Maybe Text
snsArn = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriberDescription:SubscriberResource' :: Maybe Text
subscriberDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriberName:SubscriberResource' :: Maybe Text
subscriberName = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionEndpoint:SubscriberResource' :: Maybe Text
subscriptionEndpoint = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionProtocol:SubscriberResource' :: Maybe EndpointProtocol
subscriptionProtocol = forall a. Maybe a
Prelude.Nothing,
      $sel:subscriptionStatus:SubscriberResource' :: Maybe SubscriptionStatus
subscriptionStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:SubscriberResource' :: Maybe ISO8601
updatedAt = forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:SubscriberResource' :: Text
accountId = Text
pAccountId_,
      $sel:sourceTypes:SubscriberResource' :: [SourceType]
sourceTypes = forall a. Monoid a => a
Prelude.mempty,
      $sel:subscriptionId:SubscriberResource' :: Text
subscriptionId = Text
pSubscriptionId_
    }

-- | You can choose to notify subscribers of new objects with an Amazon
-- Simple Queue Service (Amazon SQS) queue or through messaging to an HTTPS
-- endpoint provided by the subscriber.
--
-- Subscribers can consume data by directly querying Lake Formation tables
-- in your Amazon S3 bucket through services like Amazon Athena. This
-- subscription type is defined as @LAKEFORMATION@.
subscriberResource_accessTypes :: Lens.Lens' SubscriberResource (Prelude.Maybe [AccessType])
subscriberResource_accessTypes :: Lens' SubscriberResource (Maybe [AccessType])
subscriberResource_accessTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe [AccessType]
accessTypes :: Maybe [AccessType]
$sel:accessTypes:SubscriberResource' :: SubscriberResource -> Maybe [AccessType]
accessTypes} -> Maybe [AccessType]
accessTypes) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe [AccessType]
a -> SubscriberResource
s {$sel:accessTypes:SubscriberResource' :: Maybe [AccessType]
accessTypes = Maybe [AccessType]
a} :: SubscriberResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date and time when the subscription was created.
subscriberResource_createdAt :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.UTCTime)
subscriberResource_createdAt :: Lens' SubscriberResource (Maybe UTCTime)
subscriberResource_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe ISO8601
createdAt :: Maybe ISO8601
$sel:createdAt:SubscriberResource' :: SubscriberResource -> Maybe ISO8601
createdAt} -> Maybe ISO8601
createdAt) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe ISO8601
a -> SubscriberResource
s {$sel:createdAt:SubscriberResource' :: Maybe ISO8601
createdAt = Maybe ISO8601
a} :: SubscriberResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The external ID of the subscriber. The external ID lets the user that is
-- assuming the role assert the circumstances in which they are operating.
-- It also provides a way for the account owner to permit the role to be
-- assumed only under specific circumstances.
subscriberResource_externalId :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_externalId :: Lens' SubscriberResource (Maybe Text)
subscriberResource_externalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
externalId :: Maybe Text
$sel:externalId:SubscriberResource' :: SubscriberResource -> Maybe Text
externalId} -> Maybe Text
externalId) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:externalId:SubscriberResource' :: Maybe Text
externalId = Maybe Text
a} :: SubscriberResource)

-- | The Amazon Resource Name (ARN) specifying the role of the subscriber.
subscriberResource_roleArn :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_roleArn :: Lens' SubscriberResource (Maybe Text)
subscriberResource_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:SubscriberResource' :: SubscriberResource -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:roleArn:SubscriberResource' :: Maybe Text
roleArn = Maybe Text
a} :: SubscriberResource)

-- | The ARN for the Amazon S3 bucket.
subscriberResource_s3BucketArn :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_s3BucketArn :: Lens' SubscriberResource (Maybe Text)
subscriberResource_s3BucketArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
s3BucketArn :: Maybe Text
$sel:s3BucketArn:SubscriberResource' :: SubscriberResource -> Maybe Text
s3BucketArn} -> Maybe Text
s3BucketArn) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:s3BucketArn:SubscriberResource' :: Maybe Text
s3BucketArn = Maybe Text
a} :: SubscriberResource)

-- | The ARN for the Amazon Simple Notification Service.
subscriberResource_snsArn :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_snsArn :: Lens' SubscriberResource (Maybe Text)
subscriberResource_snsArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
snsArn :: Maybe Text
$sel:snsArn:SubscriberResource' :: SubscriberResource -> Maybe Text
snsArn} -> Maybe Text
snsArn) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:snsArn:SubscriberResource' :: Maybe Text
snsArn = Maybe Text
a} :: SubscriberResource)

-- | The subscriber descriptions for a subscriber account. The description
-- for a subscriber includes @subscriberName@, @accountID@, @externalID@,
-- and @subscriptionId@.
subscriberResource_subscriberDescription :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_subscriberDescription :: Lens' SubscriberResource (Maybe Text)
subscriberResource_subscriberDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
subscriberDescription :: Maybe Text
$sel:subscriberDescription:SubscriberResource' :: SubscriberResource -> Maybe Text
subscriberDescription} -> Maybe Text
subscriberDescription) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:subscriberDescription:SubscriberResource' :: Maybe Text
subscriberDescription = Maybe Text
a} :: SubscriberResource)

-- | The name of your Amazon Security Lake subscriber account.
subscriberResource_subscriberName :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_subscriberName :: Lens' SubscriberResource (Maybe Text)
subscriberResource_subscriberName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
subscriberName :: Maybe Text
$sel:subscriberName:SubscriberResource' :: SubscriberResource -> Maybe Text
subscriberName} -> Maybe Text
subscriberName) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:subscriberName:SubscriberResource' :: Maybe Text
subscriberName = Maybe Text
a} :: SubscriberResource)

-- | The subscription endpoint to which exception messages are posted.
subscriberResource_subscriptionEndpoint :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.Text)
subscriberResource_subscriptionEndpoint :: Lens' SubscriberResource (Maybe Text)
subscriberResource_subscriptionEndpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe Text
subscriptionEndpoint :: Maybe Text
$sel:subscriptionEndpoint:SubscriberResource' :: SubscriberResource -> Maybe Text
subscriptionEndpoint} -> Maybe Text
subscriptionEndpoint) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe Text
a -> SubscriberResource
s {$sel:subscriptionEndpoint:SubscriberResource' :: Maybe Text
subscriptionEndpoint = Maybe Text
a} :: SubscriberResource)

-- | The subscription protocol to which exception messages are posted.
subscriberResource_subscriptionProtocol :: Lens.Lens' SubscriberResource (Prelude.Maybe EndpointProtocol)
subscriberResource_subscriptionProtocol :: Lens' SubscriberResource (Maybe EndpointProtocol)
subscriberResource_subscriptionProtocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe EndpointProtocol
subscriptionProtocol :: Maybe EndpointProtocol
$sel:subscriptionProtocol:SubscriberResource' :: SubscriberResource -> Maybe EndpointProtocol
subscriptionProtocol} -> Maybe EndpointProtocol
subscriptionProtocol) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe EndpointProtocol
a -> SubscriberResource
s {$sel:subscriptionProtocol:SubscriberResource' :: Maybe EndpointProtocol
subscriptionProtocol = Maybe EndpointProtocol
a} :: SubscriberResource)

-- | The subscription status of the Amazon Security Lake subscriber account.
subscriberResource_subscriptionStatus :: Lens.Lens' SubscriberResource (Prelude.Maybe SubscriptionStatus)
subscriberResource_subscriptionStatus :: Lens' SubscriberResource (Maybe SubscriptionStatus)
subscriberResource_subscriptionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe SubscriptionStatus
subscriptionStatus :: Maybe SubscriptionStatus
$sel:subscriptionStatus:SubscriberResource' :: SubscriberResource -> Maybe SubscriptionStatus
subscriptionStatus} -> Maybe SubscriptionStatus
subscriptionStatus) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe SubscriptionStatus
a -> SubscriberResource
s {$sel:subscriptionStatus:SubscriberResource' :: Maybe SubscriptionStatus
subscriptionStatus = Maybe SubscriptionStatus
a} :: SubscriberResource)

-- | The date and time when the subscription was created.
subscriberResource_updatedAt :: Lens.Lens' SubscriberResource (Prelude.Maybe Prelude.UTCTime)
subscriberResource_updatedAt :: Lens' SubscriberResource (Maybe UTCTime)
subscriberResource_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Maybe ISO8601
updatedAt :: Maybe ISO8601
$sel:updatedAt:SubscriberResource' :: SubscriberResource -> Maybe ISO8601
updatedAt} -> Maybe ISO8601
updatedAt) (\s :: SubscriberResource
s@SubscriberResource' {} Maybe ISO8601
a -> SubscriberResource
s {$sel:updatedAt:SubscriberResource' :: Maybe ISO8601
updatedAt = Maybe ISO8601
a} :: SubscriberResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Web Services account ID you are using to create your Amazon
-- Security Lake account.
subscriberResource_accountId :: Lens.Lens' SubscriberResource Prelude.Text
subscriberResource_accountId :: Lens' SubscriberResource Text
subscriberResource_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Text
accountId :: Text
$sel:accountId:SubscriberResource' :: SubscriberResource -> Text
accountId} -> Text
accountId) (\s :: SubscriberResource
s@SubscriberResource' {} Text
a -> SubscriberResource
s {$sel:accountId:SubscriberResource' :: Text
accountId = Text
a} :: SubscriberResource)

-- | Amazon Security Lake supports log and event collection for natively
-- supported Amazon Web Services. For more information, see the Amazon
-- Security Lake User Guide.
subscriberResource_sourceTypes :: Lens.Lens' SubscriberResource [SourceType]
subscriberResource_sourceTypes :: Lens' SubscriberResource [SourceType]
subscriberResource_sourceTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {[SourceType]
sourceTypes :: [SourceType]
$sel:sourceTypes:SubscriberResource' :: SubscriberResource -> [SourceType]
sourceTypes} -> [SourceType]
sourceTypes) (\s :: SubscriberResource
s@SubscriberResource' {} [SourceType]
a -> SubscriberResource
s {$sel:sourceTypes:SubscriberResource' :: [SourceType]
sourceTypes = [SourceType]
a} :: SubscriberResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The subscription ID of the Amazon Security Lake subscriber account.
subscriberResource_subscriptionId :: Lens.Lens' SubscriberResource Prelude.Text
subscriberResource_subscriptionId :: Lens' SubscriberResource Text
subscriberResource_subscriptionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubscriberResource' {Text
subscriptionId :: Text
$sel:subscriptionId:SubscriberResource' :: SubscriberResource -> Text
subscriptionId} -> Text
subscriptionId) (\s :: SubscriberResource
s@SubscriberResource' {} Text
a -> SubscriberResource
s {$sel:subscriptionId:SubscriberResource' :: Text
subscriptionId = Text
a} :: SubscriberResource)

instance Data.FromJSON SubscriberResource where
  parseJSON :: Value -> Parser SubscriberResource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SubscriberResource"
      ( \Object
x ->
          Maybe [AccessType]
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe EndpointProtocol
-> Maybe SubscriptionStatus
-> Maybe ISO8601
-> Text
-> [SourceType]
-> Text
-> SubscriberResource
SubscriberResource'
            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
"accessTypes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"createdAt")
            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
"externalId")
            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")
            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
"s3BucketArn")
            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
"snsArn")
            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
"subscriberDescription")
            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
"subscriberName")
            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
"subscriptionEndpoint")
            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
"subscriptionProtocol")
            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
"subscriptionStatus")
            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
"updatedAt")
            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
"accountId")
            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
"sourceTypes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"subscriptionId")
      )

instance Prelude.Hashable SubscriberResource where
  hashWithSalt :: Int -> SubscriberResource -> Int
hashWithSalt Int
_salt SubscriberResource' {[SourceType]
Maybe [AccessType]
Maybe Text
Maybe ISO8601
Maybe EndpointProtocol
Maybe SubscriptionStatus
Text
subscriptionId :: Text
sourceTypes :: [SourceType]
accountId :: Text
updatedAt :: Maybe ISO8601
subscriptionStatus :: Maybe SubscriptionStatus
subscriptionProtocol :: Maybe EndpointProtocol
subscriptionEndpoint :: Maybe Text
subscriberName :: Maybe Text
subscriberDescription :: Maybe Text
snsArn :: Maybe Text
s3BucketArn :: Maybe Text
roleArn :: Maybe Text
externalId :: Maybe Text
createdAt :: Maybe ISO8601
accessTypes :: Maybe [AccessType]
$sel:subscriptionId:SubscriberResource' :: SubscriberResource -> Text
$sel:sourceTypes:SubscriberResource' :: SubscriberResource -> [SourceType]
$sel:accountId:SubscriberResource' :: SubscriberResource -> Text
$sel:updatedAt:SubscriberResource' :: SubscriberResource -> Maybe ISO8601
$sel:subscriptionStatus:SubscriberResource' :: SubscriberResource -> Maybe SubscriptionStatus
$sel:subscriptionProtocol:SubscriberResource' :: SubscriberResource -> Maybe EndpointProtocol
$sel:subscriptionEndpoint:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:subscriberName:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:subscriberDescription:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:snsArn:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:s3BucketArn:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:roleArn:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:externalId:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:createdAt:SubscriberResource' :: SubscriberResource -> Maybe ISO8601
$sel:accessTypes:SubscriberResource' :: SubscriberResource -> Maybe [AccessType]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AccessType]
accessTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
externalId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3BucketArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subscriberDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subscriberName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subscriptionEndpoint
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointProtocol
subscriptionProtocol
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SubscriptionStatus
subscriptionStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
updatedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [SourceType]
sourceTypes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
subscriptionId

instance Prelude.NFData SubscriberResource where
  rnf :: SubscriberResource -> ()
rnf SubscriberResource' {[SourceType]
Maybe [AccessType]
Maybe Text
Maybe ISO8601
Maybe EndpointProtocol
Maybe SubscriptionStatus
Text
subscriptionId :: Text
sourceTypes :: [SourceType]
accountId :: Text
updatedAt :: Maybe ISO8601
subscriptionStatus :: Maybe SubscriptionStatus
subscriptionProtocol :: Maybe EndpointProtocol
subscriptionEndpoint :: Maybe Text
subscriberName :: Maybe Text
subscriberDescription :: Maybe Text
snsArn :: Maybe Text
s3BucketArn :: Maybe Text
roleArn :: Maybe Text
externalId :: Maybe Text
createdAt :: Maybe ISO8601
accessTypes :: Maybe [AccessType]
$sel:subscriptionId:SubscriberResource' :: SubscriberResource -> Text
$sel:sourceTypes:SubscriberResource' :: SubscriberResource -> [SourceType]
$sel:accountId:SubscriberResource' :: SubscriberResource -> Text
$sel:updatedAt:SubscriberResource' :: SubscriberResource -> Maybe ISO8601
$sel:subscriptionStatus:SubscriberResource' :: SubscriberResource -> Maybe SubscriptionStatus
$sel:subscriptionProtocol:SubscriberResource' :: SubscriberResource -> Maybe EndpointProtocol
$sel:subscriptionEndpoint:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:subscriberName:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:subscriberDescription:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:snsArn:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:s3BucketArn:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:roleArn:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:externalId:SubscriberResource' :: SubscriberResource -> Maybe Text
$sel:createdAt:SubscriberResource' :: SubscriberResource -> Maybe ISO8601
$sel:accessTypes:SubscriberResource' :: SubscriberResource -> Maybe [AccessType]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [AccessType]
accessTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
externalId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3BucketArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subscriberDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subscriberName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subscriptionEndpoint
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointProtocol
subscriptionProtocol
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SubscriptionStatus
subscriptionStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
updatedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [SourceType]
sourceTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
subscriptionId