{-# 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.ResolverQueryLogConfig
-- 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.ResolverQueryLogConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.ResolverQueryLogConfigStatus
import Amazonka.Route53Resolver.Types.ShareStatus

-- | In the response to a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_CreateResolverQueryLogConfig.html CreateResolverQueryLogConfig>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_DeleteResolverQueryLogConfig.html DeleteResolverQueryLogConfig>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_GetResolverQueryLogConfig.html GetResolverQueryLogConfig>,
-- or
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_ListResolverQueryLogConfigs.html ListResolverQueryLogConfigs>
-- request, a complex type that contains settings for one query logging
-- configuration.
--
-- /See:/ 'newResolverQueryLogConfig' smart constructor.
data ResolverQueryLogConfig = ResolverQueryLogConfig'
  { -- | The date and time that the query logging configuration was created, in
    -- Unix time format and Coordinated Universal Time (UTC).
    ResolverQueryLogConfig -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | The status of the specified query logging configuration. Valid values
    -- include the following:
    --
    -- -   @CREATING@: Resolver is creating the query logging configuration.
    --
    -- -   @CREATED@: The query logging configuration was successfully created.
    --     Resolver is logging queries that originate in the specified VPC.
    --
    -- -   @DELETING@: Resolver is deleting this query logging configuration.
    --
    -- -   @FAILED@: Resolver can\'t deliver logs to the location that is
    --     specified in the query logging configuration. Here are two common
    --     causes:
    --
    --     -   The specified destination (for example, an Amazon S3 bucket) was
    --         deleted.
    --
    --     -   Permissions don\'t allow sending logs to the destination.
    ResolverQueryLogConfig -> Maybe ResolverQueryLogConfigStatus
status :: Prelude.Maybe ResolverQueryLogConfigStatus,
    -- | The number of VPCs that are associated with the query logging
    -- configuration.
    ResolverQueryLogConfig -> Maybe Int
associationCount :: Prelude.Maybe Prelude.Int,
    -- | The ARN for the query logging configuration.
    ResolverQueryLogConfig -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A unique string that identifies the request that created the query
    -- logging configuration. The @CreatorRequestId@ allows failed requests to
    -- be retried without the risk of running the operation twice.
    ResolverQueryLogConfig -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the resource that you want Resolver to send query logs: an
    -- Amazon S3 bucket, a CloudWatch Logs log group, or a Kinesis Data
    -- Firehose delivery stream.
    ResolverQueryLogConfig -> Maybe Text
destinationArn :: Prelude.Maybe Prelude.Text,
    -- | An indication of whether the query logging configuration is shared with
    -- other Amazon Web Services accounts, or was shared with the current
    -- account by another Amazon Web Services account. Sharing is configured
    -- through Resource Access Manager (RAM).
    ResolverQueryLogConfig -> Maybe ShareStatus
shareStatus :: Prelude.Maybe ShareStatus,
    -- | The Amazon Web Services account ID for the account that created the
    -- query logging configuration.
    ResolverQueryLogConfig -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
    -- | The name of the query logging configuration.
    ResolverQueryLogConfig -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID for the query logging configuration.
    ResolverQueryLogConfig -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool
(ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool)
-> (ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool)
-> Eq ResolverQueryLogConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool
$c/= :: ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool
== :: ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool
$c== :: ResolverQueryLogConfig -> ResolverQueryLogConfig -> Bool
Prelude.Eq, ReadPrec [ResolverQueryLogConfig]
ReadPrec ResolverQueryLogConfig
Int -> ReadS ResolverQueryLogConfig
ReadS [ResolverQueryLogConfig]
(Int -> ReadS ResolverQueryLogConfig)
-> ReadS [ResolverQueryLogConfig]
-> ReadPrec ResolverQueryLogConfig
-> ReadPrec [ResolverQueryLogConfig]
-> Read ResolverQueryLogConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolverQueryLogConfig]
$creadListPrec :: ReadPrec [ResolverQueryLogConfig]
readPrec :: ReadPrec ResolverQueryLogConfig
$creadPrec :: ReadPrec ResolverQueryLogConfig
readList :: ReadS [ResolverQueryLogConfig]
$creadList :: ReadS [ResolverQueryLogConfig]
readsPrec :: Int -> ReadS ResolverQueryLogConfig
$creadsPrec :: Int -> ReadS ResolverQueryLogConfig
Prelude.Read, Int -> ResolverQueryLogConfig -> ShowS
[ResolverQueryLogConfig] -> ShowS
ResolverQueryLogConfig -> String
(Int -> ResolverQueryLogConfig -> ShowS)
-> (ResolverQueryLogConfig -> String)
-> ([ResolverQueryLogConfig] -> ShowS)
-> Show ResolverQueryLogConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolverQueryLogConfig] -> ShowS
$cshowList :: [ResolverQueryLogConfig] -> ShowS
show :: ResolverQueryLogConfig -> String
$cshow :: ResolverQueryLogConfig -> String
showsPrec :: Int -> ResolverQueryLogConfig -> ShowS
$cshowsPrec :: Int -> ResolverQueryLogConfig -> ShowS
Prelude.Show, (forall x. ResolverQueryLogConfig -> Rep ResolverQueryLogConfig x)
-> (forall x.
    Rep ResolverQueryLogConfig x -> ResolverQueryLogConfig)
-> Generic ResolverQueryLogConfig
forall x. Rep ResolverQueryLogConfig x -> ResolverQueryLogConfig
forall x. ResolverQueryLogConfig -> Rep ResolverQueryLogConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResolverQueryLogConfig x -> ResolverQueryLogConfig
$cfrom :: forall x. ResolverQueryLogConfig -> Rep ResolverQueryLogConfig x
Prelude.Generic)

-- |
-- Create a value of 'ResolverQueryLogConfig' 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:
--
-- 'creationTime', 'resolverQueryLogConfig_creationTime' - The date and time that the query logging configuration was created, in
-- Unix time format and Coordinated Universal Time (UTC).
--
-- 'status', 'resolverQueryLogConfig_status' - The status of the specified query logging configuration. Valid values
-- include the following:
--
-- -   @CREATING@: Resolver is creating the query logging configuration.
--
-- -   @CREATED@: The query logging configuration was successfully created.
--     Resolver is logging queries that originate in the specified VPC.
--
-- -   @DELETING@: Resolver is deleting this query logging configuration.
--
-- -   @FAILED@: Resolver can\'t deliver logs to the location that is
--     specified in the query logging configuration. Here are two common
--     causes:
--
--     -   The specified destination (for example, an Amazon S3 bucket) was
--         deleted.
--
--     -   Permissions don\'t allow sending logs to the destination.
--
-- 'associationCount', 'resolverQueryLogConfig_associationCount' - The number of VPCs that are associated with the query logging
-- configuration.
--
-- 'arn', 'resolverQueryLogConfig_arn' - The ARN for the query logging configuration.
--
-- 'creatorRequestId', 'resolverQueryLogConfig_creatorRequestId' - A unique string that identifies the request that created the query
-- logging configuration. The @CreatorRequestId@ allows failed requests to
-- be retried without the risk of running the operation twice.
--
-- 'destinationArn', 'resolverQueryLogConfig_destinationArn' - The ARN of the resource that you want Resolver to send query logs: an
-- Amazon S3 bucket, a CloudWatch Logs log group, or a Kinesis Data
-- Firehose delivery stream.
--
-- 'shareStatus', 'resolverQueryLogConfig_shareStatus' - An indication of whether the query logging configuration is shared with
-- other Amazon Web Services accounts, or was shared with the current
-- account by another Amazon Web Services account. Sharing is configured
-- through Resource Access Manager (RAM).
--
-- 'ownerId', 'resolverQueryLogConfig_ownerId' - The Amazon Web Services account ID for the account that created the
-- query logging configuration.
--
-- 'name', 'resolverQueryLogConfig_name' - The name of the query logging configuration.
--
-- 'id', 'resolverQueryLogConfig_id' - The ID for the query logging configuration.
newResolverQueryLogConfig ::
  ResolverQueryLogConfig
newResolverQueryLogConfig :: ResolverQueryLogConfig
newResolverQueryLogConfig =
  ResolverQueryLogConfig' :: Maybe Text
-> Maybe ResolverQueryLogConfigStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResolverQueryLogConfig
ResolverQueryLogConfig'
    { $sel:creationTime:ResolverQueryLogConfig' :: Maybe Text
creationTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ResolverQueryLogConfig' :: Maybe ResolverQueryLogConfigStatus
status = Maybe ResolverQueryLogConfigStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:associationCount:ResolverQueryLogConfig' :: Maybe Int
associationCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ResolverQueryLogConfig' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:ResolverQueryLogConfig' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationArn:ResolverQueryLogConfig' :: Maybe Text
destinationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shareStatus:ResolverQueryLogConfig' :: Maybe ShareStatus
shareStatus = Maybe ShareStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerId:ResolverQueryLogConfig' :: Maybe Text
ownerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ResolverQueryLogConfig' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ResolverQueryLogConfig' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time that the query logging configuration was created, in
-- Unix time format and Coordinated Universal Time (UTC).
resolverQueryLogConfig_creationTime :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_creationTime :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_creationTime = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
creationTime :: Maybe Text
$sel:creationTime:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
creationTime} -> Maybe Text
creationTime) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:creationTime:ResolverQueryLogConfig' :: Maybe Text
creationTime = Maybe Text
a} :: ResolverQueryLogConfig)

-- | The status of the specified query logging configuration. Valid values
-- include the following:
--
-- -   @CREATING@: Resolver is creating the query logging configuration.
--
-- -   @CREATED@: The query logging configuration was successfully created.
--     Resolver is logging queries that originate in the specified VPC.
--
-- -   @DELETING@: Resolver is deleting this query logging configuration.
--
-- -   @FAILED@: Resolver can\'t deliver logs to the location that is
--     specified in the query logging configuration. Here are two common
--     causes:
--
--     -   The specified destination (for example, an Amazon S3 bucket) was
--         deleted.
--
--     -   Permissions don\'t allow sending logs to the destination.
resolverQueryLogConfig_status :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe ResolverQueryLogConfigStatus)
resolverQueryLogConfig_status :: (Maybe ResolverQueryLogConfigStatus
 -> f (Maybe ResolverQueryLogConfigStatus))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_status = (ResolverQueryLogConfig -> Maybe ResolverQueryLogConfigStatus)
-> (ResolverQueryLogConfig
    -> Maybe ResolverQueryLogConfigStatus -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe ResolverQueryLogConfigStatus)
     (Maybe ResolverQueryLogConfigStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe ResolverQueryLogConfigStatus
status :: Maybe ResolverQueryLogConfigStatus
$sel:status:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe ResolverQueryLogConfigStatus
status} -> Maybe ResolverQueryLogConfigStatus
status) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe ResolverQueryLogConfigStatus
a -> ResolverQueryLogConfig
s {$sel:status:ResolverQueryLogConfig' :: Maybe ResolverQueryLogConfigStatus
status = Maybe ResolverQueryLogConfigStatus
a} :: ResolverQueryLogConfig)

-- | The number of VPCs that are associated with the query logging
-- configuration.
resolverQueryLogConfig_associationCount :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Int)
resolverQueryLogConfig_associationCount :: (Maybe Int -> f (Maybe Int))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_associationCount = (ResolverQueryLogConfig -> Maybe Int)
-> (ResolverQueryLogConfig -> Maybe Int -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Int
associationCount :: Maybe Int
$sel:associationCount:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Int
associationCount} -> Maybe Int
associationCount) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Int
a -> ResolverQueryLogConfig
s {$sel:associationCount:ResolverQueryLogConfig' :: Maybe Int
associationCount = Maybe Int
a} :: ResolverQueryLogConfig)

-- | The ARN for the query logging configuration.
resolverQueryLogConfig_arn :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_arn :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_arn = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
arn :: Maybe Text
$sel:arn:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:arn:ResolverQueryLogConfig' :: Maybe Text
arn = Maybe Text
a} :: ResolverQueryLogConfig)

-- | A unique string that identifies the request that created the query
-- logging configuration. The @CreatorRequestId@ allows failed requests to
-- be retried without the risk of running the operation twice.
resolverQueryLogConfig_creatorRequestId :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_creatorRequestId :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_creatorRequestId = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:creatorRequestId:ResolverQueryLogConfig' :: Maybe Text
creatorRequestId = Maybe Text
a} :: ResolverQueryLogConfig)

-- | The ARN of the resource that you want Resolver to send query logs: an
-- Amazon S3 bucket, a CloudWatch Logs log group, or a Kinesis Data
-- Firehose delivery stream.
resolverQueryLogConfig_destinationArn :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_destinationArn :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_destinationArn = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
destinationArn :: Maybe Text
$sel:destinationArn:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
destinationArn} -> Maybe Text
destinationArn) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:destinationArn:ResolverQueryLogConfig' :: Maybe Text
destinationArn = Maybe Text
a} :: ResolverQueryLogConfig)

-- | An indication of whether the query logging configuration is shared with
-- other Amazon Web Services accounts, or was shared with the current
-- account by another Amazon Web Services account. Sharing is configured
-- through Resource Access Manager (RAM).
resolverQueryLogConfig_shareStatus :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe ShareStatus)
resolverQueryLogConfig_shareStatus :: (Maybe ShareStatus -> f (Maybe ShareStatus))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_shareStatus = (ResolverQueryLogConfig -> Maybe ShareStatus)
-> (ResolverQueryLogConfig
    -> Maybe ShareStatus -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe ShareStatus)
     (Maybe ShareStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe ShareStatus
shareStatus :: Maybe ShareStatus
$sel:shareStatus:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe ShareStatus
shareStatus} -> Maybe ShareStatus
shareStatus) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe ShareStatus
a -> ResolverQueryLogConfig
s {$sel:shareStatus:ResolverQueryLogConfig' :: Maybe ShareStatus
shareStatus = Maybe ShareStatus
a} :: ResolverQueryLogConfig)

-- | The Amazon Web Services account ID for the account that created the
-- query logging configuration.
resolverQueryLogConfig_ownerId :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_ownerId :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_ownerId = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:ownerId:ResolverQueryLogConfig' :: Maybe Text
ownerId = Maybe Text
a} :: ResolverQueryLogConfig)

-- | The name of the query logging configuration.
resolverQueryLogConfig_name :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_name :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_name = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
name :: Maybe Text
$sel:name:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
name} -> Maybe Text
name) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:name:ResolverQueryLogConfig' :: Maybe Text
name = Maybe Text
a} :: ResolverQueryLogConfig)

-- | The ID for the query logging configuration.
resolverQueryLogConfig_id :: Lens.Lens' ResolverQueryLogConfig (Prelude.Maybe Prelude.Text)
resolverQueryLogConfig_id :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfig -> f ResolverQueryLogConfig
resolverQueryLogConfig_id = (ResolverQueryLogConfig -> Maybe Text)
-> (ResolverQueryLogConfig -> Maybe Text -> ResolverQueryLogConfig)
-> Lens
     ResolverQueryLogConfig
     ResolverQueryLogConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfig' {Maybe Text
id :: Maybe Text
$sel:id:ResolverQueryLogConfig' :: ResolverQueryLogConfig -> Maybe Text
id} -> Maybe Text
id) (\s :: ResolverQueryLogConfig
s@ResolverQueryLogConfig' {} Maybe Text
a -> ResolverQueryLogConfig
s {$sel:id:ResolverQueryLogConfig' :: Maybe Text
id = Maybe Text
a} :: ResolverQueryLogConfig)

instance Core.FromJSON ResolverQueryLogConfig where
  parseJSON :: Value -> Parser ResolverQueryLogConfig
parseJSON =
    String
-> (Object -> Parser ResolverQueryLogConfig)
-> Value
-> Parser ResolverQueryLogConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResolverQueryLogConfig"
      ( \Object
x ->
          Maybe Text
-> Maybe ResolverQueryLogConfigStatus
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResolverQueryLogConfig
ResolverQueryLogConfig'
            (Maybe Text
 -> Maybe ResolverQueryLogConfigStatus
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ShareStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ResolverQueryLogConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResolverQueryLogConfigStatus
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfig)
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
"CreationTime")
            Parser
  (Maybe ResolverQueryLogConfigStatus
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfig)
-> Parser (Maybe ResolverQueryLogConfigStatus)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResolverQueryLogConfigStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfig)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssociationCount")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfig)
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
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfig)
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 ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfig)
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
"DestinationArn")
            Parser
  (Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfig)
-> Parser (Maybe ShareStatus)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> ResolverQueryLogConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ShareStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShareStatus")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> ResolverQueryLogConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ResolverQueryLogConfig)
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
"OwnerId")
            Parser (Maybe Text -> Maybe Text -> ResolverQueryLogConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ResolverQueryLogConfig)
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 -> ResolverQueryLogConfig)
-> Parser (Maybe Text) -> Parser ResolverQueryLogConfig
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 ResolverQueryLogConfig

instance Prelude.NFData ResolverQueryLogConfig