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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.ResolverQueryLogConfigAssociationError
import Amazonka.Route53Resolver.Types.ResolverQueryLogConfigAssociationStatus

-- | In the response to an
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_AssociateResolverQueryLogConfig.html AssociateResolverQueryLogConfig>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_DisassociateResolverQueryLogConfig.html DisassociateResolverQueryLogConfig>,
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_GetResolverQueryLogConfigAssociation.html GetResolverQueryLogConfigAssociation>,
-- or
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_ListResolverQueryLogConfigAssociations.html ListResolverQueryLogConfigAssociations>,
-- request, a complex type that contains settings for a specified
-- association between an Amazon VPC and a query logging configuration.
--
-- /See:/ 'newResolverQueryLogConfigAssociation' smart constructor.
data ResolverQueryLogConfigAssociation = ResolverQueryLogConfigAssociation'
  { -- | The date and time that the VPC was associated with the query logging
    -- configuration, in Unix time format and Coordinated Universal Time (UTC).
    ResolverQueryLogConfigAssociation -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | The status of the specified query logging association. Valid values
    -- include the following:
    --
    -- -   @CREATING@: Resolver is creating an association between an Amazon
    --     VPC and a query logging configuration.
    --
    -- -   @CREATED@: The association between an Amazon VPC and a query logging
    --     configuration was successfully created. Resolver is logging queries
    --     that originate in the specified VPC.
    --
    -- -   @DELETING@: Resolver is deleting this query logging association.
    --
    -- -   @FAILED@: Resolver either couldn\'t create or couldn\'t delete the
    --     query logging association.
    ResolverQueryLogConfigAssociation
-> Maybe ResolverQueryLogConfigAssociationStatus
status :: Prelude.Maybe ResolverQueryLogConfigAssociationStatus,
    -- | The ID of the query logging configuration that a VPC is associated with.
    ResolverQueryLogConfigAssociation -> Maybe Text
resolverQueryLogConfigId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon VPC that is associated with the query logging
    -- configuration.
    ResolverQueryLogConfigAssociation -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | If the value of @Status@ is @FAILED@, the value of @Error@ indicates the
    -- cause:
    --
    -- -   @DESTINATION_NOT_FOUND@: The specified destination (for example, an
    --     Amazon S3 bucket) was deleted.
    --
    -- -   @ACCESS_DENIED@: Permissions don\'t allow sending logs to the
    --     destination.
    --
    -- If the value of @Status@ is a value other than @FAILED@, @Error@ is
    -- null.
    ResolverQueryLogConfigAssociation
-> Maybe ResolverQueryLogConfigAssociationError
error :: Prelude.Maybe ResolverQueryLogConfigAssociationError,
    -- | The ID of the query logging association.
    ResolverQueryLogConfigAssociation -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Contains additional information about the error. If the value or @Error@
    -- is null, the value of @ErrorMessage@ also is null.
    ResolverQueryLogConfigAssociation -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (ResolverQueryLogConfigAssociation
-> ResolverQueryLogConfigAssociation -> Bool
(ResolverQueryLogConfigAssociation
 -> ResolverQueryLogConfigAssociation -> Bool)
-> (ResolverQueryLogConfigAssociation
    -> ResolverQueryLogConfigAssociation -> Bool)
-> Eq ResolverQueryLogConfigAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolverQueryLogConfigAssociation
-> ResolverQueryLogConfigAssociation -> Bool
$c/= :: ResolverQueryLogConfigAssociation
-> ResolverQueryLogConfigAssociation -> Bool
== :: ResolverQueryLogConfigAssociation
-> ResolverQueryLogConfigAssociation -> Bool
$c== :: ResolverQueryLogConfigAssociation
-> ResolverQueryLogConfigAssociation -> Bool
Prelude.Eq, ReadPrec [ResolverQueryLogConfigAssociation]
ReadPrec ResolverQueryLogConfigAssociation
Int -> ReadS ResolverQueryLogConfigAssociation
ReadS [ResolverQueryLogConfigAssociation]
(Int -> ReadS ResolverQueryLogConfigAssociation)
-> ReadS [ResolverQueryLogConfigAssociation]
-> ReadPrec ResolverQueryLogConfigAssociation
-> ReadPrec [ResolverQueryLogConfigAssociation]
-> Read ResolverQueryLogConfigAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolverQueryLogConfigAssociation]
$creadListPrec :: ReadPrec [ResolverQueryLogConfigAssociation]
readPrec :: ReadPrec ResolverQueryLogConfigAssociation
$creadPrec :: ReadPrec ResolverQueryLogConfigAssociation
readList :: ReadS [ResolverQueryLogConfigAssociation]
$creadList :: ReadS [ResolverQueryLogConfigAssociation]
readsPrec :: Int -> ReadS ResolverQueryLogConfigAssociation
$creadsPrec :: Int -> ReadS ResolverQueryLogConfigAssociation
Prelude.Read, Int -> ResolverQueryLogConfigAssociation -> ShowS
[ResolverQueryLogConfigAssociation] -> ShowS
ResolverQueryLogConfigAssociation -> String
(Int -> ResolverQueryLogConfigAssociation -> ShowS)
-> (ResolverQueryLogConfigAssociation -> String)
-> ([ResolverQueryLogConfigAssociation] -> ShowS)
-> Show ResolverQueryLogConfigAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolverQueryLogConfigAssociation] -> ShowS
$cshowList :: [ResolverQueryLogConfigAssociation] -> ShowS
show :: ResolverQueryLogConfigAssociation -> String
$cshow :: ResolverQueryLogConfigAssociation -> String
showsPrec :: Int -> ResolverQueryLogConfigAssociation -> ShowS
$cshowsPrec :: Int -> ResolverQueryLogConfigAssociation -> ShowS
Prelude.Show, (forall x.
 ResolverQueryLogConfigAssociation
 -> Rep ResolverQueryLogConfigAssociation x)
-> (forall x.
    Rep ResolverQueryLogConfigAssociation x
    -> ResolverQueryLogConfigAssociation)
-> Generic ResolverQueryLogConfigAssociation
forall x.
Rep ResolverQueryLogConfigAssociation x
-> ResolverQueryLogConfigAssociation
forall x.
ResolverQueryLogConfigAssociation
-> Rep ResolverQueryLogConfigAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResolverQueryLogConfigAssociation x
-> ResolverQueryLogConfigAssociation
$cfrom :: forall x.
ResolverQueryLogConfigAssociation
-> Rep ResolverQueryLogConfigAssociation x
Prelude.Generic)

-- |
-- Create a value of 'ResolverQueryLogConfigAssociation' 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', 'resolverQueryLogConfigAssociation_creationTime' - The date and time that the VPC was associated with the query logging
-- configuration, in Unix time format and Coordinated Universal Time (UTC).
--
-- 'status', 'resolverQueryLogConfigAssociation_status' - The status of the specified query logging association. Valid values
-- include the following:
--
-- -   @CREATING@: Resolver is creating an association between an Amazon
--     VPC and a query logging configuration.
--
-- -   @CREATED@: The association between an Amazon VPC and a query logging
--     configuration was successfully created. Resolver is logging queries
--     that originate in the specified VPC.
--
-- -   @DELETING@: Resolver is deleting this query logging association.
--
-- -   @FAILED@: Resolver either couldn\'t create or couldn\'t delete the
--     query logging association.
--
-- 'resolverQueryLogConfigId', 'resolverQueryLogConfigAssociation_resolverQueryLogConfigId' - The ID of the query logging configuration that a VPC is associated with.
--
-- 'resourceId', 'resolverQueryLogConfigAssociation_resourceId' - The ID of the Amazon VPC that is associated with the query logging
-- configuration.
--
-- 'error', 'resolverQueryLogConfigAssociation_error' - If the value of @Status@ is @FAILED@, the value of @Error@ indicates the
-- cause:
--
-- -   @DESTINATION_NOT_FOUND@: The specified destination (for example, an
--     Amazon S3 bucket) was deleted.
--
-- -   @ACCESS_DENIED@: Permissions don\'t allow sending logs to the
--     destination.
--
-- If the value of @Status@ is a value other than @FAILED@, @Error@ is
-- null.
--
-- 'id', 'resolverQueryLogConfigAssociation_id' - The ID of the query logging association.
--
-- 'errorMessage', 'resolverQueryLogConfigAssociation_errorMessage' - Contains additional information about the error. If the value or @Error@
-- is null, the value of @ErrorMessage@ also is null.
newResolverQueryLogConfigAssociation ::
  ResolverQueryLogConfigAssociation
newResolverQueryLogConfigAssociation :: ResolverQueryLogConfigAssociation
newResolverQueryLogConfigAssociation =
  ResolverQueryLogConfigAssociation' :: Maybe Text
-> Maybe ResolverQueryLogConfigAssociationStatus
-> Maybe Text
-> Maybe Text
-> Maybe ResolverQueryLogConfigAssociationError
-> Maybe Text
-> Maybe Text
-> ResolverQueryLogConfigAssociation
ResolverQueryLogConfigAssociation'
    { $sel:creationTime:ResolverQueryLogConfigAssociation' :: Maybe Text
creationTime =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ResolverQueryLogConfigAssociation' :: Maybe ResolverQueryLogConfigAssociationStatus
status = Maybe ResolverQueryLogConfigAssociationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:resolverQueryLogConfigId:ResolverQueryLogConfigAssociation' :: Maybe Text
resolverQueryLogConfigId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:ResolverQueryLogConfigAssociation' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:error:ResolverQueryLogConfigAssociation' :: Maybe ResolverQueryLogConfigAssociationError
error = Maybe ResolverQueryLogConfigAssociationError
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ResolverQueryLogConfigAssociation' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:ResolverQueryLogConfigAssociation' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The status of the specified query logging association. Valid values
-- include the following:
--
-- -   @CREATING@: Resolver is creating an association between an Amazon
--     VPC and a query logging configuration.
--
-- -   @CREATED@: The association between an Amazon VPC and a query logging
--     configuration was successfully created. Resolver is logging queries
--     that originate in the specified VPC.
--
-- -   @DELETING@: Resolver is deleting this query logging association.
--
-- -   @FAILED@: Resolver either couldn\'t create or couldn\'t delete the
--     query logging association.
resolverQueryLogConfigAssociation_status :: Lens.Lens' ResolverQueryLogConfigAssociation (Prelude.Maybe ResolverQueryLogConfigAssociationStatus)
resolverQueryLogConfigAssociation_status :: (Maybe ResolverQueryLogConfigAssociationStatus
 -> f (Maybe ResolverQueryLogConfigAssociationStatus))
-> ResolverQueryLogConfigAssociation
-> f ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation_status = (ResolverQueryLogConfigAssociation
 -> Maybe ResolverQueryLogConfigAssociationStatus)
-> (ResolverQueryLogConfigAssociation
    -> Maybe ResolverQueryLogConfigAssociationStatus
    -> ResolverQueryLogConfigAssociation)
-> Lens
     ResolverQueryLogConfigAssociation
     ResolverQueryLogConfigAssociation
     (Maybe ResolverQueryLogConfigAssociationStatus)
     (Maybe ResolverQueryLogConfigAssociationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfigAssociation' {Maybe ResolverQueryLogConfigAssociationStatus
status :: Maybe ResolverQueryLogConfigAssociationStatus
$sel:status:ResolverQueryLogConfigAssociation' :: ResolverQueryLogConfigAssociation
-> Maybe ResolverQueryLogConfigAssociationStatus
status} -> Maybe ResolverQueryLogConfigAssociationStatus
status) (\s :: ResolverQueryLogConfigAssociation
s@ResolverQueryLogConfigAssociation' {} Maybe ResolverQueryLogConfigAssociationStatus
a -> ResolverQueryLogConfigAssociation
s {$sel:status:ResolverQueryLogConfigAssociation' :: Maybe ResolverQueryLogConfigAssociationStatus
status = Maybe ResolverQueryLogConfigAssociationStatus
a} :: ResolverQueryLogConfigAssociation)

-- | The ID of the query logging configuration that a VPC is associated with.
resolverQueryLogConfigAssociation_resolverQueryLogConfigId :: Lens.Lens' ResolverQueryLogConfigAssociation (Prelude.Maybe Prelude.Text)
resolverQueryLogConfigAssociation_resolverQueryLogConfigId :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfigAssociation
-> f ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation_resolverQueryLogConfigId = (ResolverQueryLogConfigAssociation -> Maybe Text)
-> (ResolverQueryLogConfigAssociation
    -> Maybe Text -> ResolverQueryLogConfigAssociation)
-> Lens
     ResolverQueryLogConfigAssociation
     ResolverQueryLogConfigAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfigAssociation' {Maybe Text
resolverQueryLogConfigId :: Maybe Text
$sel:resolverQueryLogConfigId:ResolverQueryLogConfigAssociation' :: ResolverQueryLogConfigAssociation -> Maybe Text
resolverQueryLogConfigId} -> Maybe Text
resolverQueryLogConfigId) (\s :: ResolverQueryLogConfigAssociation
s@ResolverQueryLogConfigAssociation' {} Maybe Text
a -> ResolverQueryLogConfigAssociation
s {$sel:resolverQueryLogConfigId:ResolverQueryLogConfigAssociation' :: Maybe Text
resolverQueryLogConfigId = Maybe Text
a} :: ResolverQueryLogConfigAssociation)

-- | The ID of the Amazon VPC that is associated with the query logging
-- configuration.
resolverQueryLogConfigAssociation_resourceId :: Lens.Lens' ResolverQueryLogConfigAssociation (Prelude.Maybe Prelude.Text)
resolverQueryLogConfigAssociation_resourceId :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfigAssociation
-> f ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation_resourceId = (ResolverQueryLogConfigAssociation -> Maybe Text)
-> (ResolverQueryLogConfigAssociation
    -> Maybe Text -> ResolverQueryLogConfigAssociation)
-> Lens
     ResolverQueryLogConfigAssociation
     ResolverQueryLogConfigAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfigAssociation' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:ResolverQueryLogConfigAssociation' :: ResolverQueryLogConfigAssociation -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: ResolverQueryLogConfigAssociation
s@ResolverQueryLogConfigAssociation' {} Maybe Text
a -> ResolverQueryLogConfigAssociation
s {$sel:resourceId:ResolverQueryLogConfigAssociation' :: Maybe Text
resourceId = Maybe Text
a} :: ResolverQueryLogConfigAssociation)

-- | If the value of @Status@ is @FAILED@, the value of @Error@ indicates the
-- cause:
--
-- -   @DESTINATION_NOT_FOUND@: The specified destination (for example, an
--     Amazon S3 bucket) was deleted.
--
-- -   @ACCESS_DENIED@: Permissions don\'t allow sending logs to the
--     destination.
--
-- If the value of @Status@ is a value other than @FAILED@, @Error@ is
-- null.
resolverQueryLogConfigAssociation_error :: Lens.Lens' ResolverQueryLogConfigAssociation (Prelude.Maybe ResolverQueryLogConfigAssociationError)
resolverQueryLogConfigAssociation_error :: (Maybe ResolverQueryLogConfigAssociationError
 -> f (Maybe ResolverQueryLogConfigAssociationError))
-> ResolverQueryLogConfigAssociation
-> f ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation_error = (ResolverQueryLogConfigAssociation
 -> Maybe ResolverQueryLogConfigAssociationError)
-> (ResolverQueryLogConfigAssociation
    -> Maybe ResolverQueryLogConfigAssociationError
    -> ResolverQueryLogConfigAssociation)
-> Lens
     ResolverQueryLogConfigAssociation
     ResolverQueryLogConfigAssociation
     (Maybe ResolverQueryLogConfigAssociationError)
     (Maybe ResolverQueryLogConfigAssociationError)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfigAssociation' {Maybe ResolverQueryLogConfigAssociationError
error :: Maybe ResolverQueryLogConfigAssociationError
$sel:error:ResolverQueryLogConfigAssociation' :: ResolverQueryLogConfigAssociation
-> Maybe ResolverQueryLogConfigAssociationError
error} -> Maybe ResolverQueryLogConfigAssociationError
error) (\s :: ResolverQueryLogConfigAssociation
s@ResolverQueryLogConfigAssociation' {} Maybe ResolverQueryLogConfigAssociationError
a -> ResolverQueryLogConfigAssociation
s {$sel:error:ResolverQueryLogConfigAssociation' :: Maybe ResolverQueryLogConfigAssociationError
error = Maybe ResolverQueryLogConfigAssociationError
a} :: ResolverQueryLogConfigAssociation)

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

-- | Contains additional information about the error. If the value or @Error@
-- is null, the value of @ErrorMessage@ also is null.
resolverQueryLogConfigAssociation_errorMessage :: Lens.Lens' ResolverQueryLogConfigAssociation (Prelude.Maybe Prelude.Text)
resolverQueryLogConfigAssociation_errorMessage :: (Maybe Text -> f (Maybe Text))
-> ResolverQueryLogConfigAssociation
-> f ResolverQueryLogConfigAssociation
resolverQueryLogConfigAssociation_errorMessage = (ResolverQueryLogConfigAssociation -> Maybe Text)
-> (ResolverQueryLogConfigAssociation
    -> Maybe Text -> ResolverQueryLogConfigAssociation)
-> Lens
     ResolverQueryLogConfigAssociation
     ResolverQueryLogConfigAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverQueryLogConfigAssociation' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:ResolverQueryLogConfigAssociation' :: ResolverQueryLogConfigAssociation -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: ResolverQueryLogConfigAssociation
s@ResolverQueryLogConfigAssociation' {} Maybe Text
a -> ResolverQueryLogConfigAssociation
s {$sel:errorMessage:ResolverQueryLogConfigAssociation' :: Maybe Text
errorMessage = Maybe Text
a} :: ResolverQueryLogConfigAssociation)

instance
  Core.FromJSON
    ResolverQueryLogConfigAssociation
  where
  parseJSON :: Value -> Parser ResolverQueryLogConfigAssociation
parseJSON =
    String
-> (Object -> Parser ResolverQueryLogConfigAssociation)
-> Value
-> Parser ResolverQueryLogConfigAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResolverQueryLogConfigAssociation"
      ( \Object
x ->
          Maybe Text
-> Maybe ResolverQueryLogConfigAssociationStatus
-> Maybe Text
-> Maybe Text
-> Maybe ResolverQueryLogConfigAssociationError
-> Maybe Text
-> Maybe Text
-> ResolverQueryLogConfigAssociation
ResolverQueryLogConfigAssociation'
            (Maybe Text
 -> Maybe ResolverQueryLogConfigAssociationStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe ResolverQueryLogConfigAssociationError
 -> Maybe Text
 -> Maybe Text
 -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResolverQueryLogConfigAssociationStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResolverQueryLogConfigAssociationError
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfigAssociation)
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 ResolverQueryLogConfigAssociationStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResolverQueryLogConfigAssociationError
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe ResolverQueryLogConfigAssociationStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ResolverQueryLogConfigAssociationError
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfigAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe ResolverQueryLogConfigAssociationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ResolverQueryLogConfigAssociationError
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ResolverQueryLogConfigAssociationError
      -> Maybe Text
      -> Maybe Text
      -> ResolverQueryLogConfigAssociation)
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
"ResolverQueryLogConfigId")
            Parser
  (Maybe Text
   -> Maybe ResolverQueryLogConfigAssociationError
   -> Maybe Text
   -> Maybe Text
   -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResolverQueryLogConfigAssociationError
      -> Maybe Text -> Maybe Text -> ResolverQueryLogConfigAssociation)
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
"ResourceId")
            Parser
  (Maybe ResolverQueryLogConfigAssociationError
   -> Maybe Text -> Maybe Text -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe ResolverQueryLogConfigAssociationError)
-> Parser
     (Maybe Text -> Maybe Text -> ResolverQueryLogConfigAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe ResolverQueryLogConfigAssociationError)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Error")
            Parser
  (Maybe Text -> Maybe Text -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ResolverQueryLogConfigAssociation)
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")
            Parser (Maybe Text -> ResolverQueryLogConfigAssociation)
-> Parser (Maybe Text) -> Parser ResolverQueryLogConfigAssociation
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
"ErrorMessage")
      )

instance
  Prelude.Hashable
    ResolverQueryLogConfigAssociation

instance
  Prelude.NFData
    ResolverQueryLogConfigAssociation