{-# 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.EC2.Types.IntegrateServices
-- 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.EC2.Types.IntegrateServices where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.AthenaIntegration
import qualified Amazonka.Prelude as Prelude

-- | Describes service integrations with VPC Flow logs.
--
-- /See:/ 'newIntegrateServices' smart constructor.
data IntegrateServices = IntegrateServices'
  { -- | Information about the integration with Amazon Athena.
    IntegrateServices -> Maybe (NonEmpty AthenaIntegration)
athenaIntegrations :: Prelude.Maybe (Prelude.NonEmpty AthenaIntegration)
  }
  deriving (IntegrateServices -> IntegrateServices -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IntegrateServices -> IntegrateServices -> Bool
$c/= :: IntegrateServices -> IntegrateServices -> Bool
== :: IntegrateServices -> IntegrateServices -> Bool
$c== :: IntegrateServices -> IntegrateServices -> Bool
Prelude.Eq, ReadPrec [IntegrateServices]
ReadPrec IntegrateServices
Int -> ReadS IntegrateServices
ReadS [IntegrateServices]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IntegrateServices]
$creadListPrec :: ReadPrec [IntegrateServices]
readPrec :: ReadPrec IntegrateServices
$creadPrec :: ReadPrec IntegrateServices
readList :: ReadS [IntegrateServices]
$creadList :: ReadS [IntegrateServices]
readsPrec :: Int -> ReadS IntegrateServices
$creadsPrec :: Int -> ReadS IntegrateServices
Prelude.Read, Int -> IntegrateServices -> ShowS
[IntegrateServices] -> ShowS
IntegrateServices -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IntegrateServices] -> ShowS
$cshowList :: [IntegrateServices] -> ShowS
show :: IntegrateServices -> String
$cshow :: IntegrateServices -> String
showsPrec :: Int -> IntegrateServices -> ShowS
$cshowsPrec :: Int -> IntegrateServices -> ShowS
Prelude.Show, forall x. Rep IntegrateServices x -> IntegrateServices
forall x. IntegrateServices -> Rep IntegrateServices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IntegrateServices x -> IntegrateServices
$cfrom :: forall x. IntegrateServices -> Rep IntegrateServices x
Prelude.Generic)

-- |
-- Create a value of 'IntegrateServices' 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:
--
-- 'athenaIntegrations', 'integrateServices_athenaIntegrations' - Information about the integration with Amazon Athena.
newIntegrateServices ::
  IntegrateServices
newIntegrateServices :: IntegrateServices
newIntegrateServices =
  IntegrateServices'
    { $sel:athenaIntegrations:IntegrateServices' :: Maybe (NonEmpty AthenaIntegration)
athenaIntegrations =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the integration with Amazon Athena.
integrateServices_athenaIntegrations :: Lens.Lens' IntegrateServices (Prelude.Maybe (Prelude.NonEmpty AthenaIntegration))
integrateServices_athenaIntegrations :: Lens' IntegrateServices (Maybe (NonEmpty AthenaIntegration))
integrateServices_athenaIntegrations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IntegrateServices' {Maybe (NonEmpty AthenaIntegration)
athenaIntegrations :: Maybe (NonEmpty AthenaIntegration)
$sel:athenaIntegrations:IntegrateServices' :: IntegrateServices -> Maybe (NonEmpty AthenaIntegration)
athenaIntegrations} -> Maybe (NonEmpty AthenaIntegration)
athenaIntegrations) (\s :: IntegrateServices
s@IntegrateServices' {} Maybe (NonEmpty AthenaIntegration)
a -> IntegrateServices
s {$sel:athenaIntegrations:IntegrateServices' :: Maybe (NonEmpty AthenaIntegration)
athenaIntegrations = Maybe (NonEmpty AthenaIntegration)
a} :: IntegrateServices) 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

instance Prelude.Hashable IntegrateServices where
  hashWithSalt :: Int -> IntegrateServices -> Int
hashWithSalt Int
_salt IntegrateServices' {Maybe (NonEmpty AthenaIntegration)
athenaIntegrations :: Maybe (NonEmpty AthenaIntegration)
$sel:athenaIntegrations:IntegrateServices' :: IntegrateServices -> Maybe (NonEmpty AthenaIntegration)
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty AthenaIntegration)
athenaIntegrations

instance Prelude.NFData IntegrateServices where
  rnf :: IntegrateServices -> ()
rnf IntegrateServices' {Maybe (NonEmpty AthenaIntegration)
athenaIntegrations :: Maybe (NonEmpty AthenaIntegration)
$sel:athenaIntegrations:IntegrateServices' :: IntegrateServices -> Maybe (NonEmpty AthenaIntegration)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AthenaIntegration)
athenaIntegrations

instance Data.ToQuery IntegrateServices where
  toQuery :: IntegrateServices -> QueryString
toQuery IntegrateServices' {Maybe (NonEmpty AthenaIntegration)
athenaIntegrations :: Maybe (NonEmpty AthenaIntegration)
$sel:athenaIntegrations:IntegrateServices' :: IntegrateServices -> Maybe (NonEmpty AthenaIntegration)
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"AthenaIntegration"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty AthenaIntegration)
athenaIntegrations
          )
      ]