{-# 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.PackagingGroup
-- 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.PackagingGroup where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaPackageVOD.Types.Authorization
import Amazonka.MediaPackageVOD.Types.EgressAccessLogs
import qualified Amazonka.Prelude as Prelude

-- | A MediaPackage VOD PackagingGroup resource.
--
-- /See:/ 'newPackagingGroup' smart constructor.
data PackagingGroup = PackagingGroup'
  { -- | The ARN of the PackagingGroup.
    PackagingGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    PackagingGroup -> Maybe Authorization
authorization :: Prelude.Maybe Authorization,
    -- | The fully qualified domain name for Assets in the PackagingGroup.
    PackagingGroup -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The ID of the PackagingGroup.
    PackagingGroup -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    PackagingGroup -> Maybe EgressAccessLogs
egressAccessLogs :: Prelude.Maybe EgressAccessLogs,
    PackagingGroup -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (PackagingGroup -> PackagingGroup -> Bool
(PackagingGroup -> PackagingGroup -> Bool)
-> (PackagingGroup -> PackagingGroup -> Bool) -> Eq PackagingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackagingGroup -> PackagingGroup -> Bool
$c/= :: PackagingGroup -> PackagingGroup -> Bool
== :: PackagingGroup -> PackagingGroup -> Bool
$c== :: PackagingGroup -> PackagingGroup -> Bool
Prelude.Eq, ReadPrec [PackagingGroup]
ReadPrec PackagingGroup
Int -> ReadS PackagingGroup
ReadS [PackagingGroup]
(Int -> ReadS PackagingGroup)
-> ReadS [PackagingGroup]
-> ReadPrec PackagingGroup
-> ReadPrec [PackagingGroup]
-> Read PackagingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackagingGroup]
$creadListPrec :: ReadPrec [PackagingGroup]
readPrec :: ReadPrec PackagingGroup
$creadPrec :: ReadPrec PackagingGroup
readList :: ReadS [PackagingGroup]
$creadList :: ReadS [PackagingGroup]
readsPrec :: Int -> ReadS PackagingGroup
$creadsPrec :: Int -> ReadS PackagingGroup
Prelude.Read, Int -> PackagingGroup -> ShowS
[PackagingGroup] -> ShowS
PackagingGroup -> String
(Int -> PackagingGroup -> ShowS)
-> (PackagingGroup -> String)
-> ([PackagingGroup] -> ShowS)
-> Show PackagingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackagingGroup] -> ShowS
$cshowList :: [PackagingGroup] -> ShowS
show :: PackagingGroup -> String
$cshow :: PackagingGroup -> String
showsPrec :: Int -> PackagingGroup -> ShowS
$cshowsPrec :: Int -> PackagingGroup -> ShowS
Prelude.Show, (forall x. PackagingGroup -> Rep PackagingGroup x)
-> (forall x. Rep PackagingGroup x -> PackagingGroup)
-> Generic PackagingGroup
forall x. Rep PackagingGroup x -> PackagingGroup
forall x. PackagingGroup -> Rep PackagingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackagingGroup x -> PackagingGroup
$cfrom :: forall x. PackagingGroup -> Rep PackagingGroup x
Prelude.Generic)

-- |
-- Create a value of 'PackagingGroup' 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:
--
-- 'arn', 'packagingGroup_arn' - The ARN of the PackagingGroup.
--
-- 'authorization', 'packagingGroup_authorization' - Undocumented member.
--
-- 'domainName', 'packagingGroup_domainName' - The fully qualified domain name for Assets in the PackagingGroup.
--
-- 'id', 'packagingGroup_id' - The ID of the PackagingGroup.
--
-- 'egressAccessLogs', 'packagingGroup_egressAccessLogs' - Undocumented member.
--
-- 'tags', 'packagingGroup_tags' - Undocumented member.
newPackagingGroup ::
  PackagingGroup
newPackagingGroup :: PackagingGroup
newPackagingGroup =
  PackagingGroup' :: Maybe Text
-> Maybe Authorization
-> Maybe Text
-> Maybe Text
-> Maybe EgressAccessLogs
-> Maybe (HashMap Text Text)
-> PackagingGroup
PackagingGroup'
    { $sel:arn:PackagingGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:authorization:PackagingGroup' :: Maybe Authorization
authorization = Maybe Authorization
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:PackagingGroup' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:PackagingGroup' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:egressAccessLogs:PackagingGroup' :: Maybe EgressAccessLogs
egressAccessLogs = Maybe EgressAccessLogs
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PackagingGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the PackagingGroup.
packagingGroup_arn :: Lens.Lens' PackagingGroup (Prelude.Maybe Prelude.Text)
packagingGroup_arn :: (Maybe Text -> f (Maybe Text))
-> PackagingGroup -> f PackagingGroup
packagingGroup_arn = (PackagingGroup -> Maybe Text)
-> (PackagingGroup -> Maybe Text -> PackagingGroup)
-> Lens PackagingGroup PackagingGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackagingGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:PackagingGroup' :: PackagingGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: PackagingGroup
s@PackagingGroup' {} Maybe Text
a -> PackagingGroup
s {$sel:arn:PackagingGroup' :: Maybe Text
arn = Maybe Text
a} :: PackagingGroup)

-- | Undocumented member.
packagingGroup_authorization :: Lens.Lens' PackagingGroup (Prelude.Maybe Authorization)
packagingGroup_authorization :: (Maybe Authorization -> f (Maybe Authorization))
-> PackagingGroup -> f PackagingGroup
packagingGroup_authorization = (PackagingGroup -> Maybe Authorization)
-> (PackagingGroup -> Maybe Authorization -> PackagingGroup)
-> Lens
     PackagingGroup
     PackagingGroup
     (Maybe Authorization)
     (Maybe Authorization)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackagingGroup' {Maybe Authorization
authorization :: Maybe Authorization
$sel:authorization:PackagingGroup' :: PackagingGroup -> Maybe Authorization
authorization} -> Maybe Authorization
authorization) (\s :: PackagingGroup
s@PackagingGroup' {} Maybe Authorization
a -> PackagingGroup
s {$sel:authorization:PackagingGroup' :: Maybe Authorization
authorization = Maybe Authorization
a} :: PackagingGroup)

-- | The fully qualified domain name for Assets in the PackagingGroup.
packagingGroup_domainName :: Lens.Lens' PackagingGroup (Prelude.Maybe Prelude.Text)
packagingGroup_domainName :: (Maybe Text -> f (Maybe Text))
-> PackagingGroup -> f PackagingGroup
packagingGroup_domainName = (PackagingGroup -> Maybe Text)
-> (PackagingGroup -> Maybe Text -> PackagingGroup)
-> Lens PackagingGroup PackagingGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackagingGroup' {Maybe Text
domainName :: Maybe Text
$sel:domainName:PackagingGroup' :: PackagingGroup -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: PackagingGroup
s@PackagingGroup' {} Maybe Text
a -> PackagingGroup
s {$sel:domainName:PackagingGroup' :: Maybe Text
domainName = Maybe Text
a} :: PackagingGroup)

-- | The ID of the PackagingGroup.
packagingGroup_id :: Lens.Lens' PackagingGroup (Prelude.Maybe Prelude.Text)
packagingGroup_id :: (Maybe Text -> f (Maybe Text))
-> PackagingGroup -> f PackagingGroup
packagingGroup_id = (PackagingGroup -> Maybe Text)
-> (PackagingGroup -> Maybe Text -> PackagingGroup)
-> Lens PackagingGroup PackagingGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackagingGroup' {Maybe Text
id :: Maybe Text
$sel:id:PackagingGroup' :: PackagingGroup -> Maybe Text
id} -> Maybe Text
id) (\s :: PackagingGroup
s@PackagingGroup' {} Maybe Text
a -> PackagingGroup
s {$sel:id:PackagingGroup' :: Maybe Text
id = Maybe Text
a} :: PackagingGroup)

-- | Undocumented member.
packagingGroup_egressAccessLogs :: Lens.Lens' PackagingGroup (Prelude.Maybe EgressAccessLogs)
packagingGroup_egressAccessLogs :: (Maybe EgressAccessLogs -> f (Maybe EgressAccessLogs))
-> PackagingGroup -> f PackagingGroup
packagingGroup_egressAccessLogs = (PackagingGroup -> Maybe EgressAccessLogs)
-> (PackagingGroup -> Maybe EgressAccessLogs -> PackagingGroup)
-> Lens
     PackagingGroup
     PackagingGroup
     (Maybe EgressAccessLogs)
     (Maybe EgressAccessLogs)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackagingGroup' {Maybe EgressAccessLogs
egressAccessLogs :: Maybe EgressAccessLogs
$sel:egressAccessLogs:PackagingGroup' :: PackagingGroup -> Maybe EgressAccessLogs
egressAccessLogs} -> Maybe EgressAccessLogs
egressAccessLogs) (\s :: PackagingGroup
s@PackagingGroup' {} Maybe EgressAccessLogs
a -> PackagingGroup
s {$sel:egressAccessLogs:PackagingGroup' :: Maybe EgressAccessLogs
egressAccessLogs = Maybe EgressAccessLogs
a} :: PackagingGroup)

-- | Undocumented member.
packagingGroup_tags :: Lens.Lens' PackagingGroup (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
packagingGroup_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PackagingGroup -> f PackagingGroup
packagingGroup_tags = (PackagingGroup -> Maybe (HashMap Text Text))
-> (PackagingGroup -> Maybe (HashMap Text Text) -> PackagingGroup)
-> Lens
     PackagingGroup
     PackagingGroup
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackagingGroup' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PackagingGroup' :: PackagingGroup -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PackagingGroup
s@PackagingGroup' {} Maybe (HashMap Text Text)
a -> PackagingGroup
s {$sel:tags:PackagingGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PackagingGroup) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PackagingGroup -> f PackagingGroup)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PackagingGroup
-> f PackagingGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON PackagingGroup where
  parseJSON :: Value -> Parser PackagingGroup
parseJSON =
    String
-> (Object -> Parser PackagingGroup)
-> Value
-> Parser PackagingGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PackagingGroup"
      ( \Object
x ->
          Maybe Text
-> Maybe Authorization
-> Maybe Text
-> Maybe Text
-> Maybe EgressAccessLogs
-> Maybe (HashMap Text Text)
-> PackagingGroup
PackagingGroup'
            (Maybe Text
 -> Maybe Authorization
 -> Maybe Text
 -> Maybe Text
 -> Maybe EgressAccessLogs
 -> Maybe (HashMap Text Text)
 -> PackagingGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Authorization
      -> Maybe Text
      -> Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> PackagingGroup)
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
"arn")
            Parser
  (Maybe Authorization
   -> Maybe Text
   -> Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> PackagingGroup)
-> Parser (Maybe Authorization)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> PackagingGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Authorization)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authorization")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> PackagingGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text)
      -> PackagingGroup)
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
"domainName")
            Parser
  (Maybe Text
   -> Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text)
   -> PackagingGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe EgressAccessLogs
      -> Maybe (HashMap Text Text) -> PackagingGroup)
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
"id")
            Parser
  (Maybe EgressAccessLogs
   -> Maybe (HashMap Text Text) -> PackagingGroup)
-> Parser (Maybe EgressAccessLogs)
-> Parser (Maybe (HashMap Text Text) -> PackagingGroup)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EgressAccessLogs)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"egressAccessLogs")
            Parser (Maybe (HashMap Text Text) -> PackagingGroup)
-> Parser (Maybe (HashMap Text Text)) -> Parser PackagingGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable PackagingGroup

instance Prelude.NFData PackagingGroup