{-# 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.MediaTailor.ListVodSources
(
ListVodSources (..),
newListVodSources,
listVodSources_maxResults,
listVodSources_nextToken,
listVodSources_sourceLocationName,
ListVodSourcesResponse (..),
newListVodSourcesResponse,
listVodSourcesResponse_items,
listVodSourcesResponse_nextToken,
listVodSourcesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaTailor.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListVodSources = ListVodSources'
{
ListVodSources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListVodSources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVodSources -> Text
sourceLocationName :: Prelude.Text
}
deriving (ListVodSources -> ListVodSources -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVodSources -> ListVodSources -> Bool
$c/= :: ListVodSources -> ListVodSources -> Bool
== :: ListVodSources -> ListVodSources -> Bool
$c== :: ListVodSources -> ListVodSources -> Bool
Prelude.Eq, ReadPrec [ListVodSources]
ReadPrec ListVodSources
Int -> ReadS ListVodSources
ReadS [ListVodSources]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVodSources]
$creadListPrec :: ReadPrec [ListVodSources]
readPrec :: ReadPrec ListVodSources
$creadPrec :: ReadPrec ListVodSources
readList :: ReadS [ListVodSources]
$creadList :: ReadS [ListVodSources]
readsPrec :: Int -> ReadS ListVodSources
$creadsPrec :: Int -> ReadS ListVodSources
Prelude.Read, Int -> ListVodSources -> ShowS
[ListVodSources] -> ShowS
ListVodSources -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVodSources] -> ShowS
$cshowList :: [ListVodSources] -> ShowS
show :: ListVodSources -> String
$cshow :: ListVodSources -> String
showsPrec :: Int -> ListVodSources -> ShowS
$cshowsPrec :: Int -> ListVodSources -> ShowS
Prelude.Show, forall x. Rep ListVodSources x -> ListVodSources
forall x. ListVodSources -> Rep ListVodSources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVodSources x -> ListVodSources
$cfrom :: forall x. ListVodSources -> Rep ListVodSources x
Prelude.Generic)
newListVodSources ::
Prelude.Text ->
ListVodSources
newListVodSources :: Text -> ListVodSources
newListVodSources Text
pSourceLocationName_ =
ListVodSources'
{ $sel:maxResults:ListVodSources' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListVodSources' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:sourceLocationName:ListVodSources' :: Text
sourceLocationName = Text
pSourceLocationName_
}
listVodSources_maxResults :: Lens.Lens' ListVodSources (Prelude.Maybe Prelude.Natural)
listVodSources_maxResults :: Lens' ListVodSources (Maybe Natural)
listVodSources_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVodSources' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListVodSources' :: ListVodSources -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListVodSources
s@ListVodSources' {} Maybe Natural
a -> ListVodSources
s {$sel:maxResults:ListVodSources' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListVodSources)
listVodSources_nextToken :: Lens.Lens' ListVodSources (Prelude.Maybe Prelude.Text)
listVodSources_nextToken :: Lens' ListVodSources (Maybe Text)
listVodSources_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVodSources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVodSources' :: ListVodSources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVodSources
s@ListVodSources' {} Maybe Text
a -> ListVodSources
s {$sel:nextToken:ListVodSources' :: Maybe Text
nextToken = Maybe Text
a} :: ListVodSources)
listVodSources_sourceLocationName :: Lens.Lens' ListVodSources Prelude.Text
listVodSources_sourceLocationName :: Lens' ListVodSources Text
listVodSources_sourceLocationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVodSources' {Text
sourceLocationName :: Text
$sel:sourceLocationName:ListVodSources' :: ListVodSources -> Text
sourceLocationName} -> Text
sourceLocationName) (\s :: ListVodSources
s@ListVodSources' {} Text
a -> ListVodSources
s {$sel:sourceLocationName:ListVodSources' :: Text
sourceLocationName = Text
a} :: ListVodSources)
instance Core.AWSPager ListVodSources where
page :: ListVodSources
-> AWSResponse ListVodSources -> Maybe ListVodSources
page ListVodSources
rq AWSResponse ListVodSources
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVodSources
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVodSourcesResponse (Maybe Text)
listVodSourcesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListVodSources
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVodSourcesResponse (Maybe [VodSource])
listVodSourcesResponse_items
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListVodSources
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListVodSources (Maybe Text)
listVodSources_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListVodSources
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListVodSourcesResponse (Maybe Text)
listVodSourcesResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListVodSources where
type
AWSResponse ListVodSources =
ListVodSourcesResponse
request :: (Service -> Service) -> ListVodSources -> Request ListVodSources
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListVodSources
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListVodSources)))
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 [VodSource] -> Maybe Text -> Int -> ListVodSourcesResponse
ListVodSourcesResponse'
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
"Items" 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
"NextToken")
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 ListVodSources where
hashWithSalt :: Int -> ListVodSources -> Int
hashWithSalt Int
_salt ListVodSources' {Maybe Natural
Maybe Text
Text
sourceLocationName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sourceLocationName:ListVodSources' :: ListVodSources -> Text
$sel:nextToken:ListVodSources' :: ListVodSources -> Maybe Text
$sel:maxResults:ListVodSources' :: ListVodSources -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sourceLocationName
instance Prelude.NFData ListVodSources where
rnf :: ListVodSources -> ()
rnf ListVodSources' {Maybe Natural
Maybe Text
Text
sourceLocationName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sourceLocationName:ListVodSources' :: ListVodSources -> Text
$sel:nextToken:ListVodSources' :: ListVodSources -> Maybe Text
$sel:maxResults:ListVodSources' :: ListVodSources -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
sourceLocationName
instance Data.ToHeaders ListVodSources where
toHeaders :: ListVodSources -> 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.ToPath ListVodSources where
toPath :: ListVodSources -> ByteString
toPath ListVodSources' {Maybe Natural
Maybe Text
Text
sourceLocationName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sourceLocationName:ListVodSources' :: ListVodSources -> Text
$sel:nextToken:ListVodSources' :: ListVodSources -> Maybe Text
$sel:maxResults:ListVodSources' :: ListVodSources -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/sourceLocation/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
sourceLocationName,
ByteString
"/vodSources"
]
instance Data.ToQuery ListVodSources where
toQuery :: ListVodSources -> QueryString
toQuery ListVodSources' {Maybe Natural
Maybe Text
Text
sourceLocationName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:sourceLocationName:ListVodSources' :: ListVodSources -> Text
$sel:nextToken:ListVodSources' :: ListVodSources -> Maybe Text
$sel:maxResults:ListVodSources' :: ListVodSources -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListVodSourcesResponse = ListVodSourcesResponse'
{
ListVodSourcesResponse -> Maybe [VodSource]
items :: Prelude.Maybe [VodSource],
ListVodSourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListVodSourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListVodSourcesResponse -> ListVodSourcesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListVodSourcesResponse -> ListVodSourcesResponse -> Bool
$c/= :: ListVodSourcesResponse -> ListVodSourcesResponse -> Bool
== :: ListVodSourcesResponse -> ListVodSourcesResponse -> Bool
$c== :: ListVodSourcesResponse -> ListVodSourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListVodSourcesResponse]
ReadPrec ListVodSourcesResponse
Int -> ReadS ListVodSourcesResponse
ReadS [ListVodSourcesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListVodSourcesResponse]
$creadListPrec :: ReadPrec [ListVodSourcesResponse]
readPrec :: ReadPrec ListVodSourcesResponse
$creadPrec :: ReadPrec ListVodSourcesResponse
readList :: ReadS [ListVodSourcesResponse]
$creadList :: ReadS [ListVodSourcesResponse]
readsPrec :: Int -> ReadS ListVodSourcesResponse
$creadsPrec :: Int -> ReadS ListVodSourcesResponse
Prelude.Read, Int -> ListVodSourcesResponse -> ShowS
[ListVodSourcesResponse] -> ShowS
ListVodSourcesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListVodSourcesResponse] -> ShowS
$cshowList :: [ListVodSourcesResponse] -> ShowS
show :: ListVodSourcesResponse -> String
$cshow :: ListVodSourcesResponse -> String
showsPrec :: Int -> ListVodSourcesResponse -> ShowS
$cshowsPrec :: Int -> ListVodSourcesResponse -> ShowS
Prelude.Show, forall x. Rep ListVodSourcesResponse x -> ListVodSourcesResponse
forall x. ListVodSourcesResponse -> Rep ListVodSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListVodSourcesResponse x -> ListVodSourcesResponse
$cfrom :: forall x. ListVodSourcesResponse -> Rep ListVodSourcesResponse x
Prelude.Generic)
newListVodSourcesResponse ::
Prelude.Int ->
ListVodSourcesResponse
newListVodSourcesResponse :: Int -> ListVodSourcesResponse
newListVodSourcesResponse Int
pHttpStatus_ =
ListVodSourcesResponse'
{ $sel:items:ListVodSourcesResponse' :: Maybe [VodSource]
items = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListVodSourcesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListVodSourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listVodSourcesResponse_items :: Lens.Lens' ListVodSourcesResponse (Prelude.Maybe [VodSource])
listVodSourcesResponse_items :: Lens' ListVodSourcesResponse (Maybe [VodSource])
listVodSourcesResponse_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVodSourcesResponse' {Maybe [VodSource]
items :: Maybe [VodSource]
$sel:items:ListVodSourcesResponse' :: ListVodSourcesResponse -> Maybe [VodSource]
items} -> Maybe [VodSource]
items) (\s :: ListVodSourcesResponse
s@ListVodSourcesResponse' {} Maybe [VodSource]
a -> ListVodSourcesResponse
s {$sel:items:ListVodSourcesResponse' :: Maybe [VodSource]
items = Maybe [VodSource]
a} :: ListVodSourcesResponse) 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
listVodSourcesResponse_nextToken :: Lens.Lens' ListVodSourcesResponse (Prelude.Maybe Prelude.Text)
listVodSourcesResponse_nextToken :: Lens' ListVodSourcesResponse (Maybe Text)
listVodSourcesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVodSourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListVodSourcesResponse' :: ListVodSourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListVodSourcesResponse
s@ListVodSourcesResponse' {} Maybe Text
a -> ListVodSourcesResponse
s {$sel:nextToken:ListVodSourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListVodSourcesResponse)
listVodSourcesResponse_httpStatus :: Lens.Lens' ListVodSourcesResponse Prelude.Int
listVodSourcesResponse_httpStatus :: Lens' ListVodSourcesResponse Int
listVodSourcesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListVodSourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListVodSourcesResponse' :: ListVodSourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListVodSourcesResponse
s@ListVodSourcesResponse' {} Int
a -> ListVodSourcesResponse
s {$sel:httpStatus:ListVodSourcesResponse' :: Int
httpStatus = Int
a} :: ListVodSourcesResponse)
instance Prelude.NFData ListVodSourcesResponse where
rnf :: ListVodSourcesResponse -> ()
rnf ListVodSourcesResponse' {Int
Maybe [VodSource]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
items :: Maybe [VodSource]
$sel:httpStatus:ListVodSourcesResponse' :: ListVodSourcesResponse -> Int
$sel:nextToken:ListVodSourcesResponse' :: ListVodSourcesResponse -> Maybe Text
$sel:items:ListVodSourcesResponse' :: ListVodSourcesResponse -> Maybe [VodSource]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [VodSource]
items
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus