{-# 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.StorageGateway.DescribeCachediSCSIVolumes
(
DescribeCachediSCSIVolumes (..),
newDescribeCachediSCSIVolumes,
describeCachediSCSIVolumes_volumeARNs,
DescribeCachediSCSIVolumesResponse (..),
newDescribeCachediSCSIVolumesResponse,
describeCachediSCSIVolumesResponse_cachediSCSIVolumes,
describeCachediSCSIVolumesResponse_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.StorageGateway.Types
data DescribeCachediSCSIVolumes = DescribeCachediSCSIVolumes'
{
DescribeCachediSCSIVolumes -> [Text]
volumeARNs :: [Prelude.Text]
}
deriving (DescribeCachediSCSIVolumes -> DescribeCachediSCSIVolumes -> Bool
(DescribeCachediSCSIVolumes -> DescribeCachediSCSIVolumes -> Bool)
-> (DescribeCachediSCSIVolumes
-> DescribeCachediSCSIVolumes -> Bool)
-> Eq DescribeCachediSCSIVolumes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCachediSCSIVolumes -> DescribeCachediSCSIVolumes -> Bool
$c/= :: DescribeCachediSCSIVolumes -> DescribeCachediSCSIVolumes -> Bool
== :: DescribeCachediSCSIVolumes -> DescribeCachediSCSIVolumes -> Bool
$c== :: DescribeCachediSCSIVolumes -> DescribeCachediSCSIVolumes -> Bool
Prelude.Eq, ReadPrec [DescribeCachediSCSIVolumes]
ReadPrec DescribeCachediSCSIVolumes
Int -> ReadS DescribeCachediSCSIVolumes
ReadS [DescribeCachediSCSIVolumes]
(Int -> ReadS DescribeCachediSCSIVolumes)
-> ReadS [DescribeCachediSCSIVolumes]
-> ReadPrec DescribeCachediSCSIVolumes
-> ReadPrec [DescribeCachediSCSIVolumes]
-> Read DescribeCachediSCSIVolumes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCachediSCSIVolumes]
$creadListPrec :: ReadPrec [DescribeCachediSCSIVolumes]
readPrec :: ReadPrec DescribeCachediSCSIVolumes
$creadPrec :: ReadPrec DescribeCachediSCSIVolumes
readList :: ReadS [DescribeCachediSCSIVolumes]
$creadList :: ReadS [DescribeCachediSCSIVolumes]
readsPrec :: Int -> ReadS DescribeCachediSCSIVolumes
$creadsPrec :: Int -> ReadS DescribeCachediSCSIVolumes
Prelude.Read, Int -> DescribeCachediSCSIVolumes -> ShowS
[DescribeCachediSCSIVolumes] -> ShowS
DescribeCachediSCSIVolumes -> String
(Int -> DescribeCachediSCSIVolumes -> ShowS)
-> (DescribeCachediSCSIVolumes -> String)
-> ([DescribeCachediSCSIVolumes] -> ShowS)
-> Show DescribeCachediSCSIVolumes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCachediSCSIVolumes] -> ShowS
$cshowList :: [DescribeCachediSCSIVolumes] -> ShowS
show :: DescribeCachediSCSIVolumes -> String
$cshow :: DescribeCachediSCSIVolumes -> String
showsPrec :: Int -> DescribeCachediSCSIVolumes -> ShowS
$cshowsPrec :: Int -> DescribeCachediSCSIVolumes -> ShowS
Prelude.Show, (forall x.
DescribeCachediSCSIVolumes -> Rep DescribeCachediSCSIVolumes x)
-> (forall x.
Rep DescribeCachediSCSIVolumes x -> DescribeCachediSCSIVolumes)
-> Generic DescribeCachediSCSIVolumes
forall x.
Rep DescribeCachediSCSIVolumes x -> DescribeCachediSCSIVolumes
forall x.
DescribeCachediSCSIVolumes -> Rep DescribeCachediSCSIVolumes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCachediSCSIVolumes x -> DescribeCachediSCSIVolumes
$cfrom :: forall x.
DescribeCachediSCSIVolumes -> Rep DescribeCachediSCSIVolumes x
Prelude.Generic)
newDescribeCachediSCSIVolumes ::
DescribeCachediSCSIVolumes
newDescribeCachediSCSIVolumes :: DescribeCachediSCSIVolumes
newDescribeCachediSCSIVolumes =
DescribeCachediSCSIVolumes' :: [Text] -> DescribeCachediSCSIVolumes
DescribeCachediSCSIVolumes'
{ $sel:volumeARNs:DescribeCachediSCSIVolumes' :: [Text]
volumeARNs =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
describeCachediSCSIVolumes_volumeARNs :: Lens.Lens' DescribeCachediSCSIVolumes [Prelude.Text]
describeCachediSCSIVolumes_volumeARNs :: ([Text] -> f [Text])
-> DescribeCachediSCSIVolumes -> f DescribeCachediSCSIVolumes
describeCachediSCSIVolumes_volumeARNs = (DescribeCachediSCSIVolumes -> [Text])
-> (DescribeCachediSCSIVolumes
-> [Text] -> DescribeCachediSCSIVolumes)
-> Lens
DescribeCachediSCSIVolumes DescribeCachediSCSIVolumes [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCachediSCSIVolumes' {[Text]
volumeARNs :: [Text]
$sel:volumeARNs:DescribeCachediSCSIVolumes' :: DescribeCachediSCSIVolumes -> [Text]
volumeARNs} -> [Text]
volumeARNs) (\s :: DescribeCachediSCSIVolumes
s@DescribeCachediSCSIVolumes' {} [Text]
a -> DescribeCachediSCSIVolumes
s {$sel:volumeARNs:DescribeCachediSCSIVolumes' :: [Text]
volumeARNs = [Text]
a} :: DescribeCachediSCSIVolumes) (([Text] -> f [Text])
-> DescribeCachediSCSIVolumes -> f DescribeCachediSCSIVolumes)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeCachediSCSIVolumes
-> f DescribeCachediSCSIVolumes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DescribeCachediSCSIVolumes where
type
AWSResponse DescribeCachediSCSIVolumes =
DescribeCachediSCSIVolumesResponse
request :: DescribeCachediSCSIVolumes -> Request DescribeCachediSCSIVolumes
request = Service
-> DescribeCachediSCSIVolumes -> Request DescribeCachediSCSIVolumes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeCachediSCSIVolumes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCachediSCSIVolumes)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeCachediSCSIVolumes))
-> Logger
-> Service
-> Proxy DescribeCachediSCSIVolumes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeCachediSCSIVolumes)))
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 [CachediSCSIVolume]
-> Int -> DescribeCachediSCSIVolumesResponse
DescribeCachediSCSIVolumesResponse'
(Maybe [CachediSCSIVolume]
-> Int -> DescribeCachediSCSIVolumesResponse)
-> Either String (Maybe [CachediSCSIVolume])
-> Either String (Int -> DescribeCachediSCSIVolumesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [CachediSCSIVolume]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CachediSCSIVolumes"
Either String (Maybe (Maybe [CachediSCSIVolume]))
-> Maybe [CachediSCSIVolume]
-> Either String (Maybe [CachediSCSIVolume])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CachediSCSIVolume]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeCachediSCSIVolumesResponse)
-> Either String Int
-> Either String DescribeCachediSCSIVolumesResponse
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 DescribeCachediSCSIVolumes
instance Prelude.NFData DescribeCachediSCSIVolumes
instance Core.ToHeaders DescribeCachediSCSIVolumes where
toHeaders :: DescribeCachediSCSIVolumes -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeCachediSCSIVolumes -> 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
"StorageGateway_20130630.DescribeCachediSCSIVolumes" ::
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 DescribeCachediSCSIVolumes where
toJSON :: DescribeCachediSCSIVolumes -> Value
toJSON DescribeCachediSCSIVolumes' {[Text]
volumeARNs :: [Text]
$sel:volumeARNs:DescribeCachediSCSIVolumes' :: DescribeCachediSCSIVolumes -> [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"VolumeARNs" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
volumeARNs)]
)
instance Core.ToPath DescribeCachediSCSIVolumes where
toPath :: DescribeCachediSCSIVolumes -> ByteString
toPath = ByteString -> DescribeCachediSCSIVolumes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeCachediSCSIVolumes where
toQuery :: DescribeCachediSCSIVolumes -> QueryString
toQuery = QueryString -> DescribeCachediSCSIVolumes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeCachediSCSIVolumesResponse = DescribeCachediSCSIVolumesResponse'
{
DescribeCachediSCSIVolumesResponse -> Maybe [CachediSCSIVolume]
cachediSCSIVolumes :: Prelude.Maybe [CachediSCSIVolume],
DescribeCachediSCSIVolumesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool
(DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool)
-> (DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool)
-> Eq DescribeCachediSCSIVolumesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool
$c/= :: DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool
== :: DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool
$c== :: DescribeCachediSCSIVolumesResponse
-> DescribeCachediSCSIVolumesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCachediSCSIVolumesResponse]
ReadPrec DescribeCachediSCSIVolumesResponse
Int -> ReadS DescribeCachediSCSIVolumesResponse
ReadS [DescribeCachediSCSIVolumesResponse]
(Int -> ReadS DescribeCachediSCSIVolumesResponse)
-> ReadS [DescribeCachediSCSIVolumesResponse]
-> ReadPrec DescribeCachediSCSIVolumesResponse
-> ReadPrec [DescribeCachediSCSIVolumesResponse]
-> Read DescribeCachediSCSIVolumesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCachediSCSIVolumesResponse]
$creadListPrec :: ReadPrec [DescribeCachediSCSIVolumesResponse]
readPrec :: ReadPrec DescribeCachediSCSIVolumesResponse
$creadPrec :: ReadPrec DescribeCachediSCSIVolumesResponse
readList :: ReadS [DescribeCachediSCSIVolumesResponse]
$creadList :: ReadS [DescribeCachediSCSIVolumesResponse]
readsPrec :: Int -> ReadS DescribeCachediSCSIVolumesResponse
$creadsPrec :: Int -> ReadS DescribeCachediSCSIVolumesResponse
Prelude.Read, Int -> DescribeCachediSCSIVolumesResponse -> ShowS
[DescribeCachediSCSIVolumesResponse] -> ShowS
DescribeCachediSCSIVolumesResponse -> String
(Int -> DescribeCachediSCSIVolumesResponse -> ShowS)
-> (DescribeCachediSCSIVolumesResponse -> String)
-> ([DescribeCachediSCSIVolumesResponse] -> ShowS)
-> Show DescribeCachediSCSIVolumesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCachediSCSIVolumesResponse] -> ShowS
$cshowList :: [DescribeCachediSCSIVolumesResponse] -> ShowS
show :: DescribeCachediSCSIVolumesResponse -> String
$cshow :: DescribeCachediSCSIVolumesResponse -> String
showsPrec :: Int -> DescribeCachediSCSIVolumesResponse -> ShowS
$cshowsPrec :: Int -> DescribeCachediSCSIVolumesResponse -> ShowS
Prelude.Show, (forall x.
DescribeCachediSCSIVolumesResponse
-> Rep DescribeCachediSCSIVolumesResponse x)
-> (forall x.
Rep DescribeCachediSCSIVolumesResponse x
-> DescribeCachediSCSIVolumesResponse)
-> Generic DescribeCachediSCSIVolumesResponse
forall x.
Rep DescribeCachediSCSIVolumesResponse x
-> DescribeCachediSCSIVolumesResponse
forall x.
DescribeCachediSCSIVolumesResponse
-> Rep DescribeCachediSCSIVolumesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCachediSCSIVolumesResponse x
-> DescribeCachediSCSIVolumesResponse
$cfrom :: forall x.
DescribeCachediSCSIVolumesResponse
-> Rep DescribeCachediSCSIVolumesResponse x
Prelude.Generic)
newDescribeCachediSCSIVolumesResponse ::
Prelude.Int ->
DescribeCachediSCSIVolumesResponse
newDescribeCachediSCSIVolumesResponse :: Int -> DescribeCachediSCSIVolumesResponse
newDescribeCachediSCSIVolumesResponse Int
pHttpStatus_ =
DescribeCachediSCSIVolumesResponse' :: Maybe [CachediSCSIVolume]
-> Int -> DescribeCachediSCSIVolumesResponse
DescribeCachediSCSIVolumesResponse'
{ $sel:cachediSCSIVolumes:DescribeCachediSCSIVolumesResponse' :: Maybe [CachediSCSIVolume]
cachediSCSIVolumes =
Maybe [CachediSCSIVolume]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeCachediSCSIVolumesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeCachediSCSIVolumesResponse_cachediSCSIVolumes :: Lens.Lens' DescribeCachediSCSIVolumesResponse (Prelude.Maybe [CachediSCSIVolume])
describeCachediSCSIVolumesResponse_cachediSCSIVolumes :: (Maybe [CachediSCSIVolume] -> f (Maybe [CachediSCSIVolume]))
-> DescribeCachediSCSIVolumesResponse
-> f DescribeCachediSCSIVolumesResponse
describeCachediSCSIVolumesResponse_cachediSCSIVolumes = (DescribeCachediSCSIVolumesResponse -> Maybe [CachediSCSIVolume])
-> (DescribeCachediSCSIVolumesResponse
-> Maybe [CachediSCSIVolume] -> DescribeCachediSCSIVolumesResponse)
-> Lens
DescribeCachediSCSIVolumesResponse
DescribeCachediSCSIVolumesResponse
(Maybe [CachediSCSIVolume])
(Maybe [CachediSCSIVolume])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCachediSCSIVolumesResponse' {Maybe [CachediSCSIVolume]
cachediSCSIVolumes :: Maybe [CachediSCSIVolume]
$sel:cachediSCSIVolumes:DescribeCachediSCSIVolumesResponse' :: DescribeCachediSCSIVolumesResponse -> Maybe [CachediSCSIVolume]
cachediSCSIVolumes} -> Maybe [CachediSCSIVolume]
cachediSCSIVolumes) (\s :: DescribeCachediSCSIVolumesResponse
s@DescribeCachediSCSIVolumesResponse' {} Maybe [CachediSCSIVolume]
a -> DescribeCachediSCSIVolumesResponse
s {$sel:cachediSCSIVolumes:DescribeCachediSCSIVolumesResponse' :: Maybe [CachediSCSIVolume]
cachediSCSIVolumes = Maybe [CachediSCSIVolume]
a} :: DescribeCachediSCSIVolumesResponse) ((Maybe [CachediSCSIVolume] -> f (Maybe [CachediSCSIVolume]))
-> DescribeCachediSCSIVolumesResponse
-> f DescribeCachediSCSIVolumesResponse)
-> ((Maybe [CachediSCSIVolume] -> f (Maybe [CachediSCSIVolume]))
-> Maybe [CachediSCSIVolume] -> f (Maybe [CachediSCSIVolume]))
-> (Maybe [CachediSCSIVolume] -> f (Maybe [CachediSCSIVolume]))
-> DescribeCachediSCSIVolumesResponse
-> f DescribeCachediSCSIVolumesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CachediSCSIVolume]
[CachediSCSIVolume]
[CachediSCSIVolume]
[CachediSCSIVolume]
-> Iso
(Maybe [CachediSCSIVolume])
(Maybe [CachediSCSIVolume])
(Maybe [CachediSCSIVolume])
(Maybe [CachediSCSIVolume])
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
[CachediSCSIVolume]
[CachediSCSIVolume]
[CachediSCSIVolume]
[CachediSCSIVolume]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeCachediSCSIVolumesResponse_httpStatus :: Lens.Lens' DescribeCachediSCSIVolumesResponse Prelude.Int
describeCachediSCSIVolumesResponse_httpStatus :: (Int -> f Int)
-> DescribeCachediSCSIVolumesResponse
-> f DescribeCachediSCSIVolumesResponse
describeCachediSCSIVolumesResponse_httpStatus = (DescribeCachediSCSIVolumesResponse -> Int)
-> (DescribeCachediSCSIVolumesResponse
-> Int -> DescribeCachediSCSIVolumesResponse)
-> Lens
DescribeCachediSCSIVolumesResponse
DescribeCachediSCSIVolumesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCachediSCSIVolumesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCachediSCSIVolumesResponse' :: DescribeCachediSCSIVolumesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCachediSCSIVolumesResponse
s@DescribeCachediSCSIVolumesResponse' {} Int
a -> DescribeCachediSCSIVolumesResponse
s {$sel:httpStatus:DescribeCachediSCSIVolumesResponse' :: Int
httpStatus = Int
a} :: DescribeCachediSCSIVolumesResponse)
instance
Prelude.NFData
DescribeCachediSCSIVolumesResponse