{-# 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.ListLongTermPricing
(
ListLongTermPricing (..),
newListLongTermPricing,
listLongTermPricing_nextToken,
listLongTermPricing_maxResults,
ListLongTermPricingResponse (..),
newListLongTermPricingResponse,
listLongTermPricingResponse_longTermPricingEntries,
listLongTermPricingResponse_nextToken,
listLongTermPricingResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.Snowball.Types
data ListLongTermPricing = ListLongTermPricing'
{
ListLongTermPricing -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLongTermPricing -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListLongTermPricing -> ListLongTermPricing -> Bool
(ListLongTermPricing -> ListLongTermPricing -> Bool)
-> (ListLongTermPricing -> ListLongTermPricing -> Bool)
-> Eq ListLongTermPricing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLongTermPricing -> ListLongTermPricing -> Bool
$c/= :: ListLongTermPricing -> ListLongTermPricing -> Bool
== :: ListLongTermPricing -> ListLongTermPricing -> Bool
$c== :: ListLongTermPricing -> ListLongTermPricing -> Bool
Prelude.Eq, ReadPrec [ListLongTermPricing]
ReadPrec ListLongTermPricing
Int -> ReadS ListLongTermPricing
ReadS [ListLongTermPricing]
(Int -> ReadS ListLongTermPricing)
-> ReadS [ListLongTermPricing]
-> ReadPrec ListLongTermPricing
-> ReadPrec [ListLongTermPricing]
-> Read ListLongTermPricing
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLongTermPricing]
$creadListPrec :: ReadPrec [ListLongTermPricing]
readPrec :: ReadPrec ListLongTermPricing
$creadPrec :: ReadPrec ListLongTermPricing
readList :: ReadS [ListLongTermPricing]
$creadList :: ReadS [ListLongTermPricing]
readsPrec :: Int -> ReadS ListLongTermPricing
$creadsPrec :: Int -> ReadS ListLongTermPricing
Prelude.Read, Int -> ListLongTermPricing -> ShowS
[ListLongTermPricing] -> ShowS
ListLongTermPricing -> String
(Int -> ListLongTermPricing -> ShowS)
-> (ListLongTermPricing -> String)
-> ([ListLongTermPricing] -> ShowS)
-> Show ListLongTermPricing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLongTermPricing] -> ShowS
$cshowList :: [ListLongTermPricing] -> ShowS
show :: ListLongTermPricing -> String
$cshow :: ListLongTermPricing -> String
showsPrec :: Int -> ListLongTermPricing -> ShowS
$cshowsPrec :: Int -> ListLongTermPricing -> ShowS
Prelude.Show, (forall x. ListLongTermPricing -> Rep ListLongTermPricing x)
-> (forall x. Rep ListLongTermPricing x -> ListLongTermPricing)
-> Generic ListLongTermPricing
forall x. Rep ListLongTermPricing x -> ListLongTermPricing
forall x. ListLongTermPricing -> Rep ListLongTermPricing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLongTermPricing x -> ListLongTermPricing
$cfrom :: forall x. ListLongTermPricing -> Rep ListLongTermPricing x
Prelude.Generic)
newListLongTermPricing ::
ListLongTermPricing
newListLongTermPricing :: ListLongTermPricing
newListLongTermPricing =
ListLongTermPricing' :: Maybe Text -> Maybe Natural -> ListLongTermPricing
ListLongTermPricing'
{ $sel:nextToken:ListLongTermPricing' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListLongTermPricing' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listLongTermPricing_nextToken :: Lens.Lens' ListLongTermPricing (Prelude.Maybe Prelude.Text)
listLongTermPricing_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLongTermPricing -> f ListLongTermPricing
listLongTermPricing_nextToken = (ListLongTermPricing -> Maybe Text)
-> (ListLongTermPricing -> Maybe Text -> ListLongTermPricing)
-> Lens
ListLongTermPricing ListLongTermPricing (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLongTermPricing' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLongTermPricing' :: ListLongTermPricing -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLongTermPricing
s@ListLongTermPricing' {} Maybe Text
a -> ListLongTermPricing
s {$sel:nextToken:ListLongTermPricing' :: Maybe Text
nextToken = Maybe Text
a} :: ListLongTermPricing)
listLongTermPricing_maxResults :: Lens.Lens' ListLongTermPricing (Prelude.Maybe Prelude.Natural)
listLongTermPricing_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListLongTermPricing -> f ListLongTermPricing
listLongTermPricing_maxResults = (ListLongTermPricing -> Maybe Natural)
-> (ListLongTermPricing -> Maybe Natural -> ListLongTermPricing)
-> Lens
ListLongTermPricing
ListLongTermPricing
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLongTermPricing' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListLongTermPricing' :: ListLongTermPricing -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListLongTermPricing
s@ListLongTermPricing' {} Maybe Natural
a -> ListLongTermPricing
s {$sel:maxResults:ListLongTermPricing' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListLongTermPricing)
instance Core.AWSRequest ListLongTermPricing where
type
AWSResponse ListLongTermPricing =
ListLongTermPricingResponse
request :: ListLongTermPricing -> Request ListLongTermPricing
request = Service -> ListLongTermPricing -> Request ListLongTermPricing
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListLongTermPricing
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListLongTermPricing)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListLongTermPricing))
-> Logger
-> Service
-> Proxy ListLongTermPricing
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListLongTermPricing)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [LongTermPricingListEntry]
-> Maybe Text -> Int -> ListLongTermPricingResponse
ListLongTermPricingResponse'
(Maybe [LongTermPricingListEntry]
-> Maybe Text -> Int -> ListLongTermPricingResponse)
-> Either String (Maybe [LongTermPricingListEntry])
-> Either String (Maybe Text -> Int -> ListLongTermPricingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [LongTermPricingListEntry]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LongTermPricingEntries"
Either String (Maybe (Maybe [LongTermPricingListEntry]))
-> Maybe [LongTermPricingListEntry]
-> Either String (Maybe [LongTermPricingListEntry])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [LongTermPricingListEntry]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> ListLongTermPricingResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListLongTermPricingResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either String (Int -> ListLongTermPricingResponse)
-> Either String Int -> Either String ListLongTermPricingResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListLongTermPricing
instance Prelude.NFData ListLongTermPricing
instance Core.ToHeaders ListLongTermPricing where
toHeaders :: ListLongTermPricing -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListLongTermPricing -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSIESnowballJobManagementService.ListLongTermPricing" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ListLongTermPricing where
toJSON :: ListLongTermPricing -> Value
toJSON ListLongTermPricing' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListLongTermPricing' :: ListLongTermPricing -> Maybe Natural
$sel:nextToken:ListLongTermPricing' :: ListLongTermPricing -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath ListLongTermPricing where
toPath :: ListLongTermPricing -> ByteString
toPath = ByteString -> ListLongTermPricing -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListLongTermPricing where
toQuery :: ListLongTermPricing -> QueryString
toQuery = QueryString -> ListLongTermPricing -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListLongTermPricingResponse = ListLongTermPricingResponse'
{
ListLongTermPricingResponse -> Maybe [LongTermPricingListEntry]
longTermPricingEntries :: Prelude.Maybe [LongTermPricingListEntry],
ListLongTermPricingResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLongTermPricingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListLongTermPricingResponse -> ListLongTermPricingResponse -> Bool
(ListLongTermPricingResponse
-> ListLongTermPricingResponse -> Bool)
-> (ListLongTermPricingResponse
-> ListLongTermPricingResponse -> Bool)
-> Eq ListLongTermPricingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLongTermPricingResponse -> ListLongTermPricingResponse -> Bool
$c/= :: ListLongTermPricingResponse -> ListLongTermPricingResponse -> Bool
== :: ListLongTermPricingResponse -> ListLongTermPricingResponse -> Bool
$c== :: ListLongTermPricingResponse -> ListLongTermPricingResponse -> Bool
Prelude.Eq, ReadPrec [ListLongTermPricingResponse]
ReadPrec ListLongTermPricingResponse
Int -> ReadS ListLongTermPricingResponse
ReadS [ListLongTermPricingResponse]
(Int -> ReadS ListLongTermPricingResponse)
-> ReadS [ListLongTermPricingResponse]
-> ReadPrec ListLongTermPricingResponse
-> ReadPrec [ListLongTermPricingResponse]
-> Read ListLongTermPricingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLongTermPricingResponse]
$creadListPrec :: ReadPrec [ListLongTermPricingResponse]
readPrec :: ReadPrec ListLongTermPricingResponse
$creadPrec :: ReadPrec ListLongTermPricingResponse
readList :: ReadS [ListLongTermPricingResponse]
$creadList :: ReadS [ListLongTermPricingResponse]
readsPrec :: Int -> ReadS ListLongTermPricingResponse
$creadsPrec :: Int -> ReadS ListLongTermPricingResponse
Prelude.Read, Int -> ListLongTermPricingResponse -> ShowS
[ListLongTermPricingResponse] -> ShowS
ListLongTermPricingResponse -> String
(Int -> ListLongTermPricingResponse -> ShowS)
-> (ListLongTermPricingResponse -> String)
-> ([ListLongTermPricingResponse] -> ShowS)
-> Show ListLongTermPricingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLongTermPricingResponse] -> ShowS
$cshowList :: [ListLongTermPricingResponse] -> ShowS
show :: ListLongTermPricingResponse -> String
$cshow :: ListLongTermPricingResponse -> String
showsPrec :: Int -> ListLongTermPricingResponse -> ShowS
$cshowsPrec :: Int -> ListLongTermPricingResponse -> ShowS
Prelude.Show, (forall x.
ListLongTermPricingResponse -> Rep ListLongTermPricingResponse x)
-> (forall x.
Rep ListLongTermPricingResponse x -> ListLongTermPricingResponse)
-> Generic ListLongTermPricingResponse
forall x.
Rep ListLongTermPricingResponse x -> ListLongTermPricingResponse
forall x.
ListLongTermPricingResponse -> Rep ListLongTermPricingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListLongTermPricingResponse x -> ListLongTermPricingResponse
$cfrom :: forall x.
ListLongTermPricingResponse -> Rep ListLongTermPricingResponse x
Prelude.Generic)
newListLongTermPricingResponse ::
Prelude.Int ->
ListLongTermPricingResponse
newListLongTermPricingResponse :: Int -> ListLongTermPricingResponse
newListLongTermPricingResponse Int
pHttpStatus_ =
ListLongTermPricingResponse' :: Maybe [LongTermPricingListEntry]
-> Maybe Text -> Int -> ListLongTermPricingResponse
ListLongTermPricingResponse'
{ $sel:longTermPricingEntries:ListLongTermPricingResponse' :: Maybe [LongTermPricingListEntry]
longTermPricingEntries =
Maybe [LongTermPricingListEntry]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListLongTermPricingResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListLongTermPricingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listLongTermPricingResponse_longTermPricingEntries :: Lens.Lens' ListLongTermPricingResponse (Prelude.Maybe [LongTermPricingListEntry])
listLongTermPricingResponse_longTermPricingEntries :: (Maybe [LongTermPricingListEntry]
-> f (Maybe [LongTermPricingListEntry]))
-> ListLongTermPricingResponse -> f ListLongTermPricingResponse
listLongTermPricingResponse_longTermPricingEntries = (ListLongTermPricingResponse -> Maybe [LongTermPricingListEntry])
-> (ListLongTermPricingResponse
-> Maybe [LongTermPricingListEntry] -> ListLongTermPricingResponse)
-> Lens
ListLongTermPricingResponse
ListLongTermPricingResponse
(Maybe [LongTermPricingListEntry])
(Maybe [LongTermPricingListEntry])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLongTermPricingResponse' {Maybe [LongTermPricingListEntry]
longTermPricingEntries :: Maybe [LongTermPricingListEntry]
$sel:longTermPricingEntries:ListLongTermPricingResponse' :: ListLongTermPricingResponse -> Maybe [LongTermPricingListEntry]
longTermPricingEntries} -> Maybe [LongTermPricingListEntry]
longTermPricingEntries) (\s :: ListLongTermPricingResponse
s@ListLongTermPricingResponse' {} Maybe [LongTermPricingListEntry]
a -> ListLongTermPricingResponse
s {$sel:longTermPricingEntries:ListLongTermPricingResponse' :: Maybe [LongTermPricingListEntry]
longTermPricingEntries = Maybe [LongTermPricingListEntry]
a} :: ListLongTermPricingResponse) ((Maybe [LongTermPricingListEntry]
-> f (Maybe [LongTermPricingListEntry]))
-> ListLongTermPricingResponse -> f ListLongTermPricingResponse)
-> ((Maybe [LongTermPricingListEntry]
-> f (Maybe [LongTermPricingListEntry]))
-> Maybe [LongTermPricingListEntry]
-> f (Maybe [LongTermPricingListEntry]))
-> (Maybe [LongTermPricingListEntry]
-> f (Maybe [LongTermPricingListEntry]))
-> ListLongTermPricingResponse
-> f ListLongTermPricingResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[LongTermPricingListEntry]
[LongTermPricingListEntry]
[LongTermPricingListEntry]
[LongTermPricingListEntry]
-> Iso
(Maybe [LongTermPricingListEntry])
(Maybe [LongTermPricingListEntry])
(Maybe [LongTermPricingListEntry])
(Maybe [LongTermPricingListEntry])
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 AnIso
[LongTermPricingListEntry]
[LongTermPricingListEntry]
[LongTermPricingListEntry]
[LongTermPricingListEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listLongTermPricingResponse_nextToken :: Lens.Lens' ListLongTermPricingResponse (Prelude.Maybe Prelude.Text)
listLongTermPricingResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListLongTermPricingResponse -> f ListLongTermPricingResponse
listLongTermPricingResponse_nextToken = (ListLongTermPricingResponse -> Maybe Text)
-> (ListLongTermPricingResponse
-> Maybe Text -> ListLongTermPricingResponse)
-> Lens
ListLongTermPricingResponse
ListLongTermPricingResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLongTermPricingResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLongTermPricingResponse' :: ListLongTermPricingResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLongTermPricingResponse
s@ListLongTermPricingResponse' {} Maybe Text
a -> ListLongTermPricingResponse
s {$sel:nextToken:ListLongTermPricingResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLongTermPricingResponse)
listLongTermPricingResponse_httpStatus :: Lens.Lens' ListLongTermPricingResponse Prelude.Int
listLongTermPricingResponse_httpStatus :: (Int -> f Int)
-> ListLongTermPricingResponse -> f ListLongTermPricingResponse
listLongTermPricingResponse_httpStatus = (ListLongTermPricingResponse -> Int)
-> (ListLongTermPricingResponse
-> Int -> ListLongTermPricingResponse)
-> Lens
ListLongTermPricingResponse ListLongTermPricingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLongTermPricingResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListLongTermPricingResponse' :: ListLongTermPricingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListLongTermPricingResponse
s@ListLongTermPricingResponse' {} Int
a -> ListLongTermPricingResponse
s {$sel:httpStatus:ListLongTermPricingResponse' :: Int
httpStatus = Int
a} :: ListLongTermPricingResponse)
instance Prelude.NFData ListLongTermPricingResponse