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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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
(ListedFlow -> ListedFlow -> Bool)
-> (ListedFlow -> ListedFlow -> Bool) -> Eq ListedFlow
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]
(Int -> ReadS ListedFlow)
-> ReadS [ListedFlow]
-> ReadPrec ListedFlow
-> ReadPrec [ListedFlow]
-> Read 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
(Int -> ListedFlow -> ShowS)
-> (ListedFlow -> String)
-> ([ListedFlow] -> ShowS)
-> Show ListedFlow
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. ListedFlow -> Rep ListedFlow x)
-> (forall x. Rep ListedFlow x -> ListedFlow) -> Generic ListedFlow
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:
--
-- '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' :: Status -> Text -> SourceType -> Text -> Text -> Text -> ListedFlow
ListedFlow'
      { $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_
      }

-- | The current status of the flow.
listedFlow_status :: Lens.Lens' ListedFlow Status
listedFlow_status :: (Status -> f Status) -> ListedFlow -> f ListedFlow
listedFlow_status = (ListedFlow -> Status)
-> (ListedFlow -> Status -> ListedFlow)
-> Lens ListedFlow ListedFlow Status 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 :: (Text -> f Text) -> ListedFlow -> f ListedFlow
listedFlow_description = (ListedFlow -> Text)
-> (ListedFlow -> Text -> ListedFlow)
-> Lens ListedFlow ListedFlow Text Text
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 :: (SourceType -> f SourceType) -> ListedFlow -> f ListedFlow
listedFlow_sourceType = (ListedFlow -> SourceType)
-> (ListedFlow -> SourceType -> ListedFlow)
-> Lens ListedFlow ListedFlow SourceType 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 :: (Text -> f Text) -> ListedFlow -> f ListedFlow
listedFlow_availabilityZone = (ListedFlow -> Text)
-> (ListedFlow -> Text -> ListedFlow)
-> Lens ListedFlow ListedFlow Text Text
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 :: (Text -> f Text) -> ListedFlow -> f ListedFlow
listedFlow_flowArn = (ListedFlow -> Text)
-> (ListedFlow -> Text -> ListedFlow)
-> Lens ListedFlow ListedFlow Text Text
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 :: (Text -> f Text) -> ListedFlow -> f ListedFlow
listedFlow_name = (ListedFlow -> Text)
-> (ListedFlow -> Text -> ListedFlow)
-> Lens ListedFlow ListedFlow Text Text
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 Core.FromJSON ListedFlow where
  parseJSON :: Value -> Parser ListedFlow
parseJSON =
    String
-> (Object -> Parser ListedFlow) -> Value -> Parser ListedFlow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListedFlow"
      ( \Object
x ->
          Status -> Text -> SourceType -> Text -> Text -> Text -> ListedFlow
ListedFlow'
            (Status
 -> Text -> SourceType -> Text -> Text -> Text -> ListedFlow)
-> Parser Status
-> Parser
     (Text -> SourceType -> Text -> Text -> Text -> ListedFlow)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Status
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser (Text -> SourceType -> Text -> Text -> Text -> ListedFlow)
-> Parser Text
-> Parser (SourceType -> Text -> Text -> Text -> ListedFlow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"description")
            Parser (SourceType -> Text -> Text -> Text -> ListedFlow)
-> Parser SourceType -> Parser (Text -> Text -> Text -> ListedFlow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SourceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"sourceType")
            Parser (Text -> Text -> Text -> ListedFlow)
-> Parser Text -> Parser (Text -> Text -> ListedFlow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"availabilityZone")
            Parser (Text -> Text -> ListedFlow)
-> Parser Text -> Parser (Text -> ListedFlow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"flowArn")
            Parser (Text -> ListedFlow) -> Parser Text -> Parser ListedFlow
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
      )

instance Prelude.Hashable ListedFlow

instance Prelude.NFData ListedFlow