{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.MediaLive.BatchStart
(
BatchStart' (..),
newBatchStart',
batchStart'_channelIds,
batchStart'_multiplexIds,
BatchStartResponse (..),
newBatchStartResponse,
batchStartResponse_failed,
batchStartResponse_successful,
batchStartResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data BatchStart' = BatchStart''
{
BatchStart' -> Maybe [Text]
channelIds :: Prelude.Maybe [Prelude.Text],
BatchStart' -> Maybe [Text]
multiplexIds :: Prelude.Maybe [Prelude.Text]
}
deriving (BatchStart' -> BatchStart' -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchStart' -> BatchStart' -> Bool
$c/= :: BatchStart' -> BatchStart' -> Bool
== :: BatchStart' -> BatchStart' -> Bool
$c== :: BatchStart' -> BatchStart' -> Bool
Prelude.Eq, ReadPrec [BatchStart']
ReadPrec BatchStart'
Int -> ReadS BatchStart'
ReadS [BatchStart']
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchStart']
$creadListPrec :: ReadPrec [BatchStart']
readPrec :: ReadPrec BatchStart'
$creadPrec :: ReadPrec BatchStart'
readList :: ReadS [BatchStart']
$creadList :: ReadS [BatchStart']
readsPrec :: Int -> ReadS BatchStart'
$creadsPrec :: Int -> ReadS BatchStart'
Prelude.Read, Int -> BatchStart' -> ShowS
[BatchStart'] -> ShowS
BatchStart' -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchStart'] -> ShowS
$cshowList :: [BatchStart'] -> ShowS
show :: BatchStart' -> String
$cshow :: BatchStart' -> String
showsPrec :: Int -> BatchStart' -> ShowS
$cshowsPrec :: Int -> BatchStart' -> ShowS
Prelude.Show, forall x. Rep BatchStart' x -> BatchStart'
forall x. BatchStart' -> Rep BatchStart' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchStart' x -> BatchStart'
$cfrom :: forall x. BatchStart' -> Rep BatchStart' x
Prelude.Generic)
newBatchStart' ::
BatchStart'
newBatchStart' :: BatchStart'
newBatchStart' =
BatchStart''
{ $sel:channelIds:BatchStart'' :: Maybe [Text]
channelIds = forall a. Maybe a
Prelude.Nothing,
$sel:multiplexIds:BatchStart'' :: Maybe [Text]
multiplexIds = forall a. Maybe a
Prelude.Nothing
}
batchStart'_channelIds :: Lens.Lens' BatchStart' (Prelude.Maybe [Prelude.Text])
batchStart'_channelIds :: Lens' BatchStart' (Maybe [Text])
batchStart'_channelIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStart'' {Maybe [Text]
channelIds :: Maybe [Text]
$sel:channelIds:BatchStart'' :: BatchStart' -> Maybe [Text]
channelIds} -> Maybe [Text]
channelIds) (\s :: BatchStart'
s@BatchStart'' {} Maybe [Text]
a -> BatchStart'
s {$sel:channelIds:BatchStart'' :: Maybe [Text]
channelIds = Maybe [Text]
a} :: BatchStart') 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
batchStart'_multiplexIds :: Lens.Lens' BatchStart' (Prelude.Maybe [Prelude.Text])
batchStart'_multiplexIds :: Lens' BatchStart' (Maybe [Text])
batchStart'_multiplexIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStart'' {Maybe [Text]
multiplexIds :: Maybe [Text]
$sel:multiplexIds:BatchStart'' :: BatchStart' -> Maybe [Text]
multiplexIds} -> Maybe [Text]
multiplexIds) (\s :: BatchStart'
s@BatchStart'' {} Maybe [Text]
a -> BatchStart'
s {$sel:multiplexIds:BatchStart'' :: Maybe [Text]
multiplexIds = Maybe [Text]
a} :: BatchStart') 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 Core.AWSRequest BatchStart' where
type AWSResponse BatchStart' = BatchStartResponse
request :: (Service -> Service) -> BatchStart' -> Request BatchStart'
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchStart'
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchStart')))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [BatchFailedResultModel]
-> Maybe [BatchSuccessfulResultModel] -> Int -> BatchStartResponse
BatchStartResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"failed" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"successful" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable BatchStart' where
hashWithSalt :: Int -> BatchStart' -> Int
hashWithSalt Int
_salt BatchStart'' {Maybe [Text]
multiplexIds :: Maybe [Text]
channelIds :: Maybe [Text]
$sel:multiplexIds:BatchStart'' :: BatchStart' -> Maybe [Text]
$sel:channelIds:BatchStart'' :: BatchStart' -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
channelIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
multiplexIds
instance Prelude.NFData BatchStart' where
rnf :: BatchStart' -> ()
rnf BatchStart'' {Maybe [Text]
multiplexIds :: Maybe [Text]
channelIds :: Maybe [Text]
$sel:multiplexIds:BatchStart'' :: BatchStart' -> Maybe [Text]
$sel:channelIds:BatchStart'' :: BatchStart' -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
channelIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
multiplexIds
instance Data.ToHeaders BatchStart' where
toHeaders :: BatchStart' -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON BatchStart' where
toJSON :: BatchStart' -> Value
toJSON BatchStart'' {Maybe [Text]
multiplexIds :: Maybe [Text]
channelIds :: Maybe [Text]
$sel:multiplexIds:BatchStart'' :: BatchStart' -> Maybe [Text]
$sel:channelIds:BatchStart'' :: BatchStart' -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"channelIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
channelIds,
(Key
"multiplexIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
multiplexIds
]
)
instance Data.ToPath BatchStart' where
toPath :: BatchStart' -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/prod/batch/start"
instance Data.ToQuery BatchStart' where
toQuery :: BatchStart' -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data BatchStartResponse = BatchStartResponse'
{
BatchStartResponse -> Maybe [BatchFailedResultModel]
failed :: Prelude.Maybe [BatchFailedResultModel],
BatchStartResponse -> Maybe [BatchSuccessfulResultModel]
successful :: Prelude.Maybe [BatchSuccessfulResultModel],
BatchStartResponse -> Int
httpStatus :: Prelude.Int
}
deriving (BatchStartResponse -> BatchStartResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchStartResponse -> BatchStartResponse -> Bool
$c/= :: BatchStartResponse -> BatchStartResponse -> Bool
== :: BatchStartResponse -> BatchStartResponse -> Bool
$c== :: BatchStartResponse -> BatchStartResponse -> Bool
Prelude.Eq, ReadPrec [BatchStartResponse]
ReadPrec BatchStartResponse
Int -> ReadS BatchStartResponse
ReadS [BatchStartResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchStartResponse]
$creadListPrec :: ReadPrec [BatchStartResponse]
readPrec :: ReadPrec BatchStartResponse
$creadPrec :: ReadPrec BatchStartResponse
readList :: ReadS [BatchStartResponse]
$creadList :: ReadS [BatchStartResponse]
readsPrec :: Int -> ReadS BatchStartResponse
$creadsPrec :: Int -> ReadS BatchStartResponse
Prelude.Read, Int -> BatchStartResponse -> ShowS
[BatchStartResponse] -> ShowS
BatchStartResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchStartResponse] -> ShowS
$cshowList :: [BatchStartResponse] -> ShowS
show :: BatchStartResponse -> String
$cshow :: BatchStartResponse -> String
showsPrec :: Int -> BatchStartResponse -> ShowS
$cshowsPrec :: Int -> BatchStartResponse -> ShowS
Prelude.Show, forall x. Rep BatchStartResponse x -> BatchStartResponse
forall x. BatchStartResponse -> Rep BatchStartResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchStartResponse x -> BatchStartResponse
$cfrom :: forall x. BatchStartResponse -> Rep BatchStartResponse x
Prelude.Generic)
newBatchStartResponse ::
Prelude.Int ->
BatchStartResponse
newBatchStartResponse :: Int -> BatchStartResponse
newBatchStartResponse Int
pHttpStatus_ =
BatchStartResponse'
{ $sel:failed:BatchStartResponse' :: Maybe [BatchFailedResultModel]
failed = forall a. Maybe a
Prelude.Nothing,
$sel:successful:BatchStartResponse' :: Maybe [BatchSuccessfulResultModel]
successful = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchStartResponse' :: Int
httpStatus = Int
pHttpStatus_
}
batchStartResponse_failed :: Lens.Lens' BatchStartResponse (Prelude.Maybe [BatchFailedResultModel])
batchStartResponse_failed :: Lens' BatchStartResponse (Maybe [BatchFailedResultModel])
batchStartResponse_failed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStartResponse' {Maybe [BatchFailedResultModel]
failed :: Maybe [BatchFailedResultModel]
$sel:failed:BatchStartResponse' :: BatchStartResponse -> Maybe [BatchFailedResultModel]
failed} -> Maybe [BatchFailedResultModel]
failed) (\s :: BatchStartResponse
s@BatchStartResponse' {} Maybe [BatchFailedResultModel]
a -> BatchStartResponse
s {$sel:failed:BatchStartResponse' :: Maybe [BatchFailedResultModel]
failed = Maybe [BatchFailedResultModel]
a} :: BatchStartResponse) 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
batchStartResponse_successful :: Lens.Lens' BatchStartResponse (Prelude.Maybe [BatchSuccessfulResultModel])
batchStartResponse_successful :: Lens' BatchStartResponse (Maybe [BatchSuccessfulResultModel])
batchStartResponse_successful = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStartResponse' {Maybe [BatchSuccessfulResultModel]
successful :: Maybe [BatchSuccessfulResultModel]
$sel:successful:BatchStartResponse' :: BatchStartResponse -> Maybe [BatchSuccessfulResultModel]
successful} -> Maybe [BatchSuccessfulResultModel]
successful) (\s :: BatchStartResponse
s@BatchStartResponse' {} Maybe [BatchSuccessfulResultModel]
a -> BatchStartResponse
s {$sel:successful:BatchStartResponse' :: Maybe [BatchSuccessfulResultModel]
successful = Maybe [BatchSuccessfulResultModel]
a} :: BatchStartResponse) 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
batchStartResponse_httpStatus :: Lens.Lens' BatchStartResponse Prelude.Int
batchStartResponse_httpStatus :: Lens' BatchStartResponse Int
batchStartResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchStartResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchStartResponse' :: BatchStartResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchStartResponse
s@BatchStartResponse' {} Int
a -> BatchStartResponse
s {$sel:httpStatus:BatchStartResponse' :: Int
httpStatus = Int
a} :: BatchStartResponse)
instance Prelude.NFData BatchStartResponse where
rnf :: BatchStartResponse -> ()
rnf BatchStartResponse' {Int
Maybe [BatchFailedResultModel]
Maybe [BatchSuccessfulResultModel]
httpStatus :: Int
successful :: Maybe [BatchSuccessfulResultModel]
failed :: Maybe [BatchFailedResultModel]
$sel:httpStatus:BatchStartResponse' :: BatchStartResponse -> Int
$sel:successful:BatchStartResponse' :: BatchStartResponse -> Maybe [BatchSuccessfulResultModel]
$sel:failed:BatchStartResponse' :: BatchStartResponse -> Maybe [BatchFailedResultModel]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [BatchFailedResultModel]
failed
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [BatchSuccessfulResultModel]
successful
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus