{-# 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.MediaPackageVOD.Types.EgressEndpoint
-- 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.MediaPackageVOD.Types.EgressEndpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The endpoint URL used to access an Asset using one
-- PackagingConfiguration.
--
-- /See:/ 'newEgressEndpoint' smart constructor.
data EgressEndpoint = EgressEndpoint'
  { -- | The current processing status of the asset used for the packaging
    -- configuration. The status can be either QUEUED, PROCESSING, PLAYABLE, or
    -- FAILED. Status information won\'t be available for most assets ingested
    -- before 2021-09-30.
    EgressEndpoint -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The URL of the parent manifest for the repackaged Asset.
    EgressEndpoint -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The ID of the PackagingConfiguration being applied to the Asset.
    EgressEndpoint -> Maybe Text
packagingConfigurationId :: Prelude.Maybe Prelude.Text
  }
  deriving (EgressEndpoint -> EgressEndpoint -> Bool
(EgressEndpoint -> EgressEndpoint -> Bool)
-> (EgressEndpoint -> EgressEndpoint -> Bool) -> Eq EgressEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EgressEndpoint -> EgressEndpoint -> Bool
$c/= :: EgressEndpoint -> EgressEndpoint -> Bool
== :: EgressEndpoint -> EgressEndpoint -> Bool
$c== :: EgressEndpoint -> EgressEndpoint -> Bool
Prelude.Eq, ReadPrec [EgressEndpoint]
ReadPrec EgressEndpoint
Int -> ReadS EgressEndpoint
ReadS [EgressEndpoint]
(Int -> ReadS EgressEndpoint)
-> ReadS [EgressEndpoint]
-> ReadPrec EgressEndpoint
-> ReadPrec [EgressEndpoint]
-> Read EgressEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EgressEndpoint]
$creadListPrec :: ReadPrec [EgressEndpoint]
readPrec :: ReadPrec EgressEndpoint
$creadPrec :: ReadPrec EgressEndpoint
readList :: ReadS [EgressEndpoint]
$creadList :: ReadS [EgressEndpoint]
readsPrec :: Int -> ReadS EgressEndpoint
$creadsPrec :: Int -> ReadS EgressEndpoint
Prelude.Read, Int -> EgressEndpoint -> ShowS
[EgressEndpoint] -> ShowS
EgressEndpoint -> String
(Int -> EgressEndpoint -> ShowS)
-> (EgressEndpoint -> String)
-> ([EgressEndpoint] -> ShowS)
-> Show EgressEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EgressEndpoint] -> ShowS
$cshowList :: [EgressEndpoint] -> ShowS
show :: EgressEndpoint -> String
$cshow :: EgressEndpoint -> String
showsPrec :: Int -> EgressEndpoint -> ShowS
$cshowsPrec :: Int -> EgressEndpoint -> ShowS
Prelude.Show, (forall x. EgressEndpoint -> Rep EgressEndpoint x)
-> (forall x. Rep EgressEndpoint x -> EgressEndpoint)
-> Generic EgressEndpoint
forall x. Rep EgressEndpoint x -> EgressEndpoint
forall x. EgressEndpoint -> Rep EgressEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EgressEndpoint x -> EgressEndpoint
$cfrom :: forall x. EgressEndpoint -> Rep EgressEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'EgressEndpoint' 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', 'egressEndpoint_status' - The current processing status of the asset used for the packaging
-- configuration. The status can be either QUEUED, PROCESSING, PLAYABLE, or
-- FAILED. Status information won\'t be available for most assets ingested
-- before 2021-09-30.
--
-- 'url', 'egressEndpoint_url' - The URL of the parent manifest for the repackaged Asset.
--
-- 'packagingConfigurationId', 'egressEndpoint_packagingConfigurationId' - The ID of the PackagingConfiguration being applied to the Asset.
newEgressEndpoint ::
  EgressEndpoint
newEgressEndpoint :: EgressEndpoint
newEgressEndpoint =
  EgressEndpoint' :: Maybe Text -> Maybe Text -> Maybe Text -> EgressEndpoint
EgressEndpoint'
    { $sel:status:EgressEndpoint' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:url:EgressEndpoint' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:packagingConfigurationId:EgressEndpoint' :: Maybe Text
packagingConfigurationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current processing status of the asset used for the packaging
-- configuration. The status can be either QUEUED, PROCESSING, PLAYABLE, or
-- FAILED. Status information won\'t be available for most assets ingested
-- before 2021-09-30.
egressEndpoint_status :: Lens.Lens' EgressEndpoint (Prelude.Maybe Prelude.Text)
egressEndpoint_status :: (Maybe Text -> f (Maybe Text))
-> EgressEndpoint -> f EgressEndpoint
egressEndpoint_status = (EgressEndpoint -> Maybe Text)
-> (EgressEndpoint -> Maybe Text -> EgressEndpoint)
-> Lens EgressEndpoint EgressEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EgressEndpoint' {Maybe Text
status :: Maybe Text
$sel:status:EgressEndpoint' :: EgressEndpoint -> Maybe Text
status} -> Maybe Text
status) (\s :: EgressEndpoint
s@EgressEndpoint' {} Maybe Text
a -> EgressEndpoint
s {$sel:status:EgressEndpoint' :: Maybe Text
status = Maybe Text
a} :: EgressEndpoint)

-- | The URL of the parent manifest for the repackaged Asset.
egressEndpoint_url :: Lens.Lens' EgressEndpoint (Prelude.Maybe Prelude.Text)
egressEndpoint_url :: (Maybe Text -> f (Maybe Text))
-> EgressEndpoint -> f EgressEndpoint
egressEndpoint_url = (EgressEndpoint -> Maybe Text)
-> (EgressEndpoint -> Maybe Text -> EgressEndpoint)
-> Lens EgressEndpoint EgressEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EgressEndpoint' {Maybe Text
url :: Maybe Text
$sel:url:EgressEndpoint' :: EgressEndpoint -> Maybe Text
url} -> Maybe Text
url) (\s :: EgressEndpoint
s@EgressEndpoint' {} Maybe Text
a -> EgressEndpoint
s {$sel:url:EgressEndpoint' :: Maybe Text
url = Maybe Text
a} :: EgressEndpoint)

-- | The ID of the PackagingConfiguration being applied to the Asset.
egressEndpoint_packagingConfigurationId :: Lens.Lens' EgressEndpoint (Prelude.Maybe Prelude.Text)
egressEndpoint_packagingConfigurationId :: (Maybe Text -> f (Maybe Text))
-> EgressEndpoint -> f EgressEndpoint
egressEndpoint_packagingConfigurationId = (EgressEndpoint -> Maybe Text)
-> (EgressEndpoint -> Maybe Text -> EgressEndpoint)
-> Lens EgressEndpoint EgressEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EgressEndpoint' {Maybe Text
packagingConfigurationId :: Maybe Text
$sel:packagingConfigurationId:EgressEndpoint' :: EgressEndpoint -> Maybe Text
packagingConfigurationId} -> Maybe Text
packagingConfigurationId) (\s :: EgressEndpoint
s@EgressEndpoint' {} Maybe Text
a -> EgressEndpoint
s {$sel:packagingConfigurationId:EgressEndpoint' :: Maybe Text
packagingConfigurationId = Maybe Text
a} :: EgressEndpoint)

instance Core.FromJSON EgressEndpoint where
  parseJSON :: Value -> Parser EgressEndpoint
parseJSON =
    String
-> (Object -> Parser EgressEndpoint)
-> Value
-> Parser EgressEndpoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EgressEndpoint"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> EgressEndpoint
EgressEndpoint'
            (Maybe Text -> Maybe Text -> Maybe Text -> EgressEndpoint)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> EgressEndpoint)
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
"status")
            Parser (Maybe Text -> Maybe Text -> EgressEndpoint)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EgressEndpoint)
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
"url")
            Parser (Maybe Text -> EgressEndpoint)
-> Parser (Maybe Text) -> Parser EgressEndpoint
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
"packagingConfigurationId")
      )

instance Prelude.Hashable EgressEndpoint

instance Prelude.NFData EgressEndpoint