{-# 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.GlobalAccelerator.ListByoipCidrs
(
ListByoipCidrs (..),
newListByoipCidrs,
listByoipCidrs_maxResults,
listByoipCidrs_nextToken,
ListByoipCidrsResponse (..),
newListByoipCidrsResponse,
listByoipCidrsResponse_byoipCidrs,
listByoipCidrsResponse_nextToken,
listByoipCidrsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GlobalAccelerator.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListByoipCidrs = ListByoipCidrs'
{
ListByoipCidrs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListByoipCidrs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListByoipCidrs -> ListByoipCidrs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListByoipCidrs -> ListByoipCidrs -> Bool
$c/= :: ListByoipCidrs -> ListByoipCidrs -> Bool
== :: ListByoipCidrs -> ListByoipCidrs -> Bool
$c== :: ListByoipCidrs -> ListByoipCidrs -> Bool
Prelude.Eq, ReadPrec [ListByoipCidrs]
ReadPrec ListByoipCidrs
Int -> ReadS ListByoipCidrs
ReadS [ListByoipCidrs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListByoipCidrs]
$creadListPrec :: ReadPrec [ListByoipCidrs]
readPrec :: ReadPrec ListByoipCidrs
$creadPrec :: ReadPrec ListByoipCidrs
readList :: ReadS [ListByoipCidrs]
$creadList :: ReadS [ListByoipCidrs]
readsPrec :: Int -> ReadS ListByoipCidrs
$creadsPrec :: Int -> ReadS ListByoipCidrs
Prelude.Read, Int -> ListByoipCidrs -> ShowS
[ListByoipCidrs] -> ShowS
ListByoipCidrs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListByoipCidrs] -> ShowS
$cshowList :: [ListByoipCidrs] -> ShowS
show :: ListByoipCidrs -> String
$cshow :: ListByoipCidrs -> String
showsPrec :: Int -> ListByoipCidrs -> ShowS
$cshowsPrec :: Int -> ListByoipCidrs -> ShowS
Prelude.Show, forall x. Rep ListByoipCidrs x -> ListByoipCidrs
forall x. ListByoipCidrs -> Rep ListByoipCidrs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListByoipCidrs x -> ListByoipCidrs
$cfrom :: forall x. ListByoipCidrs -> Rep ListByoipCidrs x
Prelude.Generic)
newListByoipCidrs ::
ListByoipCidrs
newListByoipCidrs :: ListByoipCidrs
newListByoipCidrs =
ListByoipCidrs'
{ $sel:maxResults:ListByoipCidrs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListByoipCidrs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listByoipCidrs_maxResults :: Lens.Lens' ListByoipCidrs (Prelude.Maybe Prelude.Natural)
listByoipCidrs_maxResults :: Lens' ListByoipCidrs (Maybe Natural)
listByoipCidrs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByoipCidrs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListByoipCidrs' :: ListByoipCidrs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListByoipCidrs
s@ListByoipCidrs' {} Maybe Natural
a -> ListByoipCidrs
s {$sel:maxResults:ListByoipCidrs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListByoipCidrs)
listByoipCidrs_nextToken :: Lens.Lens' ListByoipCidrs (Prelude.Maybe Prelude.Text)
listByoipCidrs_nextToken :: Lens' ListByoipCidrs (Maybe Text)
listByoipCidrs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByoipCidrs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListByoipCidrs' :: ListByoipCidrs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListByoipCidrs
s@ListByoipCidrs' {} Maybe Text
a -> ListByoipCidrs
s {$sel:nextToken:ListByoipCidrs' :: Maybe Text
nextToken = Maybe Text
a} :: ListByoipCidrs)
instance Core.AWSPager ListByoipCidrs where
page :: ListByoipCidrs
-> AWSResponse ListByoipCidrs -> Maybe ListByoipCidrs
page ListByoipCidrs
rq AWSResponse ListByoipCidrs
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListByoipCidrs
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListByoipCidrsResponse (Maybe Text)
listByoipCidrsResponse_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 ListByoipCidrs
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListByoipCidrsResponse (Maybe [ByoipCidr])
listByoipCidrsResponse_byoipCidrs
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.$ ListByoipCidrs
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListByoipCidrs (Maybe Text)
listByoipCidrs_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListByoipCidrs
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListByoipCidrsResponse (Maybe Text)
listByoipCidrsResponse_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 ListByoipCidrs where
type
AWSResponse ListByoipCidrs =
ListByoipCidrsResponse
request :: (Service -> Service) -> ListByoipCidrs -> Request ListByoipCidrs
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 ListByoipCidrs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListByoipCidrs)))
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 [ByoipCidr] -> Maybe Text -> Int -> ListByoipCidrsResponse
ListByoipCidrsResponse'
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
"ByoipCidrs" 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 ListByoipCidrs where
hashWithSalt :: Int -> ListByoipCidrs -> Int
hashWithSalt Int
_salt ListByoipCidrs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListByoipCidrs' :: ListByoipCidrs -> Maybe Text
$sel:maxResults:ListByoipCidrs' :: ListByoipCidrs -> 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 ListByoipCidrs where
rnf :: ListByoipCidrs -> ()
rnf ListByoipCidrs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListByoipCidrs' :: ListByoipCidrs -> Maybe Text
$sel:maxResults:ListByoipCidrs' :: ListByoipCidrs -> 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 ListByoipCidrs where
toHeaders :: ListByoipCidrs -> 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
"GlobalAccelerator_V20180706.ListByoipCidrs" ::
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 ListByoipCidrs where
toJSON :: ListByoipCidrs -> Value
toJSON ListByoipCidrs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListByoipCidrs' :: ListByoipCidrs -> Maybe Text
$sel:maxResults:ListByoipCidrs' :: ListByoipCidrs -> 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 ListByoipCidrs where
toPath :: ListByoipCidrs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListByoipCidrs where
toQuery :: ListByoipCidrs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListByoipCidrsResponse = ListByoipCidrsResponse'
{
ListByoipCidrsResponse -> Maybe [ByoipCidr]
byoipCidrs :: Prelude.Maybe [ByoipCidr],
ListByoipCidrsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListByoipCidrsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListByoipCidrsResponse -> ListByoipCidrsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListByoipCidrsResponse -> ListByoipCidrsResponse -> Bool
$c/= :: ListByoipCidrsResponse -> ListByoipCidrsResponse -> Bool
== :: ListByoipCidrsResponse -> ListByoipCidrsResponse -> Bool
$c== :: ListByoipCidrsResponse -> ListByoipCidrsResponse -> Bool
Prelude.Eq, ReadPrec [ListByoipCidrsResponse]
ReadPrec ListByoipCidrsResponse
Int -> ReadS ListByoipCidrsResponse
ReadS [ListByoipCidrsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListByoipCidrsResponse]
$creadListPrec :: ReadPrec [ListByoipCidrsResponse]
readPrec :: ReadPrec ListByoipCidrsResponse
$creadPrec :: ReadPrec ListByoipCidrsResponse
readList :: ReadS [ListByoipCidrsResponse]
$creadList :: ReadS [ListByoipCidrsResponse]
readsPrec :: Int -> ReadS ListByoipCidrsResponse
$creadsPrec :: Int -> ReadS ListByoipCidrsResponse
Prelude.Read, Int -> ListByoipCidrsResponse -> ShowS
[ListByoipCidrsResponse] -> ShowS
ListByoipCidrsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListByoipCidrsResponse] -> ShowS
$cshowList :: [ListByoipCidrsResponse] -> ShowS
show :: ListByoipCidrsResponse -> String
$cshow :: ListByoipCidrsResponse -> String
showsPrec :: Int -> ListByoipCidrsResponse -> ShowS
$cshowsPrec :: Int -> ListByoipCidrsResponse -> ShowS
Prelude.Show, forall x. Rep ListByoipCidrsResponse x -> ListByoipCidrsResponse
forall x. ListByoipCidrsResponse -> Rep ListByoipCidrsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListByoipCidrsResponse x -> ListByoipCidrsResponse
$cfrom :: forall x. ListByoipCidrsResponse -> Rep ListByoipCidrsResponse x
Prelude.Generic)
newListByoipCidrsResponse ::
Prelude.Int ->
ListByoipCidrsResponse
newListByoipCidrsResponse :: Int -> ListByoipCidrsResponse
newListByoipCidrsResponse Int
pHttpStatus_ =
ListByoipCidrsResponse'
{ $sel:byoipCidrs:ListByoipCidrsResponse' :: Maybe [ByoipCidr]
byoipCidrs =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListByoipCidrsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListByoipCidrsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listByoipCidrsResponse_byoipCidrs :: Lens.Lens' ListByoipCidrsResponse (Prelude.Maybe [ByoipCidr])
listByoipCidrsResponse_byoipCidrs :: Lens' ListByoipCidrsResponse (Maybe [ByoipCidr])
listByoipCidrsResponse_byoipCidrs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByoipCidrsResponse' {Maybe [ByoipCidr]
byoipCidrs :: Maybe [ByoipCidr]
$sel:byoipCidrs:ListByoipCidrsResponse' :: ListByoipCidrsResponse -> Maybe [ByoipCidr]
byoipCidrs} -> Maybe [ByoipCidr]
byoipCidrs) (\s :: ListByoipCidrsResponse
s@ListByoipCidrsResponse' {} Maybe [ByoipCidr]
a -> ListByoipCidrsResponse
s {$sel:byoipCidrs:ListByoipCidrsResponse' :: Maybe [ByoipCidr]
byoipCidrs = Maybe [ByoipCidr]
a} :: ListByoipCidrsResponse) 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
listByoipCidrsResponse_nextToken :: Lens.Lens' ListByoipCidrsResponse (Prelude.Maybe Prelude.Text)
listByoipCidrsResponse_nextToken :: Lens' ListByoipCidrsResponse (Maybe Text)
listByoipCidrsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByoipCidrsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListByoipCidrsResponse' :: ListByoipCidrsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListByoipCidrsResponse
s@ListByoipCidrsResponse' {} Maybe Text
a -> ListByoipCidrsResponse
s {$sel:nextToken:ListByoipCidrsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListByoipCidrsResponse)
listByoipCidrsResponse_httpStatus :: Lens.Lens' ListByoipCidrsResponse Prelude.Int
listByoipCidrsResponse_httpStatus :: Lens' ListByoipCidrsResponse Int
listByoipCidrsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListByoipCidrsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListByoipCidrsResponse' :: ListByoipCidrsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListByoipCidrsResponse
s@ListByoipCidrsResponse' {} Int
a -> ListByoipCidrsResponse
s {$sel:httpStatus:ListByoipCidrsResponse' :: Int
httpStatus = Int
a} :: ListByoipCidrsResponse)
instance Prelude.NFData ListByoipCidrsResponse where
rnf :: ListByoipCidrsResponse -> ()
rnf ListByoipCidrsResponse' {Int
Maybe [ByoipCidr]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
byoipCidrs :: Maybe [ByoipCidr]
$sel:httpStatus:ListByoipCidrsResponse' :: ListByoipCidrsResponse -> Int
$sel:nextToken:ListByoipCidrsResponse' :: ListByoipCidrsResponse -> Maybe Text
$sel:byoipCidrs:ListByoipCidrsResponse' :: ListByoipCidrsResponse -> Maybe [ByoipCidr]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ByoipCidr]
byoipCidrs
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