{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaPackageVOD.Types.AssetShallow where

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

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

-- | The ARN of the Asset.
assetShallow_arn :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_arn :: Lens' AssetShallow (Maybe Text)
assetShallow_arn = 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 :: Lens' AssetShallow (Maybe Text)
assetShallow_createdAt = 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 unique identifier for the Asset.
assetShallow_id :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_id :: Lens' AssetShallow (Maybe Text)
assetShallow_id = 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)

-- | The ID of the PackagingGroup for the Asset.
assetShallow_packagingGroupId :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_packagingGroupId :: Lens' AssetShallow (Maybe Text)
assetShallow_packagingGroupId = 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)

-- | The resource ID to include in SPEKE key requests.
assetShallow_resourceId :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_resourceId :: Lens' AssetShallow (Maybe Text)
assetShallow_resourceId = 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)

-- | ARN of the source object in S3.
assetShallow_sourceArn :: Lens.Lens' AssetShallow (Prelude.Maybe Prelude.Text)
assetShallow_sourceArn :: Lens' AssetShallow (Maybe Text)
assetShallow_sourceArn = 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 :: Lens' AssetShallow (Maybe Text)
assetShallow_sourceRoleArn = 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)

-- | Undocumented member.
assetShallow_tags :: Lens.Lens' AssetShallow (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
assetShallow_tags :: Lens' AssetShallow (Maybe (HashMap Text Text))
assetShallow_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON AssetShallow where
  parseJSON :: Value -> Parser AssetShallow
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.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'
            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
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"id")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"packagingGroupId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sourceArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"sourceRoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable AssetShallow where
  hashWithSalt :: Int -> AssetShallow -> Int
hashWithSalt Int
_salt AssetShallow' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
sourceRoleArn :: Maybe Text
sourceArn :: Maybe Text
resourceId :: Maybe Text
packagingGroupId :: Maybe Text
id :: Maybe Text
createdAt :: Maybe Text
arn :: Maybe Text
$sel:tags:AssetShallow' :: AssetShallow -> Maybe (HashMap Text Text)
$sel:sourceRoleArn:AssetShallow' :: AssetShallow -> Maybe Text
$sel:sourceArn:AssetShallow' :: AssetShallow -> Maybe Text
$sel:resourceId:AssetShallow' :: AssetShallow -> Maybe Text
$sel:packagingGroupId:AssetShallow' :: AssetShallow -> Maybe Text
$sel:id:AssetShallow' :: AssetShallow -> Maybe Text
$sel:createdAt:AssetShallow' :: AssetShallow -> Maybe Text
$sel:arn:AssetShallow' :: AssetShallow -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
packagingGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData AssetShallow where
  rnf :: AssetShallow -> ()
rnf AssetShallow' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
sourceRoleArn :: Maybe Text
sourceArn :: Maybe Text
resourceId :: Maybe Text
packagingGroupId :: Maybe Text
id :: Maybe Text
createdAt :: Maybe Text
arn :: Maybe Text
$sel:tags:AssetShallow' :: AssetShallow -> Maybe (HashMap Text Text)
$sel:sourceRoleArn:AssetShallow' :: AssetShallow -> Maybe Text
$sel:sourceArn:AssetShallow' :: AssetShallow -> Maybe Text
$sel:resourceId:AssetShallow' :: AssetShallow -> Maybe Text
$sel:packagingGroupId:AssetShallow' :: AssetShallow -> Maybe Text
$sel:id:AssetShallow' :: AssetShallow -> Maybe Text
$sel:createdAt:AssetShallow' :: AssetShallow -> Maybe Text
$sel:arn:AssetShallow' :: AssetShallow -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
packagingGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags