{-# 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.Rekognition.Types.Video
-- 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.Rekognition.Types.Video where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.S3Object

-- | Video file stored in an Amazon S3 bucket. Amazon Rekognition video start
-- operations such as StartLabelDetection use @Video@ to specify a video
-- for analysis. The supported file formats are .mp4, .mov and .avi.
--
-- /See:/ 'newVideo' smart constructor.
data Video = Video'
  { -- | The Amazon S3 bucket name and file name for the video.
    Video -> Maybe S3Object
s3Object :: Prelude.Maybe S3Object
  }
  deriving (Video -> Video -> Bool
(Video -> Video -> Bool) -> (Video -> Video -> Bool) -> Eq Video
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Video -> Video -> Bool
$c/= :: Video -> Video -> Bool
== :: Video -> Video -> Bool
$c== :: Video -> Video -> Bool
Prelude.Eq, ReadPrec [Video]
ReadPrec Video
Int -> ReadS Video
ReadS [Video]
(Int -> ReadS Video)
-> ReadS [Video]
-> ReadPrec Video
-> ReadPrec [Video]
-> Read Video
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Video]
$creadListPrec :: ReadPrec [Video]
readPrec :: ReadPrec Video
$creadPrec :: ReadPrec Video
readList :: ReadS [Video]
$creadList :: ReadS [Video]
readsPrec :: Int -> ReadS Video
$creadsPrec :: Int -> ReadS Video
Prelude.Read, Int -> Video -> ShowS
[Video] -> ShowS
Video -> String
(Int -> Video -> ShowS)
-> (Video -> String) -> ([Video] -> ShowS) -> Show Video
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Video] -> ShowS
$cshowList :: [Video] -> ShowS
show :: Video -> String
$cshow :: Video -> String
showsPrec :: Int -> Video -> ShowS
$cshowsPrec :: Int -> Video -> ShowS
Prelude.Show, (forall x. Video -> Rep Video x)
-> (forall x. Rep Video x -> Video) -> Generic Video
forall x. Rep Video x -> Video
forall x. Video -> Rep Video x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Video x -> Video
$cfrom :: forall x. Video -> Rep Video x
Prelude.Generic)

-- |
-- Create a value of 'Video' 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:
--
-- 's3Object', 'video_s3Object' - The Amazon S3 bucket name and file name for the video.
newVideo ::
  Video
newVideo :: Video
newVideo = Video' :: Maybe S3Object -> Video
Video' {$sel:s3Object:Video' :: Maybe S3Object
s3Object = Maybe S3Object
forall a. Maybe a
Prelude.Nothing}

-- | The Amazon S3 bucket name and file name for the video.
video_s3Object :: Lens.Lens' Video (Prelude.Maybe S3Object)
video_s3Object :: (Maybe S3Object -> f (Maybe S3Object)) -> Video -> f Video
video_s3Object = (Video -> Maybe S3Object)
-> (Video -> Maybe S3Object -> Video)
-> Lens Video Video (Maybe S3Object) (Maybe S3Object)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Video' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:Video' :: Video -> Maybe S3Object
s3Object} -> Maybe S3Object
s3Object) (\s :: Video
s@Video' {} Maybe S3Object
a -> Video
s {$sel:s3Object:Video' :: Maybe S3Object
s3Object = Maybe S3Object
a} :: Video)

instance Prelude.Hashable Video

instance Prelude.NFData Video

instance Core.ToJSON Video where
  toJSON :: Video -> Value
toJSON Video' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:Video' :: Video -> Maybe S3Object
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"S3Object" Text -> S3Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3Object -> Pair) -> Maybe S3Object -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3Object
s3Object]
      )