{-# 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.ListPackagingGroups
(
ListPackagingGroups (..),
newListPackagingGroups,
listPackagingGroups_maxResults,
listPackagingGroups_nextToken,
ListPackagingGroupsResponse (..),
newListPackagingGroupsResponse,
listPackagingGroupsResponse_nextToken,
listPackagingGroupsResponse_packagingGroups,
listPackagingGroupsResponse_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 ListPackagingGroups = ListPackagingGroups'
{
ListPackagingGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListPackagingGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListPackagingGroups -> ListPackagingGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackagingGroups -> ListPackagingGroups -> Bool
$c/= :: ListPackagingGroups -> ListPackagingGroups -> Bool
== :: ListPackagingGroups -> ListPackagingGroups -> Bool
$c== :: ListPackagingGroups -> ListPackagingGroups -> Bool
Prelude.Eq, ReadPrec [ListPackagingGroups]
ReadPrec ListPackagingGroups
Int -> ReadS ListPackagingGroups
ReadS [ListPackagingGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackagingGroups]
$creadListPrec :: ReadPrec [ListPackagingGroups]
readPrec :: ReadPrec ListPackagingGroups
$creadPrec :: ReadPrec ListPackagingGroups
readList :: ReadS [ListPackagingGroups]
$creadList :: ReadS [ListPackagingGroups]
readsPrec :: Int -> ReadS ListPackagingGroups
$creadsPrec :: Int -> ReadS ListPackagingGroups
Prelude.Read, Int -> ListPackagingGroups -> ShowS
[ListPackagingGroups] -> ShowS
ListPackagingGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackagingGroups] -> ShowS
$cshowList :: [ListPackagingGroups] -> ShowS
show :: ListPackagingGroups -> String
$cshow :: ListPackagingGroups -> String
showsPrec :: Int -> ListPackagingGroups -> ShowS
$cshowsPrec :: Int -> ListPackagingGroups -> ShowS
Prelude.Show, forall x. Rep ListPackagingGroups x -> ListPackagingGroups
forall x. ListPackagingGroups -> Rep ListPackagingGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPackagingGroups x -> ListPackagingGroups
$cfrom :: forall x. ListPackagingGroups -> Rep ListPackagingGroups x
Prelude.Generic)
newListPackagingGroups ::
ListPackagingGroups
newListPackagingGroups :: ListPackagingGroups
newListPackagingGroups =
ListPackagingGroups'
{ $sel:maxResults:ListPackagingGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPackagingGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listPackagingGroups_maxResults :: Lens.Lens' ListPackagingGroups (Prelude.Maybe Prelude.Natural)
listPackagingGroups_maxResults :: Lens' ListPackagingGroups (Maybe Natural)
listPackagingGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPackagingGroups' :: ListPackagingGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPackagingGroups
s@ListPackagingGroups' {} Maybe Natural
a -> ListPackagingGroups
s {$sel:maxResults:ListPackagingGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPackagingGroups)
listPackagingGroups_nextToken :: Lens.Lens' ListPackagingGroups (Prelude.Maybe Prelude.Text)
listPackagingGroups_nextToken :: Lens' ListPackagingGroups (Maybe Text)
listPackagingGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackagingGroups' :: ListPackagingGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackagingGroups
s@ListPackagingGroups' {} Maybe Text
a -> ListPackagingGroups
s {$sel:nextToken:ListPackagingGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackagingGroups)
instance Core.AWSPager ListPackagingGroups where
page :: ListPackagingGroups
-> AWSResponse ListPackagingGroups -> Maybe ListPackagingGroups
page ListPackagingGroups
rq AWSResponse ListPackagingGroups
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPackagingGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPackagingGroupsResponse (Maybe Text)
listPackagingGroupsResponse_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 ListPackagingGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPackagingGroupsResponse (Maybe [PackagingGroup])
listPackagingGroupsResponse_packagingGroups
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.$ ListPackagingGroups
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListPackagingGroups (Maybe Text)
listPackagingGroups_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPackagingGroups
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPackagingGroupsResponse (Maybe Text)
listPackagingGroupsResponse_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 ListPackagingGroups where
type
AWSResponse ListPackagingGroups =
ListPackagingGroupsResponse
request :: (Service -> Service)
-> ListPackagingGroups -> Request ListPackagingGroups
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 ListPackagingGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPackagingGroups)))
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 [PackagingGroup] -> Int -> ListPackagingGroupsResponse
ListPackagingGroupsResponse'
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
"packagingGroups"
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 ListPackagingGroups where
hashWithSalt :: Int -> ListPackagingGroups -> Int
hashWithSalt Int
_salt ListPackagingGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListPackagingGroups' :: ListPackagingGroups -> Maybe Text
$sel:maxResults:ListPackagingGroups' :: ListPackagingGroups -> 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
instance Prelude.NFData ListPackagingGroups where
rnf :: ListPackagingGroups -> ()
rnf ListPackagingGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListPackagingGroups' :: ListPackagingGroups -> Maybe Text
$sel:maxResults:ListPackagingGroups' :: ListPackagingGroups -> 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
instance Data.ToHeaders ListPackagingGroups where
toHeaders :: ListPackagingGroups -> 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 ListPackagingGroups where
toPath :: ListPackagingGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/packaging_groups"
instance Data.ToQuery ListPackagingGroups where
toQuery :: ListPackagingGroups -> QueryString
toQuery ListPackagingGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListPackagingGroups' :: ListPackagingGroups -> Maybe Text
$sel:maxResults:ListPackagingGroups' :: ListPackagingGroups -> 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 ListPackagingGroupsResponse = ListPackagingGroupsResponse'
{
ListPackagingGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPackagingGroupsResponse -> Maybe [PackagingGroup]
packagingGroups :: Prelude.Maybe [PackagingGroup],
ListPackagingGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
$c/= :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
== :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
$c== :: ListPackagingGroupsResponse -> ListPackagingGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListPackagingGroupsResponse]
ReadPrec ListPackagingGroupsResponse
Int -> ReadS ListPackagingGroupsResponse
ReadS [ListPackagingGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPackagingGroupsResponse]
$creadListPrec :: ReadPrec [ListPackagingGroupsResponse]
readPrec :: ReadPrec ListPackagingGroupsResponse
$creadPrec :: ReadPrec ListPackagingGroupsResponse
readList :: ReadS [ListPackagingGroupsResponse]
$creadList :: ReadS [ListPackagingGroupsResponse]
readsPrec :: Int -> ReadS ListPackagingGroupsResponse
$creadsPrec :: Int -> ReadS ListPackagingGroupsResponse
Prelude.Read, Int -> ListPackagingGroupsResponse -> ShowS
[ListPackagingGroupsResponse] -> ShowS
ListPackagingGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPackagingGroupsResponse] -> ShowS
$cshowList :: [ListPackagingGroupsResponse] -> ShowS
show :: ListPackagingGroupsResponse -> String
$cshow :: ListPackagingGroupsResponse -> String
showsPrec :: Int -> ListPackagingGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListPackagingGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListPackagingGroupsResponse x -> ListPackagingGroupsResponse
forall x.
ListPackagingGroupsResponse -> Rep ListPackagingGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPackagingGroupsResponse x -> ListPackagingGroupsResponse
$cfrom :: forall x.
ListPackagingGroupsResponse -> Rep ListPackagingGroupsResponse x
Prelude.Generic)
newListPackagingGroupsResponse ::
Prelude.Int ->
ListPackagingGroupsResponse
newListPackagingGroupsResponse :: Int -> ListPackagingGroupsResponse
newListPackagingGroupsResponse Int
pHttpStatus_ =
ListPackagingGroupsResponse'
{ $sel:nextToken:ListPackagingGroupsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:packagingGroups:ListPackagingGroupsResponse' :: Maybe [PackagingGroup]
packagingGroups = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPackagingGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPackagingGroupsResponse_nextToken :: Lens.Lens' ListPackagingGroupsResponse (Prelude.Maybe Prelude.Text)
listPackagingGroupsResponse_nextToken :: Lens' ListPackagingGroupsResponse (Maybe Text)
listPackagingGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPackagingGroupsResponse
s@ListPackagingGroupsResponse' {} Maybe Text
a -> ListPackagingGroupsResponse
s {$sel:nextToken:ListPackagingGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPackagingGroupsResponse)
listPackagingGroupsResponse_packagingGroups :: Lens.Lens' ListPackagingGroupsResponse (Prelude.Maybe [PackagingGroup])
listPackagingGroupsResponse_packagingGroups :: Lens' ListPackagingGroupsResponse (Maybe [PackagingGroup])
listPackagingGroupsResponse_packagingGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroupsResponse' {Maybe [PackagingGroup]
packagingGroups :: Maybe [PackagingGroup]
$sel:packagingGroups:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Maybe [PackagingGroup]
packagingGroups} -> Maybe [PackagingGroup]
packagingGroups) (\s :: ListPackagingGroupsResponse
s@ListPackagingGroupsResponse' {} Maybe [PackagingGroup]
a -> ListPackagingGroupsResponse
s {$sel:packagingGroups:ListPackagingGroupsResponse' :: Maybe [PackagingGroup]
packagingGroups = Maybe [PackagingGroup]
a} :: ListPackagingGroupsResponse) 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
listPackagingGroupsResponse_httpStatus :: Lens.Lens' ListPackagingGroupsResponse Prelude.Int
listPackagingGroupsResponse_httpStatus :: Lens' ListPackagingGroupsResponse Int
listPackagingGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPackagingGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListPackagingGroupsResponse
s@ListPackagingGroupsResponse' {} Int
a -> ListPackagingGroupsResponse
s {$sel:httpStatus:ListPackagingGroupsResponse' :: Int
httpStatus = Int
a} :: ListPackagingGroupsResponse)
instance Prelude.NFData ListPackagingGroupsResponse where
rnf :: ListPackagingGroupsResponse -> ()
rnf ListPackagingGroupsResponse' {Int
Maybe [PackagingGroup]
Maybe Text
httpStatus :: Int
packagingGroups :: Maybe [PackagingGroup]
nextToken :: Maybe Text
$sel:httpStatus:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Int
$sel:packagingGroups:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> Maybe [PackagingGroup]
$sel:nextToken:ListPackagingGroupsResponse' :: ListPackagingGroupsResponse -> 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 [PackagingGroup]
packagingGroups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus