{-# 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.IVS.Types.StreamFilters
-- 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.IVS.Types.StreamFilters where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IVS.Types.StreamHealth
import qualified Amazonka.Prelude as Prelude

-- | Object specifying the stream attribute on which to filter.
--
-- /See:/ 'newStreamFilters' smart constructor.
data StreamFilters = StreamFilters'
  { -- | The stream’s health.
    StreamFilters -> Maybe StreamHealth
health :: Prelude.Maybe StreamHealth
  }
  deriving (StreamFilters -> StreamFilters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamFilters -> StreamFilters -> Bool
$c/= :: StreamFilters -> StreamFilters -> Bool
== :: StreamFilters -> StreamFilters -> Bool
$c== :: StreamFilters -> StreamFilters -> Bool
Prelude.Eq, ReadPrec [StreamFilters]
ReadPrec StreamFilters
Int -> ReadS StreamFilters
ReadS [StreamFilters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamFilters]
$creadListPrec :: ReadPrec [StreamFilters]
readPrec :: ReadPrec StreamFilters
$creadPrec :: ReadPrec StreamFilters
readList :: ReadS [StreamFilters]
$creadList :: ReadS [StreamFilters]
readsPrec :: Int -> ReadS StreamFilters
$creadsPrec :: Int -> ReadS StreamFilters
Prelude.Read, Int -> StreamFilters -> ShowS
[StreamFilters] -> ShowS
StreamFilters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamFilters] -> ShowS
$cshowList :: [StreamFilters] -> ShowS
show :: StreamFilters -> String
$cshow :: StreamFilters -> String
showsPrec :: Int -> StreamFilters -> ShowS
$cshowsPrec :: Int -> StreamFilters -> ShowS
Prelude.Show, forall x. Rep StreamFilters x -> StreamFilters
forall x. StreamFilters -> Rep StreamFilters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamFilters x -> StreamFilters
$cfrom :: forall x. StreamFilters -> Rep StreamFilters x
Prelude.Generic)

-- |
-- Create a value of 'StreamFilters' 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:
--
-- 'health', 'streamFilters_health' - The stream’s health.
newStreamFilters ::
  StreamFilters
newStreamFilters :: StreamFilters
newStreamFilters =
  StreamFilters' {$sel:health:StreamFilters' :: Maybe StreamHealth
health = forall a. Maybe a
Prelude.Nothing}

-- | The stream’s health.
streamFilters_health :: Lens.Lens' StreamFilters (Prelude.Maybe StreamHealth)
streamFilters_health :: Lens' StreamFilters (Maybe StreamHealth)
streamFilters_health = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamFilters' {Maybe StreamHealth
health :: Maybe StreamHealth
$sel:health:StreamFilters' :: StreamFilters -> Maybe StreamHealth
health} -> Maybe StreamHealth
health) (\s :: StreamFilters
s@StreamFilters' {} Maybe StreamHealth
a -> StreamFilters
s {$sel:health:StreamFilters' :: Maybe StreamHealth
health = Maybe StreamHealth
a} :: StreamFilters)

instance Prelude.Hashable StreamFilters where
  hashWithSalt :: Int -> StreamFilters -> Int
hashWithSalt Int
_salt StreamFilters' {Maybe StreamHealth
health :: Maybe StreamHealth
$sel:health:StreamFilters' :: StreamFilters -> Maybe StreamHealth
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StreamHealth
health

instance Prelude.NFData StreamFilters where
  rnf :: StreamFilters -> ()
rnf StreamFilters' {Maybe StreamHealth
health :: Maybe StreamHealth
$sel:health:StreamFilters' :: StreamFilters -> Maybe StreamHealth
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe StreamHealth
health

instance Data.ToJSON StreamFilters where
  toJSON :: StreamFilters -> Value
toJSON StreamFilters' {Maybe StreamHealth
health :: Maybe StreamHealth
$sel:health:StreamFilters' :: StreamFilters -> Maybe StreamHealth
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"health" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StreamHealth
health]
      )