{-# 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.Route53Resolver.Types.FirewallDomainListMetadata
-- 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.Route53Resolver.Types.FirewallDomainListMetadata where

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

-- | Minimal high-level information for a firewall domain list. The action
-- ListFirewallDomainLists returns an array of these objects.
--
-- To retrieve full information for a firewall domain list, call
-- GetFirewallDomainList and ListFirewallDomains.
--
-- /See:/ 'newFirewallDomainListMetadata' smart constructor.
data FirewallDomainListMetadata = FirewallDomainListMetadata'
  { -- | The Amazon Resource Name (ARN) of the firewall domain list metadata.
    FirewallDomainListMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A unique string defined by you to identify the request. This allows you
    -- to retry failed requests without the risk of running the operation
    -- twice. This can be any unique string, for example, a timestamp.
    FirewallDomainListMetadata -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | The owner of the list, used only for lists that are not managed by you.
    -- For example, the managed domain list
    -- @AWSManagedDomainsMalwareDomainList@ has the managed owner name
    -- @Route 53 Resolver DNS Firewall@.
    FirewallDomainListMetadata -> Maybe Text
managedOwnerName :: Prelude.Maybe Prelude.Text,
    -- | The name of the domain list.
    FirewallDomainListMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the domain list.
    FirewallDomainListMetadata -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (FirewallDomainListMetadata -> FirewallDomainListMetadata -> Bool
(FirewallDomainListMetadata -> FirewallDomainListMetadata -> Bool)
-> (FirewallDomainListMetadata
    -> FirewallDomainListMetadata -> Bool)
-> Eq FirewallDomainListMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FirewallDomainListMetadata -> FirewallDomainListMetadata -> Bool
$c/= :: FirewallDomainListMetadata -> FirewallDomainListMetadata -> Bool
== :: FirewallDomainListMetadata -> FirewallDomainListMetadata -> Bool
$c== :: FirewallDomainListMetadata -> FirewallDomainListMetadata -> Bool
Prelude.Eq, ReadPrec [FirewallDomainListMetadata]
ReadPrec FirewallDomainListMetadata
Int -> ReadS FirewallDomainListMetadata
ReadS [FirewallDomainListMetadata]
(Int -> ReadS FirewallDomainListMetadata)
-> ReadS [FirewallDomainListMetadata]
-> ReadPrec FirewallDomainListMetadata
-> ReadPrec [FirewallDomainListMetadata]
-> Read FirewallDomainListMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FirewallDomainListMetadata]
$creadListPrec :: ReadPrec [FirewallDomainListMetadata]
readPrec :: ReadPrec FirewallDomainListMetadata
$creadPrec :: ReadPrec FirewallDomainListMetadata
readList :: ReadS [FirewallDomainListMetadata]
$creadList :: ReadS [FirewallDomainListMetadata]
readsPrec :: Int -> ReadS FirewallDomainListMetadata
$creadsPrec :: Int -> ReadS FirewallDomainListMetadata
Prelude.Read, Int -> FirewallDomainListMetadata -> ShowS
[FirewallDomainListMetadata] -> ShowS
FirewallDomainListMetadata -> String
(Int -> FirewallDomainListMetadata -> ShowS)
-> (FirewallDomainListMetadata -> String)
-> ([FirewallDomainListMetadata] -> ShowS)
-> Show FirewallDomainListMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FirewallDomainListMetadata] -> ShowS
$cshowList :: [FirewallDomainListMetadata] -> ShowS
show :: FirewallDomainListMetadata -> String
$cshow :: FirewallDomainListMetadata -> String
showsPrec :: Int -> FirewallDomainListMetadata -> ShowS
$cshowsPrec :: Int -> FirewallDomainListMetadata -> ShowS
Prelude.Show, (forall x.
 FirewallDomainListMetadata -> Rep FirewallDomainListMetadata x)
-> (forall x.
    Rep FirewallDomainListMetadata x -> FirewallDomainListMetadata)
-> Generic FirewallDomainListMetadata
forall x.
Rep FirewallDomainListMetadata x -> FirewallDomainListMetadata
forall x.
FirewallDomainListMetadata -> Rep FirewallDomainListMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FirewallDomainListMetadata x -> FirewallDomainListMetadata
$cfrom :: forall x.
FirewallDomainListMetadata -> Rep FirewallDomainListMetadata x
Prelude.Generic)

-- |
-- Create a value of 'FirewallDomainListMetadata' 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:
--
-- 'arn', 'firewallDomainListMetadata_arn' - The Amazon Resource Name (ARN) of the firewall domain list metadata.
--
-- 'creatorRequestId', 'firewallDomainListMetadata_creatorRequestId' - A unique string defined by you to identify the request. This allows you
-- to retry failed requests without the risk of running the operation
-- twice. This can be any unique string, for example, a timestamp.
--
-- 'managedOwnerName', 'firewallDomainListMetadata_managedOwnerName' - The owner of the list, used only for lists that are not managed by you.
-- For example, the managed domain list
-- @AWSManagedDomainsMalwareDomainList@ has the managed owner name
-- @Route 53 Resolver DNS Firewall@.
--
-- 'name', 'firewallDomainListMetadata_name' - The name of the domain list.
--
-- 'id', 'firewallDomainListMetadata_id' - The ID of the domain list.
newFirewallDomainListMetadata ::
  FirewallDomainListMetadata
newFirewallDomainListMetadata :: FirewallDomainListMetadata
newFirewallDomainListMetadata =
  FirewallDomainListMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> FirewallDomainListMetadata
FirewallDomainListMetadata'
    { $sel:arn:FirewallDomainListMetadata' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:FirewallDomainListMetadata' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:managedOwnerName:FirewallDomainListMetadata' :: Maybe Text
managedOwnerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:FirewallDomainListMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:FirewallDomainListMetadata' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the firewall domain list metadata.
firewallDomainListMetadata_arn :: Lens.Lens' FirewallDomainListMetadata (Prelude.Maybe Prelude.Text)
firewallDomainListMetadata_arn :: (Maybe Text -> f (Maybe Text))
-> FirewallDomainListMetadata -> f FirewallDomainListMetadata
firewallDomainListMetadata_arn = (FirewallDomainListMetadata -> Maybe Text)
-> (FirewallDomainListMetadata
    -> Maybe Text -> FirewallDomainListMetadata)
-> Lens
     FirewallDomainListMetadata
     FirewallDomainListMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallDomainListMetadata' {Maybe Text
arn :: Maybe Text
$sel:arn:FirewallDomainListMetadata' :: FirewallDomainListMetadata -> Maybe Text
arn} -> Maybe Text
arn) (\s :: FirewallDomainListMetadata
s@FirewallDomainListMetadata' {} Maybe Text
a -> FirewallDomainListMetadata
s {$sel:arn:FirewallDomainListMetadata' :: Maybe Text
arn = Maybe Text
a} :: FirewallDomainListMetadata)

-- | A unique string defined by you to identify the request. This allows you
-- to retry failed requests without the risk of running the operation
-- twice. This can be any unique string, for example, a timestamp.
firewallDomainListMetadata_creatorRequestId :: Lens.Lens' FirewallDomainListMetadata (Prelude.Maybe Prelude.Text)
firewallDomainListMetadata_creatorRequestId :: (Maybe Text -> f (Maybe Text))
-> FirewallDomainListMetadata -> f FirewallDomainListMetadata
firewallDomainListMetadata_creatorRequestId = (FirewallDomainListMetadata -> Maybe Text)
-> (FirewallDomainListMetadata
    -> Maybe Text -> FirewallDomainListMetadata)
-> Lens
     FirewallDomainListMetadata
     FirewallDomainListMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallDomainListMetadata' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:FirewallDomainListMetadata' :: FirewallDomainListMetadata -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: FirewallDomainListMetadata
s@FirewallDomainListMetadata' {} Maybe Text
a -> FirewallDomainListMetadata
s {$sel:creatorRequestId:FirewallDomainListMetadata' :: Maybe Text
creatorRequestId = Maybe Text
a} :: FirewallDomainListMetadata)

-- | The owner of the list, used only for lists that are not managed by you.
-- For example, the managed domain list
-- @AWSManagedDomainsMalwareDomainList@ has the managed owner name
-- @Route 53 Resolver DNS Firewall@.
firewallDomainListMetadata_managedOwnerName :: Lens.Lens' FirewallDomainListMetadata (Prelude.Maybe Prelude.Text)
firewallDomainListMetadata_managedOwnerName :: (Maybe Text -> f (Maybe Text))
-> FirewallDomainListMetadata -> f FirewallDomainListMetadata
firewallDomainListMetadata_managedOwnerName = (FirewallDomainListMetadata -> Maybe Text)
-> (FirewallDomainListMetadata
    -> Maybe Text -> FirewallDomainListMetadata)
-> Lens
     FirewallDomainListMetadata
     FirewallDomainListMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallDomainListMetadata' {Maybe Text
managedOwnerName :: Maybe Text
$sel:managedOwnerName:FirewallDomainListMetadata' :: FirewallDomainListMetadata -> Maybe Text
managedOwnerName} -> Maybe Text
managedOwnerName) (\s :: FirewallDomainListMetadata
s@FirewallDomainListMetadata' {} Maybe Text
a -> FirewallDomainListMetadata
s {$sel:managedOwnerName:FirewallDomainListMetadata' :: Maybe Text
managedOwnerName = Maybe Text
a} :: FirewallDomainListMetadata)

-- | The name of the domain list.
firewallDomainListMetadata_name :: Lens.Lens' FirewallDomainListMetadata (Prelude.Maybe Prelude.Text)
firewallDomainListMetadata_name :: (Maybe Text -> f (Maybe Text))
-> FirewallDomainListMetadata -> f FirewallDomainListMetadata
firewallDomainListMetadata_name = (FirewallDomainListMetadata -> Maybe Text)
-> (FirewallDomainListMetadata
    -> Maybe Text -> FirewallDomainListMetadata)
-> Lens
     FirewallDomainListMetadata
     FirewallDomainListMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallDomainListMetadata' {Maybe Text
name :: Maybe Text
$sel:name:FirewallDomainListMetadata' :: FirewallDomainListMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: FirewallDomainListMetadata
s@FirewallDomainListMetadata' {} Maybe Text
a -> FirewallDomainListMetadata
s {$sel:name:FirewallDomainListMetadata' :: Maybe Text
name = Maybe Text
a} :: FirewallDomainListMetadata)

-- | The ID of the domain list.
firewallDomainListMetadata_id :: Lens.Lens' FirewallDomainListMetadata (Prelude.Maybe Prelude.Text)
firewallDomainListMetadata_id :: (Maybe Text -> f (Maybe Text))
-> FirewallDomainListMetadata -> f FirewallDomainListMetadata
firewallDomainListMetadata_id = (FirewallDomainListMetadata -> Maybe Text)
-> (FirewallDomainListMetadata
    -> Maybe Text -> FirewallDomainListMetadata)
-> Lens
     FirewallDomainListMetadata
     FirewallDomainListMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallDomainListMetadata' {Maybe Text
id :: Maybe Text
$sel:id:FirewallDomainListMetadata' :: FirewallDomainListMetadata -> Maybe Text
id} -> Maybe Text
id) (\s :: FirewallDomainListMetadata
s@FirewallDomainListMetadata' {} Maybe Text
a -> FirewallDomainListMetadata
s {$sel:id:FirewallDomainListMetadata' :: Maybe Text
id = Maybe Text
a} :: FirewallDomainListMetadata)

instance Core.FromJSON FirewallDomainListMetadata where
  parseJSON :: Value -> Parser FirewallDomainListMetadata
parseJSON =
    String
-> (Object -> Parser FirewallDomainListMetadata)
-> Value
-> Parser FirewallDomainListMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FirewallDomainListMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> FirewallDomainListMetadata
FirewallDomainListMetadata'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> FirewallDomainListMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> FirewallDomainListMetadata)
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
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> FirewallDomainListMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> FirewallDomainListMetadata)
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
"CreatorRequestId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> FirewallDomainListMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> FirewallDomainListMetadata)
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
"ManagedOwnerName")
            Parser (Maybe Text -> Maybe Text -> FirewallDomainListMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> FirewallDomainListMetadata)
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
"Name")
            Parser (Maybe Text -> FirewallDomainListMetadata)
-> Parser (Maybe Text) -> Parser FirewallDomainListMetadata
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
"Id")
      )

instance Prelude.Hashable FirewallDomainListMetadata

instance Prelude.NFData FirewallDomainListMetadata