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

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

-- | A MediaPackage VOD Asset resource.
--
-- /See:/ 'newAssetShallow' smart constructor.
data AssetShallow = AssetShallow'
  { -- | The resource ID to include in SPEKE key requests.
    AssetShallow -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the Asset.
    AssetShallow -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time the Asset was initially submitted for Ingest.
    AssetShallow -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
    -- | The ID of the PackagingGroup for the Asset.
    AssetShallow -> Maybe Text
packagingGroupId :: Prelude.Maybe Prelude.Text,
    -- | ARN of the source object in S3.
    AssetShallow -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
    -- | The IAM role ARN used to access the source S3 bucket.
    AssetShallow -> Maybe Text
sourceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the Asset.
    AssetShallow -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    AssetShallow -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (AssetShallow -> AssetShallow -> Bool
(AssetShallow -> AssetShallow -> Bool)
-> (AssetShallow -> AssetShallow -> Bool) -> Eq AssetShallow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetShallow -> AssetShallow -> Bool
$c/= :: AssetShallow -> AssetShallow -> Bool
== :: AssetShallow -> AssetShallow -> Bool
$c== :: AssetShallow -> AssetShallow -> Bool
Prelude.Eq, ReadPrec [AssetShallow]
ReadPrec AssetShallow
Int -> ReadS AssetShallow
ReadS [AssetShallow]
(Int -> ReadS AssetShallow)
-> ReadS [AssetShallow]
-> ReadPrec AssetShallow
-> ReadPrec [AssetShallow]
-> Read AssetShallow
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetShallow]
$creadListPrec :: ReadPrec [AssetShallow]
readPrec :: ReadPrec AssetShallow
$creadPrec :: ReadPrec AssetShallow
readList :: ReadS [AssetShallow]
$creadList :: ReadS [AssetShallow]
readsPrec :: Int -> ReadS AssetShallow
$creadsPrec :: Int -> ReadS AssetShallow
Prelude.Read, Int -> AssetShallow -> ShowS
[AssetShallow] -> ShowS
AssetShallow -> String
(Int -> AssetShallow -> ShowS)
-> (AssetShallow -> String)
-> ([AssetShallow] -> ShowS)
-> Show AssetShallow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetShallow] -> ShowS
$cshowList :: [AssetShallow] -> ShowS
show :: AssetShallow -> String
$cshow :: AssetShallow -> String
showsPrec :: Int -> AssetShallow -> ShowS
$cshowsPrec :: Int -> AssetShallow -> ShowS
Prelude.Show, (forall x. AssetShallow -> Rep AssetShallow x)
-> (forall x. Rep AssetShallow x -> AssetShallow)
-> Generic AssetShallow
forall x. Rep AssetShallow x -> AssetShallow
forall x. AssetShallow -> Rep AssetShallow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetShallow x -> AssetShallow
$cfrom :: forall x. AssetShallow -> Rep AssetShallow x
Prelude.Generic)

-- |
-- Create a value of 'AssetShallow' 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:
--
-- 'resourceId', 'assetShallow_resourceId' - The resource ID to include in SPEKE key requests.
--
-- 'arn', 'assetShallow_arn' - The ARN of the Asset.
--
-- 'createdAt', 'assetShallow_createdAt' - The time the Asset was initially submitted for Ingest.
--
-- 'packagingGroupId', 'assetShallow_packagingGroupId' - The ID of the PackagingGroup for the Asset.
--
-- 'sourceArn', 'assetShallow_sourceArn' - ARN of the source object in S3.
--
-- 'sourceRoleArn', 'assetShallow_sourceRoleArn' - The IAM role ARN used to access the source S3 bucket.
--
-- 'id', 'assetShallow_id' - The unique identifier for the Asset.
--
-- 'tags', 'assetShallow_tags' - Undocumented member.
newAssetShallow ::
  AssetShallow
newAssetShallow :: AssetShallow
newAssetShallow =
  AssetShallow' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> AssetShallow
AssetShallow'
    { $sel:resourceId:AssetShallow' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:AssetShallow' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:AssetShallow' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:packagingGroupId:AssetShallow' :: Maybe Text
packagingGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceArn:AssetShallow' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceRoleArn:AssetShallow' :: Maybe Text
sourceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AssetShallow' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:AssetShallow' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The resource ID to include in SPEKE key requests.
assetShallow_resourceId :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_resourceId :: (Maybe Text -> f (Maybe Text)) -> AssetShallow -> f AssetShallow
assetShallow_resourceId = (AssetShallow -> Maybe Text)
-> (AssetShallow -> Maybe Text -> AssetShallow)
-> Lens AssetShallow AssetShallow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetShallow' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:AssetShallow' :: AssetShallow -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: AssetShallow
s@AssetShallow' {} Maybe Text
a -> AssetShallow
s {$sel:resourceId:AssetShallow' :: Maybe Text
resourceId = Maybe Text
a} :: AssetShallow)

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

-- | The time the Asset was initially submitted for Ingest.
assetShallow_createdAt :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_createdAt :: (Maybe Text -> f (Maybe Text)) -> AssetShallow -> f AssetShallow
assetShallow_createdAt = (AssetShallow -> Maybe Text)
-> (AssetShallow -> Maybe Text -> AssetShallow)
-> Lens AssetShallow AssetShallow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetShallow' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:AssetShallow' :: AssetShallow -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: AssetShallow
s@AssetShallow' {} Maybe Text
a -> AssetShallow
s {$sel:createdAt:AssetShallow' :: Maybe Text
createdAt = Maybe Text
a} :: AssetShallow)

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

-- | ARN of the source object in S3.
assetShallow_sourceArn :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_sourceArn :: (Maybe Text -> f (Maybe Text)) -> AssetShallow -> f AssetShallow
assetShallow_sourceArn = (AssetShallow -> Maybe Text)
-> (AssetShallow -> Maybe Text -> AssetShallow)
-> Lens AssetShallow AssetShallow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetShallow' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:AssetShallow' :: AssetShallow -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: AssetShallow
s@AssetShallow' {} Maybe Text
a -> AssetShallow
s {$sel:sourceArn:AssetShallow' :: Maybe Text
sourceArn = Maybe Text
a} :: AssetShallow)

-- | The IAM role ARN used to access the source S3 bucket.
assetShallow_sourceRoleArn :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_sourceRoleArn :: (Maybe Text -> f (Maybe Text)) -> AssetShallow -> f AssetShallow
assetShallow_sourceRoleArn = (AssetShallow -> Maybe Text)
-> (AssetShallow -> Maybe Text -> AssetShallow)
-> Lens AssetShallow AssetShallow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetShallow' {Maybe Text
sourceRoleArn :: Maybe Text
$sel:sourceRoleArn:AssetShallow' :: AssetShallow -> Maybe Text
sourceRoleArn} -> Maybe Text
sourceRoleArn) (\s :: AssetShallow
s@AssetShallow' {} Maybe Text
a -> AssetShallow
s {$sel:sourceRoleArn:AssetShallow' :: Maybe Text
sourceRoleArn = Maybe Text
a} :: AssetShallow)

-- | The unique identifier for the Asset.
assetShallow_id :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_id :: (Maybe Text -> f (Maybe Text)) -> AssetShallow -> f AssetShallow
assetShallow_id = (AssetShallow -> Maybe Text)
-> (AssetShallow -> Maybe Text -> AssetShallow)
-> Lens AssetShallow AssetShallow (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetShallow' {Maybe Text
id :: Maybe Text
$sel:id:AssetShallow' :: AssetShallow -> Maybe Text
id} -> Maybe Text
id) (\s :: AssetShallow
s@AssetShallow' {} Maybe Text
a -> AssetShallow
s {$sel:id:AssetShallow' :: Maybe Text
id = Maybe Text
a} :: AssetShallow)

-- | Undocumented member.
assetShallow_tags :: Lens.Lens' AssetShallow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
assetShallow_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AssetShallow -> f AssetShallow
assetShallow_tags = (AssetShallow -> Maybe (HashMap Text Text))
-> (AssetShallow -> Maybe (HashMap Text Text) -> AssetShallow)
-> Lens
     AssetShallow
     AssetShallow
     (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 (\AssetShallow' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AssetShallow' :: AssetShallow -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AssetShallow
s@AssetShallow' {} Maybe (HashMap Text Text)
a -> AssetShallow
s {$sel:tags:AssetShallow' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AssetShallow) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AssetShallow -> f AssetShallow)
-> ((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)))
-> AssetShallow
-> f AssetShallow
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 AssetShallow where
  parseJSON :: Value -> Parser AssetShallow
parseJSON =
    String
-> (Object -> Parser AssetShallow) -> Value -> Parser AssetShallow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssetShallow"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> AssetShallow
AssetShallow'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> AssetShallow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AssetShallow)
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
"resourceId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AssetShallow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AssetShallow)
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
"arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AssetShallow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AssetShallow)
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
"createdAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AssetShallow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AssetShallow)
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
"packagingGroupId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AssetShallow)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe (HashMap Text Text) -> AssetShallow)
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
"sourceArn")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe (HashMap Text Text) -> AssetShallow)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> AssetShallow)
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
"sourceRoleArn")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> AssetShallow)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> AssetShallow)
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 (HashMap Text Text) -> AssetShallow)
-> Parser (Maybe (HashMap Text Text)) -> Parser AssetShallow
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 AssetShallow

instance Prelude.NFData AssetShallow