{-# 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.Snowball.ListCompatibleImages
(
ListCompatibleImages (..),
newListCompatibleImages,
listCompatibleImages_maxResults,
listCompatibleImages_nextToken,
ListCompatibleImagesResponse (..),
newListCompatibleImagesResponse,
listCompatibleImagesResponse_compatibleImages,
listCompatibleImagesResponse_nextToken,
listCompatibleImagesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Snowball.Types
data ListCompatibleImages = ListCompatibleImages'
{
ListCompatibleImages -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListCompatibleImages -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListCompatibleImages -> ListCompatibleImages -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCompatibleImages -> ListCompatibleImages -> Bool
$c/= :: ListCompatibleImages -> ListCompatibleImages -> Bool
== :: ListCompatibleImages -> ListCompatibleImages -> Bool
$c== :: ListCompatibleImages -> ListCompatibleImages -> Bool
Prelude.Eq, ReadPrec [ListCompatibleImages]
ReadPrec ListCompatibleImages
Int -> ReadS ListCompatibleImages
ReadS [ListCompatibleImages]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCompatibleImages]
$creadListPrec :: ReadPrec [ListCompatibleImages]
readPrec :: ReadPrec ListCompatibleImages
$creadPrec :: ReadPrec ListCompatibleImages
readList :: ReadS [ListCompatibleImages]
$creadList :: ReadS [ListCompatibleImages]
readsPrec :: Int -> ReadS ListCompatibleImages
$creadsPrec :: Int -> ReadS ListCompatibleImages
Prelude.Read, Int -> ListCompatibleImages -> ShowS
[ListCompatibleImages] -> ShowS
ListCompatibleImages -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCompatibleImages] -> ShowS
$cshowList :: [ListCompatibleImages] -> ShowS
show :: ListCompatibleImages -> String
$cshow :: ListCompatibleImages -> String
showsPrec :: Int -> ListCompatibleImages -> ShowS
$cshowsPrec :: Int -> ListCompatibleImages -> ShowS
Prelude.Show, forall x. Rep ListCompatibleImages x -> ListCompatibleImages
forall x. ListCompatibleImages -> Rep ListCompatibleImages x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCompatibleImages x -> ListCompatibleImages
$cfrom :: forall x. ListCompatibleImages -> Rep ListCompatibleImages x
Prelude.Generic)
newListCompatibleImages ::
ListCompatibleImages
newListCompatibleImages :: ListCompatibleImages
newListCompatibleImages =
ListCompatibleImages'
{ $sel:maxResults:ListCompatibleImages' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCompatibleImages' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listCompatibleImages_maxResults :: Lens.Lens' ListCompatibleImages (Prelude.Maybe Prelude.Natural)
listCompatibleImages_maxResults :: Lens' ListCompatibleImages (Maybe Natural)
listCompatibleImages_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImages' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCompatibleImages' :: ListCompatibleImages -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCompatibleImages
s@ListCompatibleImages' {} Maybe Natural
a -> ListCompatibleImages
s {$sel:maxResults:ListCompatibleImages' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCompatibleImages)
listCompatibleImages_nextToken :: Lens.Lens' ListCompatibleImages (Prelude.Maybe Prelude.Text)
listCompatibleImages_nextToken :: Lens' ListCompatibleImages (Maybe Text)
listCompatibleImages_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImages' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCompatibleImages' :: ListCompatibleImages -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCompatibleImages
s@ListCompatibleImages' {} Maybe Text
a -> ListCompatibleImages
s {$sel:nextToken:ListCompatibleImages' :: Maybe Text
nextToken = Maybe Text
a} :: ListCompatibleImages)
instance Core.AWSPager ListCompatibleImages where
page :: ListCompatibleImages
-> AWSResponse ListCompatibleImages -> Maybe ListCompatibleImages
page ListCompatibleImages
rq AWSResponse ListCompatibleImages
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListCompatibleImages
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCompatibleImagesResponse (Maybe Text)
listCompatibleImagesResponse_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 ListCompatibleImages
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCompatibleImagesResponse (Maybe [CompatibleImage])
listCompatibleImagesResponse_compatibleImages
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.$ ListCompatibleImages
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCompatibleImages (Maybe Text)
listCompatibleImages_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCompatibleImages
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCompatibleImagesResponse (Maybe Text)
listCompatibleImagesResponse_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 ListCompatibleImages where
type
AWSResponse ListCompatibleImages =
ListCompatibleImagesResponse
request :: (Service -> Service)
-> ListCompatibleImages -> Request ListCompatibleImages
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 ListCompatibleImages
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListCompatibleImages)))
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 [CompatibleImage]
-> Maybe Text -> Int -> ListCompatibleImagesResponse
ListCompatibleImagesResponse'
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
"CompatibleImages"
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 ListCompatibleImages where
hashWithSalt :: Int -> ListCompatibleImages -> Int
hashWithSalt Int
_salt ListCompatibleImages' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListCompatibleImages' :: ListCompatibleImages -> Maybe Text
$sel:maxResults:ListCompatibleImages' :: ListCompatibleImages -> 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 ListCompatibleImages where
rnf :: ListCompatibleImages -> ()
rnf ListCompatibleImages' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListCompatibleImages' :: ListCompatibleImages -> Maybe Text
$sel:maxResults:ListCompatibleImages' :: ListCompatibleImages -> 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 ListCompatibleImages where
toHeaders :: ListCompatibleImages -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSIESnowballJobManagementService.ListCompatibleImages" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListCompatibleImages where
toJSON :: ListCompatibleImages -> Value
toJSON ListCompatibleImages' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListCompatibleImages' :: ListCompatibleImages -> Maybe Text
$sel:maxResults:ListCompatibleImages' :: ListCompatibleImages -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" 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 Natural
maxResults,
(Key
"NextToken" 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
nextToken
]
)
instance Data.ToPath ListCompatibleImages where
toPath :: ListCompatibleImages -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListCompatibleImages where
toQuery :: ListCompatibleImages -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListCompatibleImagesResponse = ListCompatibleImagesResponse'
{
ListCompatibleImagesResponse -> Maybe [CompatibleImage]
compatibleImages :: Prelude.Maybe [CompatibleImage],
ListCompatibleImagesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListCompatibleImagesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
$c/= :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
== :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
$c== :: ListCompatibleImagesResponse
-> ListCompatibleImagesResponse -> Bool
Prelude.Eq, ReadPrec [ListCompatibleImagesResponse]
ReadPrec ListCompatibleImagesResponse
Int -> ReadS ListCompatibleImagesResponse
ReadS [ListCompatibleImagesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCompatibleImagesResponse]
$creadListPrec :: ReadPrec [ListCompatibleImagesResponse]
readPrec :: ReadPrec ListCompatibleImagesResponse
$creadPrec :: ReadPrec ListCompatibleImagesResponse
readList :: ReadS [ListCompatibleImagesResponse]
$creadList :: ReadS [ListCompatibleImagesResponse]
readsPrec :: Int -> ReadS ListCompatibleImagesResponse
$creadsPrec :: Int -> ReadS ListCompatibleImagesResponse
Prelude.Read, Int -> ListCompatibleImagesResponse -> ShowS
[ListCompatibleImagesResponse] -> ShowS
ListCompatibleImagesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCompatibleImagesResponse] -> ShowS
$cshowList :: [ListCompatibleImagesResponse] -> ShowS
show :: ListCompatibleImagesResponse -> String
$cshow :: ListCompatibleImagesResponse -> String
showsPrec :: Int -> ListCompatibleImagesResponse -> ShowS
$cshowsPrec :: Int -> ListCompatibleImagesResponse -> ShowS
Prelude.Show, forall x.
Rep ListCompatibleImagesResponse x -> ListCompatibleImagesResponse
forall x.
ListCompatibleImagesResponse -> Rep ListCompatibleImagesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCompatibleImagesResponse x -> ListCompatibleImagesResponse
$cfrom :: forall x.
ListCompatibleImagesResponse -> Rep ListCompatibleImagesResponse x
Prelude.Generic)
newListCompatibleImagesResponse ::
Prelude.Int ->
ListCompatibleImagesResponse
newListCompatibleImagesResponse :: Int -> ListCompatibleImagesResponse
newListCompatibleImagesResponse Int
pHttpStatus_ =
ListCompatibleImagesResponse'
{ $sel:compatibleImages:ListCompatibleImagesResponse' :: Maybe [CompatibleImage]
compatibleImages =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListCompatibleImagesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListCompatibleImagesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listCompatibleImagesResponse_compatibleImages :: Lens.Lens' ListCompatibleImagesResponse (Prelude.Maybe [CompatibleImage])
listCompatibleImagesResponse_compatibleImages :: Lens' ListCompatibleImagesResponse (Maybe [CompatibleImage])
listCompatibleImagesResponse_compatibleImages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImagesResponse' {Maybe [CompatibleImage]
compatibleImages :: Maybe [CompatibleImage]
$sel:compatibleImages:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Maybe [CompatibleImage]
compatibleImages} -> Maybe [CompatibleImage]
compatibleImages) (\s :: ListCompatibleImagesResponse
s@ListCompatibleImagesResponse' {} Maybe [CompatibleImage]
a -> ListCompatibleImagesResponse
s {$sel:compatibleImages:ListCompatibleImagesResponse' :: Maybe [CompatibleImage]
compatibleImages = Maybe [CompatibleImage]
a} :: ListCompatibleImagesResponse) 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
listCompatibleImagesResponse_nextToken :: Lens.Lens' ListCompatibleImagesResponse (Prelude.Maybe Prelude.Text)
listCompatibleImagesResponse_nextToken :: Lens' ListCompatibleImagesResponse (Maybe Text)
listCompatibleImagesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImagesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCompatibleImagesResponse
s@ListCompatibleImagesResponse' {} Maybe Text
a -> ListCompatibleImagesResponse
s {$sel:nextToken:ListCompatibleImagesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCompatibleImagesResponse)
listCompatibleImagesResponse_httpStatus :: Lens.Lens' ListCompatibleImagesResponse Prelude.Int
listCompatibleImagesResponse_httpStatus :: Lens' ListCompatibleImagesResponse Int
listCompatibleImagesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCompatibleImagesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListCompatibleImagesResponse
s@ListCompatibleImagesResponse' {} Int
a -> ListCompatibleImagesResponse
s {$sel:httpStatus:ListCompatibleImagesResponse' :: Int
httpStatus = Int
a} :: ListCompatibleImagesResponse)
instance Prelude.NFData ListCompatibleImagesResponse where
rnf :: ListCompatibleImagesResponse -> ()
rnf ListCompatibleImagesResponse' {Int
Maybe [CompatibleImage]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
compatibleImages :: Maybe [CompatibleImage]
$sel:httpStatus:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Int
$sel:nextToken:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Maybe Text
$sel:compatibleImages:ListCompatibleImagesResponse' :: ListCompatibleImagesResponse -> Maybe [CompatibleImage]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [CompatibleImage]
compatibleImages
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