{-# 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.MediaConnect.Types.ListedFlow
-- 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.MediaConnect.Types.ListedFlow where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaConnect.Types.Maintenance
import Amazonka.MediaConnect.Types.SourceType
import Amazonka.MediaConnect.Types.Status
import qualified Amazonka.Prelude as Prelude

-- | Provides a summary of a flow, including its ARN, Availability Zone, and
-- source type.
--
-- /See:/ 'newListedFlow' smart constructor.
data ListedFlow = ListedFlow'
  { ListedFlow -> Maybe Maintenance
maintenance :: Prelude.Maybe Maintenance,
    -- | The current status of the flow.
    ListedFlow -> Status
status :: Status,
    -- | A description of the flow.
    ListedFlow -> Text
description :: Prelude.Text,
    -- | The type of source. This value is either owned (originated somewhere
    -- other than an AWS Elemental MediaConnect flow owned by another AWS
    -- account) or entitled (originated at an AWS Elemental MediaConnect flow
    -- owned by another AWS account).
    ListedFlow -> SourceType
sourceType :: SourceType,
    -- | The Availability Zone that the flow was created in.
    ListedFlow -> Text
availabilityZone :: Prelude.Text,
    -- | The ARN of the flow.
    ListedFlow -> Text
flowArn :: Prelude.Text,
    -- | The name of the flow.
    ListedFlow -> Text
name :: Prelude.Text
  }
  deriving (ListedFlow -> ListedFlow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListedFlow -> ListedFlow -> Bool
$c/= :: ListedFlow -> ListedFlow -> Bool
== :: ListedFlow -> ListedFlow -> Bool
$c== :: ListedFlow -> ListedFlow -> Bool
Prelude.Eq, ReadPrec [ListedFlow]
ReadPrec ListedFlow
Int -> ReadS ListedFlow
ReadS [ListedFlow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListedFlow]
$creadListPrec :: ReadPrec [ListedFlow]
readPrec :: ReadPrec ListedFlow
$creadPrec :: ReadPrec ListedFlow
readList :: ReadS [ListedFlow]
$creadList :: ReadS [ListedFlow]
readsPrec :: Int -> ReadS ListedFlow
$creadsPrec :: Int -> ReadS ListedFlow
Prelude.Read, Int -> ListedFlow -> ShowS
[ListedFlow] -> ShowS
ListedFlow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListedFlow] -> ShowS
$cshowList :: [ListedFlow] -> ShowS
show :: ListedFlow -> String
$cshow :: ListedFlow -> String
showsPrec :: Int -> ListedFlow -> ShowS
$cshowsPrec :: Int -> ListedFlow -> ShowS
Prelude.Show, forall x. Rep ListedFlow x -> ListedFlow
forall x. ListedFlow -> Rep ListedFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListedFlow x -> ListedFlow
$cfrom :: forall x. ListedFlow -> Rep ListedFlow x
Prelude.Generic)

-- |
-- Create a value of 'ListedFlow' 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:
--
-- 'maintenance', 'listedFlow_maintenance' - Undocumented member.
--
-- 'status', 'listedFlow_status' - The current status of the flow.
--
-- 'description', 'listedFlow_description' - A description of the flow.
--
-- 'sourceType', 'listedFlow_sourceType' - The type of source. This value is either owned (originated somewhere
-- other than an AWS Elemental MediaConnect flow owned by another AWS
-- account) or entitled (originated at an AWS Elemental MediaConnect flow
-- owned by another AWS account).
--
-- 'availabilityZone', 'listedFlow_availabilityZone' - The Availability Zone that the flow was created in.
--
-- 'flowArn', 'listedFlow_flowArn' - The ARN of the flow.
--
-- 'name', 'listedFlow_name' - The name of the flow.
newListedFlow ::
  -- | 'status'
  Status ->
  -- | 'description'
  Prelude.Text ->
  -- | 'sourceType'
  SourceType ->
  -- | 'availabilityZone'
  Prelude.Text ->
  -- | 'flowArn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ListedFlow
newListedFlow :: Status -> Text -> SourceType -> Text -> Text -> Text -> ListedFlow
newListedFlow
  Status
pStatus_
  Text
pDescription_
  SourceType
pSourceType_
  Text
pAvailabilityZone_
  Text
pFlowArn_
  Text
pName_ =
    ListedFlow'
      { $sel:maintenance:ListedFlow' :: Maybe Maintenance
maintenance = forall a. Maybe a
Prelude.Nothing,
        $sel:status:ListedFlow' :: Status
status = Status
pStatus_,
        $sel:description:ListedFlow' :: Text
description = Text
pDescription_,
        $sel:sourceType:ListedFlow' :: SourceType
sourceType = SourceType
pSourceType_,
        $sel:availabilityZone:ListedFlow' :: Text
availabilityZone = Text
pAvailabilityZone_,
        $sel:flowArn:ListedFlow' :: Text
flowArn = Text
pFlowArn_,
        $sel:name:ListedFlow' :: Text
name = Text
pName_
      }

-- | Undocumented member.
listedFlow_maintenance :: Lens.Lens' ListedFlow (Prelude.Maybe Maintenance)
listedFlow_maintenance :: Lens' ListedFlow (Maybe Maintenance)
listedFlow_maintenance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {Maybe Maintenance
maintenance :: Maybe Maintenance
$sel:maintenance:ListedFlow' :: ListedFlow -> Maybe Maintenance
maintenance} -> Maybe Maintenance
maintenance) (\s :: ListedFlow
s@ListedFlow' {} Maybe Maintenance
a -> ListedFlow
s {$sel:maintenance:ListedFlow' :: Maybe Maintenance
maintenance = Maybe Maintenance
a} :: ListedFlow)

-- | The current status of the flow.
listedFlow_status :: Lens.Lens' ListedFlow Status
listedFlow_status :: Lens' ListedFlow Status
listedFlow_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {Status
status :: Status
$sel:status:ListedFlow' :: ListedFlow -> Status
status} -> Status
status) (\s :: ListedFlow
s@ListedFlow' {} Status
a -> ListedFlow
s {$sel:status:ListedFlow' :: Status
status = Status
a} :: ListedFlow)

-- | A description of the flow.
listedFlow_description :: Lens.Lens' ListedFlow Prelude.Text
listedFlow_description :: Lens' ListedFlow Text
listedFlow_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {Text
description :: Text
$sel:description:ListedFlow' :: ListedFlow -> Text
description} -> Text
description) (\s :: ListedFlow
s@ListedFlow' {} Text
a -> ListedFlow
s {$sel:description:ListedFlow' :: Text
description = Text
a} :: ListedFlow)

-- | The type of source. This value is either owned (originated somewhere
-- other than an AWS Elemental MediaConnect flow owned by another AWS
-- account) or entitled (originated at an AWS Elemental MediaConnect flow
-- owned by another AWS account).
listedFlow_sourceType :: Lens.Lens' ListedFlow SourceType
listedFlow_sourceType :: Lens' ListedFlow SourceType
listedFlow_sourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {SourceType
sourceType :: SourceType
$sel:sourceType:ListedFlow' :: ListedFlow -> SourceType
sourceType} -> SourceType
sourceType) (\s :: ListedFlow
s@ListedFlow' {} SourceType
a -> ListedFlow
s {$sel:sourceType:ListedFlow' :: SourceType
sourceType = SourceType
a} :: ListedFlow)

-- | The Availability Zone that the flow was created in.
listedFlow_availabilityZone :: Lens.Lens' ListedFlow Prelude.Text
listedFlow_availabilityZone :: Lens' ListedFlow Text
listedFlow_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {Text
availabilityZone :: Text
$sel:availabilityZone:ListedFlow' :: ListedFlow -> Text
availabilityZone} -> Text
availabilityZone) (\s :: ListedFlow
s@ListedFlow' {} Text
a -> ListedFlow
s {$sel:availabilityZone:ListedFlow' :: Text
availabilityZone = Text
a} :: ListedFlow)

-- | The ARN of the flow.
listedFlow_flowArn :: Lens.Lens' ListedFlow Prelude.Text
listedFlow_flowArn :: Lens' ListedFlow Text
listedFlow_flowArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {Text
flowArn :: Text
$sel:flowArn:ListedFlow' :: ListedFlow -> Text
flowArn} -> Text
flowArn) (\s :: ListedFlow
s@ListedFlow' {} Text
a -> ListedFlow
s {$sel:flowArn:ListedFlow' :: Text
flowArn = Text
a} :: ListedFlow)

-- | The name of the flow.
listedFlow_name :: Lens.Lens' ListedFlow Prelude.Text
listedFlow_name :: Lens' ListedFlow Text
listedFlow_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListedFlow' {Text
name :: Text
$sel:name:ListedFlow' :: ListedFlow -> Text
name} -> Text
name) (\s :: ListedFlow
s@ListedFlow' {} Text
a -> ListedFlow
s {$sel:name:ListedFlow' :: Text
name = Text
a} :: ListedFlow)

instance Data.FromJSON ListedFlow where
  parseJSON :: Value -> Parser ListedFlow
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListedFlow"
      ( \Object
x ->
          Maybe Maintenance
-> Status
-> Text
-> SourceType
-> Text
-> Text
-> Text
-> ListedFlow
ListedFlow'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"maintenance")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"sourceType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"availabilityZone")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"flowArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
      )

instance Prelude.Hashable ListedFlow where
  hashWithSalt :: Int -> ListedFlow -> Int
hashWithSalt Int
_salt ListedFlow' {Maybe Maintenance
Text
SourceType
Status
name :: Text
flowArn :: Text
availabilityZone :: Text
sourceType :: SourceType
description :: Text
status :: Status
maintenance :: Maybe Maintenance
$sel:name:ListedFlow' :: ListedFlow -> Text
$sel:flowArn:ListedFlow' :: ListedFlow -> Text
$sel:availabilityZone:ListedFlow' :: ListedFlow -> Text
$sel:sourceType:ListedFlow' :: ListedFlow -> SourceType
$sel:description:ListedFlow' :: ListedFlow -> Text
$sel:status:ListedFlow' :: ListedFlow -> Status
$sel:maintenance:ListedFlow' :: ListedFlow -> Maybe Maintenance
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Maintenance
maintenance
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Status
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` SourceType
sourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
availabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
flowArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData ListedFlow where
  rnf :: ListedFlow -> ()
rnf ListedFlow' {Maybe Maintenance
Text
SourceType
Status
name :: Text
flowArn :: Text
availabilityZone :: Text
sourceType :: SourceType
description :: Text
status :: Status
maintenance :: Maybe Maintenance
$sel:name:ListedFlow' :: ListedFlow -> Text
$sel:flowArn:ListedFlow' :: ListedFlow -> Text
$sel:availabilityZone:ListedFlow' :: ListedFlow -> Text
$sel:sourceType:ListedFlow' :: ListedFlow -> SourceType
$sel:description:ListedFlow' :: ListedFlow -> Text
$sel:status:ListedFlow' :: ListedFlow -> Status
$sel:maintenance:ListedFlow' :: ListedFlow -> Maybe Maintenance
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Maintenance
maintenance
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Status
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf SourceType
sourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
availabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
flowArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name