{-# 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.DataSync.DescribeLocationS3
(
DescribeLocationS3 (..),
newDescribeLocationS3,
describeLocationS3_locationArn,
DescribeLocationS3Response (..),
newDescribeLocationS3Response,
describeLocationS3Response_agentArns,
describeLocationS3Response_creationTime,
describeLocationS3Response_locationArn,
describeLocationS3Response_locationUri,
describeLocationS3Response_s3Config,
describeLocationS3Response_s3StorageClass,
describeLocationS3Response_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataSync.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeLocationS3 = DescribeLocationS3'
{
DescribeLocationS3 -> Text
locationArn :: Prelude.Text
}
deriving (DescribeLocationS3 -> DescribeLocationS3 -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLocationS3 -> DescribeLocationS3 -> Bool
$c/= :: DescribeLocationS3 -> DescribeLocationS3 -> Bool
== :: DescribeLocationS3 -> DescribeLocationS3 -> Bool
$c== :: DescribeLocationS3 -> DescribeLocationS3 -> Bool
Prelude.Eq, ReadPrec [DescribeLocationS3]
ReadPrec DescribeLocationS3
Int -> ReadS DescribeLocationS3
ReadS [DescribeLocationS3]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLocationS3]
$creadListPrec :: ReadPrec [DescribeLocationS3]
readPrec :: ReadPrec DescribeLocationS3
$creadPrec :: ReadPrec DescribeLocationS3
readList :: ReadS [DescribeLocationS3]
$creadList :: ReadS [DescribeLocationS3]
readsPrec :: Int -> ReadS DescribeLocationS3
$creadsPrec :: Int -> ReadS DescribeLocationS3
Prelude.Read, Int -> DescribeLocationS3 -> ShowS
[DescribeLocationS3] -> ShowS
DescribeLocationS3 -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLocationS3] -> ShowS
$cshowList :: [DescribeLocationS3] -> ShowS
show :: DescribeLocationS3 -> String
$cshow :: DescribeLocationS3 -> String
showsPrec :: Int -> DescribeLocationS3 -> ShowS
$cshowsPrec :: Int -> DescribeLocationS3 -> ShowS
Prelude.Show, forall x. Rep DescribeLocationS3 x -> DescribeLocationS3
forall x. DescribeLocationS3 -> Rep DescribeLocationS3 x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeLocationS3 x -> DescribeLocationS3
$cfrom :: forall x. DescribeLocationS3 -> Rep DescribeLocationS3 x
Prelude.Generic)
newDescribeLocationS3 ::
Prelude.Text ->
DescribeLocationS3
newDescribeLocationS3 :: Text -> DescribeLocationS3
newDescribeLocationS3 Text
pLocationArn_ =
DescribeLocationS3' {$sel:locationArn:DescribeLocationS3' :: Text
locationArn = Text
pLocationArn_}
describeLocationS3_locationArn :: Lens.Lens' DescribeLocationS3 Prelude.Text
describeLocationS3_locationArn :: Lens' DescribeLocationS3 Text
describeLocationS3_locationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3' {Text
locationArn :: Text
$sel:locationArn:DescribeLocationS3' :: DescribeLocationS3 -> Text
locationArn} -> Text
locationArn) (\s :: DescribeLocationS3
s@DescribeLocationS3' {} Text
a -> DescribeLocationS3
s {$sel:locationArn:DescribeLocationS3' :: Text
locationArn = Text
a} :: DescribeLocationS3)
instance Core.AWSRequest DescribeLocationS3 where
type
AWSResponse DescribeLocationS3 =
DescribeLocationS3Response
request :: (Service -> Service)
-> DescribeLocationS3 -> Request DescribeLocationS3
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 DescribeLocationS3
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeLocationS3)))
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 (NonEmpty Text)
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe S3Config
-> Maybe S3StorageClass
-> Int
-> DescribeLocationS3Response
DescribeLocationS3Response'
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
"AgentArns")
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
"CreationTime")
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
"LocationArn")
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
"LocationUri")
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
"S3Config")
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
"S3StorageClass")
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 DescribeLocationS3 where
hashWithSalt :: Int -> DescribeLocationS3 -> Int
hashWithSalt Int
_salt DescribeLocationS3' {Text
locationArn :: Text
$sel:locationArn:DescribeLocationS3' :: DescribeLocationS3 -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
locationArn
instance Prelude.NFData DescribeLocationS3 where
rnf :: DescribeLocationS3 -> ()
rnf DescribeLocationS3' {Text
locationArn :: Text
$sel:locationArn:DescribeLocationS3' :: DescribeLocationS3 -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
locationArn
instance Data.ToHeaders DescribeLocationS3 where
toHeaders :: DescribeLocationS3 -> 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
"FmrsService.DescribeLocationS3" ::
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 DescribeLocationS3 where
toJSON :: DescribeLocationS3 -> Value
toJSON DescribeLocationS3' {Text
locationArn :: Text
$sel:locationArn:DescribeLocationS3' :: DescribeLocationS3 -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"LocationArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
locationArn)]
)
instance Data.ToPath DescribeLocationS3 where
toPath :: DescribeLocationS3 -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DescribeLocationS3 where
toQuery :: DescribeLocationS3 -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeLocationS3Response = DescribeLocationS3Response'
{
DescribeLocationS3Response -> Maybe (NonEmpty Text)
agentArns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
DescribeLocationS3Response -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
DescribeLocationS3Response -> Maybe Text
locationArn :: Prelude.Maybe Prelude.Text,
DescribeLocationS3Response -> Maybe Text
locationUri :: Prelude.Maybe Prelude.Text,
DescribeLocationS3Response -> Maybe S3Config
s3Config :: Prelude.Maybe S3Config,
DescribeLocationS3Response -> Maybe S3StorageClass
s3StorageClass :: Prelude.Maybe S3StorageClass,
DescribeLocationS3Response -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeLocationS3Response -> DescribeLocationS3Response -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLocationS3Response -> DescribeLocationS3Response -> Bool
$c/= :: DescribeLocationS3Response -> DescribeLocationS3Response -> Bool
== :: DescribeLocationS3Response -> DescribeLocationS3Response -> Bool
$c== :: DescribeLocationS3Response -> DescribeLocationS3Response -> Bool
Prelude.Eq, ReadPrec [DescribeLocationS3Response]
ReadPrec DescribeLocationS3Response
Int -> ReadS DescribeLocationS3Response
ReadS [DescribeLocationS3Response]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLocationS3Response]
$creadListPrec :: ReadPrec [DescribeLocationS3Response]
readPrec :: ReadPrec DescribeLocationS3Response
$creadPrec :: ReadPrec DescribeLocationS3Response
readList :: ReadS [DescribeLocationS3Response]
$creadList :: ReadS [DescribeLocationS3Response]
readsPrec :: Int -> ReadS DescribeLocationS3Response
$creadsPrec :: Int -> ReadS DescribeLocationS3Response
Prelude.Read, Int -> DescribeLocationS3Response -> ShowS
[DescribeLocationS3Response] -> ShowS
DescribeLocationS3Response -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLocationS3Response] -> ShowS
$cshowList :: [DescribeLocationS3Response] -> ShowS
show :: DescribeLocationS3Response -> String
$cshow :: DescribeLocationS3Response -> String
showsPrec :: Int -> DescribeLocationS3Response -> ShowS
$cshowsPrec :: Int -> DescribeLocationS3Response -> ShowS
Prelude.Show, forall x.
Rep DescribeLocationS3Response x -> DescribeLocationS3Response
forall x.
DescribeLocationS3Response -> Rep DescribeLocationS3Response x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLocationS3Response x -> DescribeLocationS3Response
$cfrom :: forall x.
DescribeLocationS3Response -> Rep DescribeLocationS3Response x
Prelude.Generic)
newDescribeLocationS3Response ::
Prelude.Int ->
DescribeLocationS3Response
newDescribeLocationS3Response :: Int -> DescribeLocationS3Response
newDescribeLocationS3Response Int
pHttpStatus_ =
DescribeLocationS3Response'
{ $sel:agentArns:DescribeLocationS3Response' :: Maybe (NonEmpty Text)
agentArns =
forall a. Maybe a
Prelude.Nothing,
$sel:creationTime:DescribeLocationS3Response' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:locationArn:DescribeLocationS3Response' :: Maybe Text
locationArn = forall a. Maybe a
Prelude.Nothing,
$sel:locationUri:DescribeLocationS3Response' :: Maybe Text
locationUri = forall a. Maybe a
Prelude.Nothing,
$sel:s3Config:DescribeLocationS3Response' :: Maybe S3Config
s3Config = forall a. Maybe a
Prelude.Nothing,
$sel:s3StorageClass:DescribeLocationS3Response' :: Maybe S3StorageClass
s3StorageClass = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeLocationS3Response' :: Int
httpStatus = Int
pHttpStatus_
}
describeLocationS3Response_agentArns :: Lens.Lens' DescribeLocationS3Response (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
describeLocationS3Response_agentArns :: Lens' DescribeLocationS3Response (Maybe (NonEmpty Text))
describeLocationS3Response_agentArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Maybe (NonEmpty Text)
agentArns :: Maybe (NonEmpty Text)
$sel:agentArns:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe (NonEmpty Text)
agentArns} -> Maybe (NonEmpty Text)
agentArns) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Maybe (NonEmpty Text)
a -> DescribeLocationS3Response
s {$sel:agentArns:DescribeLocationS3Response' :: Maybe (NonEmpty Text)
agentArns = Maybe (NonEmpty Text)
a} :: DescribeLocationS3Response) 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
describeLocationS3Response_creationTime :: Lens.Lens' DescribeLocationS3Response (Prelude.Maybe Prelude.UTCTime)
describeLocationS3Response_creationTime :: Lens' DescribeLocationS3Response (Maybe UTCTime)
describeLocationS3Response_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Maybe POSIX
a -> DescribeLocationS3Response
s {$sel:creationTime:DescribeLocationS3Response' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: DescribeLocationS3Response) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
describeLocationS3Response_locationArn :: Lens.Lens' DescribeLocationS3Response (Prelude.Maybe Prelude.Text)
describeLocationS3Response_locationArn :: Lens' DescribeLocationS3Response (Maybe Text)
describeLocationS3Response_locationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Maybe Text
locationArn :: Maybe Text
$sel:locationArn:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe Text
locationArn} -> Maybe Text
locationArn) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Maybe Text
a -> DescribeLocationS3Response
s {$sel:locationArn:DescribeLocationS3Response' :: Maybe Text
locationArn = Maybe Text
a} :: DescribeLocationS3Response)
describeLocationS3Response_locationUri :: Lens.Lens' DescribeLocationS3Response (Prelude.Maybe Prelude.Text)
describeLocationS3Response_locationUri :: Lens' DescribeLocationS3Response (Maybe Text)
describeLocationS3Response_locationUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Maybe Text
locationUri :: Maybe Text
$sel:locationUri:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe Text
locationUri} -> Maybe Text
locationUri) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Maybe Text
a -> DescribeLocationS3Response
s {$sel:locationUri:DescribeLocationS3Response' :: Maybe Text
locationUri = Maybe Text
a} :: DescribeLocationS3Response)
describeLocationS3Response_s3Config :: Lens.Lens' DescribeLocationS3Response (Prelude.Maybe S3Config)
describeLocationS3Response_s3Config :: Lens' DescribeLocationS3Response (Maybe S3Config)
describeLocationS3Response_s3Config = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Maybe S3Config
s3Config :: Maybe S3Config
$sel:s3Config:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe S3Config
s3Config} -> Maybe S3Config
s3Config) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Maybe S3Config
a -> DescribeLocationS3Response
s {$sel:s3Config:DescribeLocationS3Response' :: Maybe S3Config
s3Config = Maybe S3Config
a} :: DescribeLocationS3Response)
describeLocationS3Response_s3StorageClass :: Lens.Lens' DescribeLocationS3Response (Prelude.Maybe S3StorageClass)
describeLocationS3Response_s3StorageClass :: Lens' DescribeLocationS3Response (Maybe S3StorageClass)
describeLocationS3Response_s3StorageClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Maybe S3StorageClass
s3StorageClass :: Maybe S3StorageClass
$sel:s3StorageClass:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe S3StorageClass
s3StorageClass} -> Maybe S3StorageClass
s3StorageClass) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Maybe S3StorageClass
a -> DescribeLocationS3Response
s {$sel:s3StorageClass:DescribeLocationS3Response' :: Maybe S3StorageClass
s3StorageClass = Maybe S3StorageClass
a} :: DescribeLocationS3Response)
describeLocationS3Response_httpStatus :: Lens.Lens' DescribeLocationS3Response Prelude.Int
describeLocationS3Response_httpStatus :: Lens' DescribeLocationS3Response Int
describeLocationS3Response_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLocationS3Response' {Int
httpStatus :: Int
$sel:httpStatus:DescribeLocationS3Response' :: DescribeLocationS3Response -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeLocationS3Response
s@DescribeLocationS3Response' {} Int
a -> DescribeLocationS3Response
s {$sel:httpStatus:DescribeLocationS3Response' :: Int
httpStatus = Int
a} :: DescribeLocationS3Response)
instance Prelude.NFData DescribeLocationS3Response where
rnf :: DescribeLocationS3Response -> ()
rnf DescribeLocationS3Response' {Int
Maybe (NonEmpty Text)
Maybe Text
Maybe POSIX
Maybe S3Config
Maybe S3StorageClass
httpStatus :: Int
s3StorageClass :: Maybe S3StorageClass
s3Config :: Maybe S3Config
locationUri :: Maybe Text
locationArn :: Maybe Text
creationTime :: Maybe POSIX
agentArns :: Maybe (NonEmpty Text)
$sel:httpStatus:DescribeLocationS3Response' :: DescribeLocationS3Response -> Int
$sel:s3StorageClass:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe S3StorageClass
$sel:s3Config:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe S3Config
$sel:locationUri:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe Text
$sel:locationArn:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe Text
$sel:creationTime:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe POSIX
$sel:agentArns:DescribeLocationS3Response' :: DescribeLocationS3Response -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
agentArns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locationArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locationUri
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Config
s3Config
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3StorageClass
s3StorageClass
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus