{-# 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.DescribeStorediSCSIVolumes
(
DescribeStorediSCSIVolumes (..),
newDescribeStorediSCSIVolumes,
describeStorediSCSIVolumes_volumeARNs,
DescribeStorediSCSIVolumesResponse (..),
newDescribeStorediSCSIVolumesResponse,
describeStorediSCSIVolumesResponse_storediSCSIVolumes,
describeStorediSCSIVolumesResponse_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 DescribeStorediSCSIVolumes = DescribeStorediSCSIVolumes'
{
DescribeStorediSCSIVolumes -> [Text]
volumeARNs :: [Prelude.Text]
}
deriving (DescribeStorediSCSIVolumes -> DescribeStorediSCSIVolumes -> Bool
(DescribeStorediSCSIVolumes -> DescribeStorediSCSIVolumes -> Bool)
-> (DescribeStorediSCSIVolumes
-> DescribeStorediSCSIVolumes -> Bool)
-> Eq DescribeStorediSCSIVolumes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStorediSCSIVolumes -> DescribeStorediSCSIVolumes -> Bool
$c/= :: DescribeStorediSCSIVolumes -> DescribeStorediSCSIVolumes -> Bool
== :: DescribeStorediSCSIVolumes -> DescribeStorediSCSIVolumes -> Bool
$c== :: DescribeStorediSCSIVolumes -> DescribeStorediSCSIVolumes -> Bool
Prelude.Eq, ReadPrec [DescribeStorediSCSIVolumes]
ReadPrec DescribeStorediSCSIVolumes
Int -> ReadS DescribeStorediSCSIVolumes
ReadS [DescribeStorediSCSIVolumes]
(Int -> ReadS DescribeStorediSCSIVolumes)
-> ReadS [DescribeStorediSCSIVolumes]
-> ReadPrec DescribeStorediSCSIVolumes
-> ReadPrec [DescribeStorediSCSIVolumes]
-> Read DescribeStorediSCSIVolumes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStorediSCSIVolumes]
$creadListPrec :: ReadPrec [DescribeStorediSCSIVolumes]
readPrec :: ReadPrec DescribeStorediSCSIVolumes
$creadPrec :: ReadPrec DescribeStorediSCSIVolumes
readList :: ReadS [DescribeStorediSCSIVolumes]
$creadList :: ReadS [DescribeStorediSCSIVolumes]
readsPrec :: Int -> ReadS DescribeStorediSCSIVolumes
$creadsPrec :: Int -> ReadS DescribeStorediSCSIVolumes
Prelude.Read, Int -> DescribeStorediSCSIVolumes -> ShowS
[DescribeStorediSCSIVolumes] -> ShowS
DescribeStorediSCSIVolumes -> String
(Int -> DescribeStorediSCSIVolumes -> ShowS)
-> (DescribeStorediSCSIVolumes -> String)
-> ([DescribeStorediSCSIVolumes] -> ShowS)
-> Show DescribeStorediSCSIVolumes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStorediSCSIVolumes] -> ShowS
$cshowList :: [DescribeStorediSCSIVolumes] -> ShowS
show :: DescribeStorediSCSIVolumes -> String
$cshow :: DescribeStorediSCSIVolumes -> String
showsPrec :: Int -> DescribeStorediSCSIVolumes -> ShowS
$cshowsPrec :: Int -> DescribeStorediSCSIVolumes -> ShowS
Prelude.Show, (forall x.
DescribeStorediSCSIVolumes -> Rep DescribeStorediSCSIVolumes x)
-> (forall x.
Rep DescribeStorediSCSIVolumes x -> DescribeStorediSCSIVolumes)
-> Generic DescribeStorediSCSIVolumes
forall x.
Rep DescribeStorediSCSIVolumes x -> DescribeStorediSCSIVolumes
forall x.
DescribeStorediSCSIVolumes -> Rep DescribeStorediSCSIVolumes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStorediSCSIVolumes x -> DescribeStorediSCSIVolumes
$cfrom :: forall x.
DescribeStorediSCSIVolumes -> Rep DescribeStorediSCSIVolumes x
Prelude.Generic)
newDescribeStorediSCSIVolumes ::
DescribeStorediSCSIVolumes
newDescribeStorediSCSIVolumes :: DescribeStorediSCSIVolumes
newDescribeStorediSCSIVolumes =
DescribeStorediSCSIVolumes' :: [Text] -> DescribeStorediSCSIVolumes
DescribeStorediSCSIVolumes'
{ $sel:volumeARNs:DescribeStorediSCSIVolumes' :: [Text]
volumeARNs =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
describeStorediSCSIVolumes_volumeARNs :: Lens.Lens' DescribeStorediSCSIVolumes [Prelude.Text]
describeStorediSCSIVolumes_volumeARNs :: ([Text] -> f [Text])
-> DescribeStorediSCSIVolumes -> f DescribeStorediSCSIVolumes
describeStorediSCSIVolumes_volumeARNs = (DescribeStorediSCSIVolumes -> [Text])
-> (DescribeStorediSCSIVolumes
-> [Text] -> DescribeStorediSCSIVolumes)
-> Lens
DescribeStorediSCSIVolumes DescribeStorediSCSIVolumes [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStorediSCSIVolumes' {[Text]
volumeARNs :: [Text]
$sel:volumeARNs:DescribeStorediSCSIVolumes' :: DescribeStorediSCSIVolumes -> [Text]
volumeARNs} -> [Text]
volumeARNs) (\s :: DescribeStorediSCSIVolumes
s@DescribeStorediSCSIVolumes' {} [Text]
a -> DescribeStorediSCSIVolumes
s {$sel:volumeARNs:DescribeStorediSCSIVolumes' :: [Text]
volumeARNs = [Text]
a} :: DescribeStorediSCSIVolumes) (([Text] -> f [Text])
-> DescribeStorediSCSIVolumes -> f DescribeStorediSCSIVolumes)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeStorediSCSIVolumes
-> f DescribeStorediSCSIVolumes
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 DescribeStorediSCSIVolumes where
type
AWSResponse DescribeStorediSCSIVolumes =
DescribeStorediSCSIVolumesResponse
request :: DescribeStorediSCSIVolumes -> Request DescribeStorediSCSIVolumes
request = Service
-> DescribeStorediSCSIVolumes -> Request DescribeStorediSCSIVolumes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeStorediSCSIVolumes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeStorediSCSIVolumes)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeStorediSCSIVolumes))
-> Logger
-> Service
-> Proxy DescribeStorediSCSIVolumes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeStorediSCSIVolumes)))
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 [StorediSCSIVolume]
-> Int -> DescribeStorediSCSIVolumesResponse
DescribeStorediSCSIVolumesResponse'
(Maybe [StorediSCSIVolume]
-> Int -> DescribeStorediSCSIVolumesResponse)
-> Either String (Maybe [StorediSCSIVolume])
-> Either String (Int -> DescribeStorediSCSIVolumesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [StorediSCSIVolume]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"StorediSCSIVolumes"
Either String (Maybe (Maybe [StorediSCSIVolume]))
-> Maybe [StorediSCSIVolume]
-> Either String (Maybe [StorediSCSIVolume])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [StorediSCSIVolume]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeStorediSCSIVolumesResponse)
-> Either String Int
-> Either String DescribeStorediSCSIVolumesResponse
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 DescribeStorediSCSIVolumes
instance Prelude.NFData DescribeStorediSCSIVolumes
instance Core.ToHeaders DescribeStorediSCSIVolumes where
toHeaders :: DescribeStorediSCSIVolumes -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeStorediSCSIVolumes -> 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.DescribeStorediSCSIVolumes" ::
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 DescribeStorediSCSIVolumes where
toJSON :: DescribeStorediSCSIVolumes -> Value
toJSON DescribeStorediSCSIVolumes' {[Text]
volumeARNs :: [Text]
$sel:volumeARNs:DescribeStorediSCSIVolumes' :: DescribeStorediSCSIVolumes -> [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 DescribeStorediSCSIVolumes where
toPath :: DescribeStorediSCSIVolumes -> ByteString
toPath = ByteString -> DescribeStorediSCSIVolumes -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeStorediSCSIVolumes where
toQuery :: DescribeStorediSCSIVolumes -> QueryString
toQuery = QueryString -> DescribeStorediSCSIVolumes -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeStorediSCSIVolumesResponse = DescribeStorediSCSIVolumesResponse'
{
DescribeStorediSCSIVolumesResponse -> Maybe [StorediSCSIVolume]
storediSCSIVolumes :: Prelude.Maybe [StorediSCSIVolume],
DescribeStorediSCSIVolumesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool
(DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool)
-> (DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool)
-> Eq DescribeStorediSCSIVolumesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool
$c/= :: DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool
== :: DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool
$c== :: DescribeStorediSCSIVolumesResponse
-> DescribeStorediSCSIVolumesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeStorediSCSIVolumesResponse]
ReadPrec DescribeStorediSCSIVolumesResponse
Int -> ReadS DescribeStorediSCSIVolumesResponse
ReadS [DescribeStorediSCSIVolumesResponse]
(Int -> ReadS DescribeStorediSCSIVolumesResponse)
-> ReadS [DescribeStorediSCSIVolumesResponse]
-> ReadPrec DescribeStorediSCSIVolumesResponse
-> ReadPrec [DescribeStorediSCSIVolumesResponse]
-> Read DescribeStorediSCSIVolumesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeStorediSCSIVolumesResponse]
$creadListPrec :: ReadPrec [DescribeStorediSCSIVolumesResponse]
readPrec :: ReadPrec DescribeStorediSCSIVolumesResponse
$creadPrec :: ReadPrec DescribeStorediSCSIVolumesResponse
readList :: ReadS [DescribeStorediSCSIVolumesResponse]
$creadList :: ReadS [DescribeStorediSCSIVolumesResponse]
readsPrec :: Int -> ReadS DescribeStorediSCSIVolumesResponse
$creadsPrec :: Int -> ReadS DescribeStorediSCSIVolumesResponse
Prelude.Read, Int -> DescribeStorediSCSIVolumesResponse -> ShowS
[DescribeStorediSCSIVolumesResponse] -> ShowS
DescribeStorediSCSIVolumesResponse -> String
(Int -> DescribeStorediSCSIVolumesResponse -> ShowS)
-> (DescribeStorediSCSIVolumesResponse -> String)
-> ([DescribeStorediSCSIVolumesResponse] -> ShowS)
-> Show DescribeStorediSCSIVolumesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeStorediSCSIVolumesResponse] -> ShowS
$cshowList :: [DescribeStorediSCSIVolumesResponse] -> ShowS
show :: DescribeStorediSCSIVolumesResponse -> String
$cshow :: DescribeStorediSCSIVolumesResponse -> String
showsPrec :: Int -> DescribeStorediSCSIVolumesResponse -> ShowS
$cshowsPrec :: Int -> DescribeStorediSCSIVolumesResponse -> ShowS
Prelude.Show, (forall x.
DescribeStorediSCSIVolumesResponse
-> Rep DescribeStorediSCSIVolumesResponse x)
-> (forall x.
Rep DescribeStorediSCSIVolumesResponse x
-> DescribeStorediSCSIVolumesResponse)
-> Generic DescribeStorediSCSIVolumesResponse
forall x.
Rep DescribeStorediSCSIVolumesResponse x
-> DescribeStorediSCSIVolumesResponse
forall x.
DescribeStorediSCSIVolumesResponse
-> Rep DescribeStorediSCSIVolumesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeStorediSCSIVolumesResponse x
-> DescribeStorediSCSIVolumesResponse
$cfrom :: forall x.
DescribeStorediSCSIVolumesResponse
-> Rep DescribeStorediSCSIVolumesResponse x
Prelude.Generic)
newDescribeStorediSCSIVolumesResponse ::
Prelude.Int ->
DescribeStorediSCSIVolumesResponse
newDescribeStorediSCSIVolumesResponse :: Int -> DescribeStorediSCSIVolumesResponse
newDescribeStorediSCSIVolumesResponse Int
pHttpStatus_ =
DescribeStorediSCSIVolumesResponse' :: Maybe [StorediSCSIVolume]
-> Int -> DescribeStorediSCSIVolumesResponse
DescribeStorediSCSIVolumesResponse'
{ $sel:storediSCSIVolumes:DescribeStorediSCSIVolumesResponse' :: Maybe [StorediSCSIVolume]
storediSCSIVolumes =
Maybe [StorediSCSIVolume]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeStorediSCSIVolumesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeStorediSCSIVolumesResponse_storediSCSIVolumes :: Lens.Lens' DescribeStorediSCSIVolumesResponse (Prelude.Maybe [StorediSCSIVolume])
describeStorediSCSIVolumesResponse_storediSCSIVolumes :: (Maybe [StorediSCSIVolume] -> f (Maybe [StorediSCSIVolume]))
-> DescribeStorediSCSIVolumesResponse
-> f DescribeStorediSCSIVolumesResponse
describeStorediSCSIVolumesResponse_storediSCSIVolumes = (DescribeStorediSCSIVolumesResponse -> Maybe [StorediSCSIVolume])
-> (DescribeStorediSCSIVolumesResponse
-> Maybe [StorediSCSIVolume] -> DescribeStorediSCSIVolumesResponse)
-> Lens
DescribeStorediSCSIVolumesResponse
DescribeStorediSCSIVolumesResponse
(Maybe [StorediSCSIVolume])
(Maybe [StorediSCSIVolume])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStorediSCSIVolumesResponse' {Maybe [StorediSCSIVolume]
storediSCSIVolumes :: Maybe [StorediSCSIVolume]
$sel:storediSCSIVolumes:DescribeStorediSCSIVolumesResponse' :: DescribeStorediSCSIVolumesResponse -> Maybe [StorediSCSIVolume]
storediSCSIVolumes} -> Maybe [StorediSCSIVolume]
storediSCSIVolumes) (\s :: DescribeStorediSCSIVolumesResponse
s@DescribeStorediSCSIVolumesResponse' {} Maybe [StorediSCSIVolume]
a -> DescribeStorediSCSIVolumesResponse
s {$sel:storediSCSIVolumes:DescribeStorediSCSIVolumesResponse' :: Maybe [StorediSCSIVolume]
storediSCSIVolumes = Maybe [StorediSCSIVolume]
a} :: DescribeStorediSCSIVolumesResponse) ((Maybe [StorediSCSIVolume] -> f (Maybe [StorediSCSIVolume]))
-> DescribeStorediSCSIVolumesResponse
-> f DescribeStorediSCSIVolumesResponse)
-> ((Maybe [StorediSCSIVolume] -> f (Maybe [StorediSCSIVolume]))
-> Maybe [StorediSCSIVolume] -> f (Maybe [StorediSCSIVolume]))
-> (Maybe [StorediSCSIVolume] -> f (Maybe [StorediSCSIVolume]))
-> DescribeStorediSCSIVolumesResponse
-> f DescribeStorediSCSIVolumesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[StorediSCSIVolume]
[StorediSCSIVolume]
[StorediSCSIVolume]
[StorediSCSIVolume]
-> Iso
(Maybe [StorediSCSIVolume])
(Maybe [StorediSCSIVolume])
(Maybe [StorediSCSIVolume])
(Maybe [StorediSCSIVolume])
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
[StorediSCSIVolume]
[StorediSCSIVolume]
[StorediSCSIVolume]
[StorediSCSIVolume]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeStorediSCSIVolumesResponse_httpStatus :: Lens.Lens' DescribeStorediSCSIVolumesResponse Prelude.Int
describeStorediSCSIVolumesResponse_httpStatus :: (Int -> f Int)
-> DescribeStorediSCSIVolumesResponse
-> f DescribeStorediSCSIVolumesResponse
describeStorediSCSIVolumesResponse_httpStatus = (DescribeStorediSCSIVolumesResponse -> Int)
-> (DescribeStorediSCSIVolumesResponse
-> Int -> DescribeStorediSCSIVolumesResponse)
-> Lens
DescribeStorediSCSIVolumesResponse
DescribeStorediSCSIVolumesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeStorediSCSIVolumesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeStorediSCSIVolumesResponse' :: DescribeStorediSCSIVolumesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeStorediSCSIVolumesResponse
s@DescribeStorediSCSIVolumesResponse' {} Int
a -> DescribeStorediSCSIVolumesResponse
s {$sel:httpStatus:DescribeStorediSCSIVolumesResponse' :: Int
httpStatus = Int
a} :: DescribeStorediSCSIVolumesResponse)
instance
Prelude.NFData
DescribeStorediSCSIVolumesResponse