{-# 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.MediaStoreData.DescribeObject
(
DescribeObject (..),
newDescribeObject,
describeObject_path,
DescribeObjectResponse (..),
newDescribeObjectResponse,
describeObjectResponse_eTag,
describeObjectResponse_contentLength,
describeObjectResponse_cacheControl,
describeObjectResponse_lastModified,
describeObjectResponse_contentType,
describeObjectResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaStoreData.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeObject = DescribeObject'
{
DescribeObject -> Text
path :: Prelude.Text
}
deriving (DescribeObject -> DescribeObject -> Bool
(DescribeObject -> DescribeObject -> Bool)
-> (DescribeObject -> DescribeObject -> Bool) -> Eq DescribeObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeObject -> DescribeObject -> Bool
$c/= :: DescribeObject -> DescribeObject -> Bool
== :: DescribeObject -> DescribeObject -> Bool
$c== :: DescribeObject -> DescribeObject -> Bool
Prelude.Eq, ReadPrec [DescribeObject]
ReadPrec DescribeObject
Int -> ReadS DescribeObject
ReadS [DescribeObject]
(Int -> ReadS DescribeObject)
-> ReadS [DescribeObject]
-> ReadPrec DescribeObject
-> ReadPrec [DescribeObject]
-> Read DescribeObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeObject]
$creadListPrec :: ReadPrec [DescribeObject]
readPrec :: ReadPrec DescribeObject
$creadPrec :: ReadPrec DescribeObject
readList :: ReadS [DescribeObject]
$creadList :: ReadS [DescribeObject]
readsPrec :: Int -> ReadS DescribeObject
$creadsPrec :: Int -> ReadS DescribeObject
Prelude.Read, Int -> DescribeObject -> ShowS
[DescribeObject] -> ShowS
DescribeObject -> String
(Int -> DescribeObject -> ShowS)
-> (DescribeObject -> String)
-> ([DescribeObject] -> ShowS)
-> Show DescribeObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeObject] -> ShowS
$cshowList :: [DescribeObject] -> ShowS
show :: DescribeObject -> String
$cshow :: DescribeObject -> String
showsPrec :: Int -> DescribeObject -> ShowS
$cshowsPrec :: Int -> DescribeObject -> ShowS
Prelude.Show, (forall x. DescribeObject -> Rep DescribeObject x)
-> (forall x. Rep DescribeObject x -> DescribeObject)
-> Generic DescribeObject
forall x. Rep DescribeObject x -> DescribeObject
forall x. DescribeObject -> Rep DescribeObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeObject x -> DescribeObject
$cfrom :: forall x. DescribeObject -> Rep DescribeObject x
Prelude.Generic)
newDescribeObject ::
Prelude.Text ->
DescribeObject
newDescribeObject :: Text -> DescribeObject
newDescribeObject Text
pPath_ =
DescribeObject' :: Text -> DescribeObject
DescribeObject' {$sel:path:DescribeObject' :: Text
path = Text
pPath_}
describeObject_path :: Lens.Lens' DescribeObject Prelude.Text
describeObject_path :: (Text -> f Text) -> DescribeObject -> f DescribeObject
describeObject_path = (DescribeObject -> Text)
-> (DescribeObject -> Text -> DescribeObject)
-> Lens DescribeObject DescribeObject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObject' {Text
path :: Text
$sel:path:DescribeObject' :: DescribeObject -> Text
path} -> Text
path) (\s :: DescribeObject
s@DescribeObject' {} Text
a -> DescribeObject
s {$sel:path:DescribeObject' :: Text
path = Text
a} :: DescribeObject)
instance Core.AWSRequest DescribeObject where
type
AWSResponse DescribeObject =
DescribeObjectResponse
request :: DescribeObject -> Request DescribeObject
request = Service -> DescribeObject -> Request DescribeObject
forall a. ToRequest a => Service -> a -> Request a
Request.head' Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeObject)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DescribeObject))
-> Logger
-> Service
-> Proxy DescribeObject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeObject)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeObjectResponse
DescribeObjectResponse'
(Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeObjectResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeObjectResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
Either
String
(Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeObjectResponse)
-> Either String (Maybe Natural)
-> Either
String
(Maybe Text
-> Maybe POSIX -> Maybe Text -> Int -> DescribeObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Natural)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Length")
Either
String
(Maybe Text
-> Maybe POSIX -> Maybe Text -> Int -> DescribeObjectResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe POSIX -> Maybe Text -> Int -> DescribeObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Cache-Control")
Either
String (Maybe POSIX -> Maybe Text -> Int -> DescribeObjectResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> DescribeObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe POSIX)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Last-Modified")
Either String (Maybe Text -> Int -> DescribeObjectResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeObjectResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
Either String (Int -> DescribeObjectResponse)
-> Either String Int -> Either String DescribeObjectResponse
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 DescribeObject
instance Prelude.NFData DescribeObject
instance Core.ToHeaders DescribeObject where
toHeaders :: DescribeObject -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeObject -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeObject where
toPath :: DescribeObject -> ByteString
toPath DescribeObject' {Text
path :: Text
$sel:path:DescribeObject' :: DescribeObject -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
path]
instance Core.ToQuery DescribeObject where
toQuery :: DescribeObject -> QueryString
toQuery = QueryString -> DescribeObject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeObjectResponse = DescribeObjectResponse'
{
DescribeObjectResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
DescribeObjectResponse -> Maybe Natural
contentLength :: Prelude.Maybe Prelude.Natural,
DescribeObjectResponse -> Maybe Text
cacheControl :: Prelude.Maybe Prelude.Text,
DescribeObjectResponse -> Maybe POSIX
lastModified :: Prelude.Maybe Core.POSIX,
DescribeObjectResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
DescribeObjectResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeObjectResponse -> DescribeObjectResponse -> Bool
(DescribeObjectResponse -> DescribeObjectResponse -> Bool)
-> (DescribeObjectResponse -> DescribeObjectResponse -> Bool)
-> Eq DescribeObjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeObjectResponse -> DescribeObjectResponse -> Bool
$c/= :: DescribeObjectResponse -> DescribeObjectResponse -> Bool
== :: DescribeObjectResponse -> DescribeObjectResponse -> Bool
$c== :: DescribeObjectResponse -> DescribeObjectResponse -> Bool
Prelude.Eq, ReadPrec [DescribeObjectResponse]
ReadPrec DescribeObjectResponse
Int -> ReadS DescribeObjectResponse
ReadS [DescribeObjectResponse]
(Int -> ReadS DescribeObjectResponse)
-> ReadS [DescribeObjectResponse]
-> ReadPrec DescribeObjectResponse
-> ReadPrec [DescribeObjectResponse]
-> Read DescribeObjectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeObjectResponse]
$creadListPrec :: ReadPrec [DescribeObjectResponse]
readPrec :: ReadPrec DescribeObjectResponse
$creadPrec :: ReadPrec DescribeObjectResponse
readList :: ReadS [DescribeObjectResponse]
$creadList :: ReadS [DescribeObjectResponse]
readsPrec :: Int -> ReadS DescribeObjectResponse
$creadsPrec :: Int -> ReadS DescribeObjectResponse
Prelude.Read, Int -> DescribeObjectResponse -> ShowS
[DescribeObjectResponse] -> ShowS
DescribeObjectResponse -> String
(Int -> DescribeObjectResponse -> ShowS)
-> (DescribeObjectResponse -> String)
-> ([DescribeObjectResponse] -> ShowS)
-> Show DescribeObjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeObjectResponse] -> ShowS
$cshowList :: [DescribeObjectResponse] -> ShowS
show :: DescribeObjectResponse -> String
$cshow :: DescribeObjectResponse -> String
showsPrec :: Int -> DescribeObjectResponse -> ShowS
$cshowsPrec :: Int -> DescribeObjectResponse -> ShowS
Prelude.Show, (forall x. DescribeObjectResponse -> Rep DescribeObjectResponse x)
-> (forall x.
Rep DescribeObjectResponse x -> DescribeObjectResponse)
-> Generic DescribeObjectResponse
forall x. Rep DescribeObjectResponse x -> DescribeObjectResponse
forall x. DescribeObjectResponse -> Rep DescribeObjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeObjectResponse x -> DescribeObjectResponse
$cfrom :: forall x. DescribeObjectResponse -> Rep DescribeObjectResponse x
Prelude.Generic)
newDescribeObjectResponse ::
Prelude.Int ->
DescribeObjectResponse
newDescribeObjectResponse :: Int -> DescribeObjectResponse
newDescribeObjectResponse Int
pHttpStatus_ =
DescribeObjectResponse' :: Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> DescribeObjectResponse
DescribeObjectResponse'
{ $sel:eTag:DescribeObjectResponse' :: Maybe Text
eTag = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contentLength:DescribeObjectResponse' :: Maybe Natural
contentLength = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:cacheControl:DescribeObjectResponse' :: Maybe Text
cacheControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastModified:DescribeObjectResponse' :: Maybe POSIX
lastModified = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:DescribeObjectResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeObjectResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeObjectResponse_eTag :: Lens.Lens' DescribeObjectResponse (Prelude.Maybe Prelude.Text)
describeObjectResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> DescribeObjectResponse -> f DescribeObjectResponse
describeObjectResponse_eTag = (DescribeObjectResponse -> Maybe Text)
-> (DescribeObjectResponse -> Maybe Text -> DescribeObjectResponse)
-> Lens
DescribeObjectResponse
DescribeObjectResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObjectResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:DescribeObjectResponse' :: DescribeObjectResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: DescribeObjectResponse
s@DescribeObjectResponse' {} Maybe Text
a -> DescribeObjectResponse
s {$sel:eTag:DescribeObjectResponse' :: Maybe Text
eTag = Maybe Text
a} :: DescribeObjectResponse)
describeObjectResponse_contentLength :: Lens.Lens' DescribeObjectResponse (Prelude.Maybe Prelude.Natural)
describeObjectResponse_contentLength :: (Maybe Natural -> f (Maybe Natural))
-> DescribeObjectResponse -> f DescribeObjectResponse
describeObjectResponse_contentLength = (DescribeObjectResponse -> Maybe Natural)
-> (DescribeObjectResponse
-> Maybe Natural -> DescribeObjectResponse)
-> Lens
DescribeObjectResponse
DescribeObjectResponse
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObjectResponse' {Maybe Natural
contentLength :: Maybe Natural
$sel:contentLength:DescribeObjectResponse' :: DescribeObjectResponse -> Maybe Natural
contentLength} -> Maybe Natural
contentLength) (\s :: DescribeObjectResponse
s@DescribeObjectResponse' {} Maybe Natural
a -> DescribeObjectResponse
s {$sel:contentLength:DescribeObjectResponse' :: Maybe Natural
contentLength = Maybe Natural
a} :: DescribeObjectResponse)
describeObjectResponse_cacheControl :: Lens.Lens' DescribeObjectResponse (Prelude.Maybe Prelude.Text)
describeObjectResponse_cacheControl :: (Maybe Text -> f (Maybe Text))
-> DescribeObjectResponse -> f DescribeObjectResponse
describeObjectResponse_cacheControl = (DescribeObjectResponse -> Maybe Text)
-> (DescribeObjectResponse -> Maybe Text -> DescribeObjectResponse)
-> Lens
DescribeObjectResponse
DescribeObjectResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObjectResponse' {Maybe Text
cacheControl :: Maybe Text
$sel:cacheControl:DescribeObjectResponse' :: DescribeObjectResponse -> Maybe Text
cacheControl} -> Maybe Text
cacheControl) (\s :: DescribeObjectResponse
s@DescribeObjectResponse' {} Maybe Text
a -> DescribeObjectResponse
s {$sel:cacheControl:DescribeObjectResponse' :: Maybe Text
cacheControl = Maybe Text
a} :: DescribeObjectResponse)
describeObjectResponse_lastModified :: Lens.Lens' DescribeObjectResponse (Prelude.Maybe Prelude.UTCTime)
describeObjectResponse_lastModified :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeObjectResponse -> f DescribeObjectResponse
describeObjectResponse_lastModified = (DescribeObjectResponse -> Maybe POSIX)
-> (DescribeObjectResponse
-> Maybe POSIX -> DescribeObjectResponse)
-> Lens
DescribeObjectResponse
DescribeObjectResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObjectResponse' {Maybe POSIX
lastModified :: Maybe POSIX
$sel:lastModified:DescribeObjectResponse' :: DescribeObjectResponse -> Maybe POSIX
lastModified} -> Maybe POSIX
lastModified) (\s :: DescribeObjectResponse
s@DescribeObjectResponse' {} Maybe POSIX
a -> DescribeObjectResponse
s {$sel:lastModified:DescribeObjectResponse' :: Maybe POSIX
lastModified = Maybe POSIX
a} :: DescribeObjectResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> DescribeObjectResponse -> f DescribeObjectResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeObjectResponse
-> f DescribeObjectResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
describeObjectResponse_contentType :: Lens.Lens' DescribeObjectResponse (Prelude.Maybe Prelude.Text)
describeObjectResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> DescribeObjectResponse -> f DescribeObjectResponse
describeObjectResponse_contentType = (DescribeObjectResponse -> Maybe Text)
-> (DescribeObjectResponse -> Maybe Text -> DescribeObjectResponse)
-> Lens
DescribeObjectResponse
DescribeObjectResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObjectResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:DescribeObjectResponse' :: DescribeObjectResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: DescribeObjectResponse
s@DescribeObjectResponse' {} Maybe Text
a -> DescribeObjectResponse
s {$sel:contentType:DescribeObjectResponse' :: Maybe Text
contentType = Maybe Text
a} :: DescribeObjectResponse)
describeObjectResponse_httpStatus :: Lens.Lens' DescribeObjectResponse Prelude.Int
describeObjectResponse_httpStatus :: (Int -> f Int)
-> DescribeObjectResponse -> f DescribeObjectResponse
describeObjectResponse_httpStatus = (DescribeObjectResponse -> Int)
-> (DescribeObjectResponse -> Int -> DescribeObjectResponse)
-> Lens DescribeObjectResponse DescribeObjectResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeObjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeObjectResponse' :: DescribeObjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeObjectResponse
s@DescribeObjectResponse' {} Int
a -> DescribeObjectResponse
s {$sel:httpStatus:DescribeObjectResponse' :: Int
httpStatus = Int
a} :: DescribeObjectResponse)
instance Prelude.NFData DescribeObjectResponse