{-# 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.MediaPackageVOD.ListPackagingConfigurations
(
ListPackagingConfigurations (..),
newListPackagingConfigurations,
listPackagingConfigurations_maxResults,
listPackagingConfigurations_nextToken,
listPackagingConfigurations_packagingGroupId,
ListPackagingConfigurationsResponse (..),
newListPackagingConfigurationsResponse,
listPackagingConfigurationsResponse_nextToken,
listPackagingConfigurationsResponse_packagingConfigurations,
listPackagingConfigurationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaPackageVOD.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListPackagingConfigurations = ListPackagingConfigurations'
{
ListPackagingConfigurations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListPackagingConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPackagingConfigurations -> Maybe Text
packagingGroupId :: Prelude.Maybe Prelude.Text
}
deriving (ListPackagingConfigurations -> ListPackagingConfigurations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackagingConfigurations -> ListPackagingConfigurations -> Bool
$c/= :: ListPackagingConfigurations -> ListPackagingConfigurations -> Bool
== :: ListPackagingConfigurations -> ListPackagingConfigurations -> Bool
$c== :: ListPackagingConfigurations -> ListPackagingConfigurations -> Bool
Prelude.Eq, ReadPrec [ListPackagingConfigurations]
ReadPrec ListPackagingConfigurations
Int -> ReadS ListPackagingConfigurations
ReadS [ListPackagingConfigurations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackagingConfigurations]
$creadListPrec :: ReadPrec [ListPackagingConfigurations]
readPrec :: ReadPrec ListPackagingConfigurations
$creadPrec :: ReadPrec ListPackagingConfigurations
readList :: ReadS [ListPackagingConfigurations]
$creadList :: ReadS [ListPackagingConfigurations]
readsPrec :: Int -> ReadS ListPackagingConfigurations
$creadsPrec :: Int -> ReadS ListPackagingConfigurations
Prelude.Read, Int -> ListPackagingConfigurations -> ShowS
[ListPackagingConfigurations] -> ShowS
ListPackagingConfigurations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackagingConfigurations] -> ShowS
$cshowList :: [ListPackagingConfigurations] -> ShowS
show :: ListPackagingConfigurations -> String
$cshow :: ListPackagingConfigurations -> String
showsPrec :: Int -> ListPackagingConfigurations -> ShowS
$cshowsPrec :: Int -> ListPackagingConfigurations -> ShowS
Prelude.Show, forall x.
Rep ListPackagingConfigurations x -> ListPackagingConfigurations
forall x.
ListPackagingConfigurations -> Rep ListPackagingConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPackagingConfigurations x -> ListPackagingConfigurations
$cfrom :: forall x.
ListPackagingConfigurations -> Rep ListPackagingConfigurations x
Prelude.Generic)
newListPackagingConfigurations ::
ListPackagingConfigurations
newListPackagingConfigurations :: ListPackagingConfigurations
newListPackagingConfigurations =
ListPackagingConfigurations'
{ $sel:maxResults:ListPackagingConfigurations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPackagingConfigurations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:packagingGroupId:ListPackagingConfigurations' :: Maybe Text
packagingGroupId = forall a. Maybe a
Prelude.Nothing
}
listPackagingConfigurations_maxResults :: Lens.Lens' ListPackagingConfigurations (Prelude.Maybe Prelude.Natural)
listPackagingConfigurations_maxResults :: Lens' ListPackagingConfigurations (Maybe Natural)
listPackagingConfigurations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingConfigurations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPackagingConfigurations
s@ListPackagingConfigurations' {} Maybe Natural
a -> ListPackagingConfigurations
s {$sel:maxResults:ListPackagingConfigurations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPackagingConfigurations)
listPackagingConfigurations_nextToken :: Lens.Lens' ListPackagingConfigurations (Prelude.Maybe Prelude.Text)
listPackagingConfigurations_nextToken :: Lens' ListPackagingConfigurations (Maybe Text)
listPackagingConfigurations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackagingConfigurations
s@ListPackagingConfigurations' {} Maybe Text
a -> ListPackagingConfigurations
s {$sel:nextToken:ListPackagingConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackagingConfigurations)
listPackagingConfigurations_packagingGroupId :: Lens.Lens' ListPackagingConfigurations (Prelude.Maybe Prelude.Text)
listPackagingConfigurations_packagingGroupId :: Lens' ListPackagingConfigurations (Maybe Text)
listPackagingConfigurations_packagingGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingConfigurations' {Maybe Text
packagingGroupId :: Maybe Text
$sel:packagingGroupId:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
packagingGroupId} -> Maybe Text
packagingGroupId) (\s :: ListPackagingConfigurations
s@ListPackagingConfigurations' {} Maybe Text
a -> ListPackagingConfigurations
s {$sel:packagingGroupId:ListPackagingConfigurations' :: Maybe Text
packagingGroupId = Maybe Text
a} :: ListPackagingConfigurations)
instance Core.AWSPager ListPackagingConfigurations where
page :: ListPackagingConfigurations
-> AWSResponse ListPackagingConfigurations
-> Maybe ListPackagingConfigurations
page ListPackagingConfigurations
rq AWSResponse ListPackagingConfigurations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPackagingConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPackagingConfigurationsResponse (Maybe Text)
listPackagingConfigurationsResponse_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 ListPackagingConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListPackagingConfigurationsResponse
(Maybe [PackagingConfiguration])
listPackagingConfigurationsResponse_packagingConfigurations
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.$ ListPackagingConfigurations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListPackagingConfigurations (Maybe Text)
listPackagingConfigurations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPackagingConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPackagingConfigurationsResponse (Maybe Text)
listPackagingConfigurationsResponse_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 ListPackagingConfigurations where
type
AWSResponse ListPackagingConfigurations =
ListPackagingConfigurationsResponse
request :: (Service -> Service)
-> ListPackagingConfigurations
-> Request ListPackagingConfigurations
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 ListPackagingConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPackagingConfigurations)))
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 Text
-> Maybe [PackagingConfiguration]
-> Int
-> ListPackagingConfigurationsResponse
ListPackagingConfigurationsResponse'
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
"nextToken")
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
"packagingConfigurations"
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 ListPackagingConfigurations where
hashWithSalt :: Int -> ListPackagingConfigurations -> Int
hashWithSalt Int
_salt ListPackagingConfigurations' {Maybe Natural
Maybe Text
packagingGroupId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:packagingGroupId:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
$sel:nextToken:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
$sel:maxResults:ListPackagingConfigurations' :: ListPackagingConfigurations -> 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` Maybe Text
packagingGroupId
instance Prelude.NFData ListPackagingConfigurations where
rnf :: ListPackagingConfigurations -> ()
rnf ListPackagingConfigurations' {Maybe Natural
Maybe Text
packagingGroupId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:packagingGroupId:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
$sel:nextToken:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
$sel:maxResults:ListPackagingConfigurations' :: ListPackagingConfigurations -> 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 Maybe Text
packagingGroupId
instance Data.ToHeaders ListPackagingConfigurations where
toHeaders :: ListPackagingConfigurations -> 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 ListPackagingConfigurations where
toPath :: ListPackagingConfigurations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/packaging_configurations"
instance Data.ToQuery ListPackagingConfigurations where
toQuery :: ListPackagingConfigurations -> QueryString
toQuery ListPackagingConfigurations' {Maybe Natural
Maybe Text
packagingGroupId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:packagingGroupId:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
$sel:nextToken:ListPackagingConfigurations' :: ListPackagingConfigurations -> Maybe Text
$sel:maxResults:ListPackagingConfigurations' :: ListPackagingConfigurations -> 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,
ByteString
"packagingGroupId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
packagingGroupId
]
data ListPackagingConfigurationsResponse = ListPackagingConfigurationsResponse'
{
ListPackagingConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPackagingConfigurationsResponse
-> Maybe [PackagingConfiguration]
packagingConfigurations :: Prelude.Maybe [PackagingConfiguration],
ListPackagingConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPackagingConfigurationsResponse
-> ListPackagingConfigurationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackagingConfigurationsResponse
-> ListPackagingConfigurationsResponse -> Bool
$c/= :: ListPackagingConfigurationsResponse
-> ListPackagingConfigurationsResponse -> Bool
== :: ListPackagingConfigurationsResponse
-> ListPackagingConfigurationsResponse -> Bool
$c== :: ListPackagingConfigurationsResponse
-> ListPackagingConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListPackagingConfigurationsResponse]
ReadPrec ListPackagingConfigurationsResponse
Int -> ReadS ListPackagingConfigurationsResponse
ReadS [ListPackagingConfigurationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackagingConfigurationsResponse]
$creadListPrec :: ReadPrec [ListPackagingConfigurationsResponse]
readPrec :: ReadPrec ListPackagingConfigurationsResponse
$creadPrec :: ReadPrec ListPackagingConfigurationsResponse
readList :: ReadS [ListPackagingConfigurationsResponse]
$creadList :: ReadS [ListPackagingConfigurationsResponse]
readsPrec :: Int -> ReadS ListPackagingConfigurationsResponse
$creadsPrec :: Int -> ReadS ListPackagingConfigurationsResponse
Prelude.Read, Int -> ListPackagingConfigurationsResponse -> ShowS
[ListPackagingConfigurationsResponse] -> ShowS
ListPackagingConfigurationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackagingConfigurationsResponse] -> ShowS
$cshowList :: [ListPackagingConfigurationsResponse] -> ShowS
show :: ListPackagingConfigurationsResponse -> String
$cshow :: ListPackagingConfigurationsResponse -> String
showsPrec :: Int -> ListPackagingConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListPackagingConfigurationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListPackagingConfigurationsResponse x
-> ListPackagingConfigurationsResponse
forall x.
ListPackagingConfigurationsResponse
-> Rep ListPackagingConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPackagingConfigurationsResponse x
-> ListPackagingConfigurationsResponse
$cfrom :: forall x.
ListPackagingConfigurationsResponse
-> Rep ListPackagingConfigurationsResponse x
Prelude.Generic)
newListPackagingConfigurationsResponse ::
Prelude.Int ->
ListPackagingConfigurationsResponse
newListPackagingConfigurationsResponse :: Int -> ListPackagingConfigurationsResponse
newListPackagingConfigurationsResponse Int
pHttpStatus_ =
ListPackagingConfigurationsResponse'
{ $sel:nextToken:ListPackagingConfigurationsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:packagingConfigurations:ListPackagingConfigurationsResponse' :: Maybe [PackagingConfiguration]
packagingConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPackagingConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPackagingConfigurationsResponse_nextToken :: Lens.Lens' ListPackagingConfigurationsResponse (Prelude.Maybe Prelude.Text)
listPackagingConfigurationsResponse_nextToken :: Lens' ListPackagingConfigurationsResponse (Maybe Text)
listPackagingConfigurationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackagingConfigurationsResponse' :: ListPackagingConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackagingConfigurationsResponse
s@ListPackagingConfigurationsResponse' {} Maybe Text
a -> ListPackagingConfigurationsResponse
s {$sel:nextToken:ListPackagingConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackagingConfigurationsResponse)
listPackagingConfigurationsResponse_packagingConfigurations :: Lens.Lens' ListPackagingConfigurationsResponse (Prelude.Maybe [PackagingConfiguration])
listPackagingConfigurationsResponse_packagingConfigurations :: Lens'
ListPackagingConfigurationsResponse
(Maybe [PackagingConfiguration])
listPackagingConfigurationsResponse_packagingConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingConfigurationsResponse' {Maybe [PackagingConfiguration]
packagingConfigurations :: Maybe [PackagingConfiguration]
$sel:packagingConfigurations:ListPackagingConfigurationsResponse' :: ListPackagingConfigurationsResponse
-> Maybe [PackagingConfiguration]
packagingConfigurations} -> Maybe [PackagingConfiguration]
packagingConfigurations) (\s :: ListPackagingConfigurationsResponse
s@ListPackagingConfigurationsResponse' {} Maybe [PackagingConfiguration]
a -> ListPackagingConfigurationsResponse
s {$sel:packagingConfigurations:ListPackagingConfigurationsResponse' :: Maybe [PackagingConfiguration]
packagingConfigurations = Maybe [PackagingConfiguration]
a} :: ListPackagingConfigurationsResponse) 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
listPackagingConfigurationsResponse_httpStatus :: Lens.Lens' ListPackagingConfigurationsResponse Prelude.Int
listPackagingConfigurationsResponse_httpStatus :: Lens' ListPackagingConfigurationsResponse Int
listPackagingConfigurationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPackagingConfigurationsResponse' :: ListPackagingConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPackagingConfigurationsResponse
s@ListPackagingConfigurationsResponse' {} Int
a -> ListPackagingConfigurationsResponse
s {$sel:httpStatus:ListPackagingConfigurationsResponse' :: Int
httpStatus = Int
a} :: ListPackagingConfigurationsResponse)
instance
Prelude.NFData
ListPackagingConfigurationsResponse
where
rnf :: ListPackagingConfigurationsResponse -> ()
rnf ListPackagingConfigurationsResponse' {Int
Maybe [PackagingConfiguration]
Maybe Text
httpStatus :: Int
packagingConfigurations :: Maybe [PackagingConfiguration]
nextToken :: Maybe Text
$sel:httpStatus:ListPackagingConfigurationsResponse' :: ListPackagingConfigurationsResponse -> Int
$sel:packagingConfigurations:ListPackagingConfigurationsResponse' :: ListPackagingConfigurationsResponse
-> Maybe [PackagingConfiguration]
$sel:nextToken:ListPackagingConfigurationsResponse' :: ListPackagingConfigurationsResponse -> Maybe Text
..} =
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 Maybe [PackagingConfiguration]
packagingConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus