{-# 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.Lightsail.GetDistributionLatestCacheReset
(
GetDistributionLatestCacheReset (..),
newGetDistributionLatestCacheReset,
getDistributionLatestCacheReset_distributionName,
GetDistributionLatestCacheResetResponse (..),
newGetDistributionLatestCacheResetResponse,
getDistributionLatestCacheResetResponse_status,
getDistributionLatestCacheResetResponse_createTime,
getDistributionLatestCacheResetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetDistributionLatestCacheReset = GetDistributionLatestCacheReset'
{
GetDistributionLatestCacheReset -> Maybe Text
distributionName :: Prelude.Maybe Prelude.Text
}
deriving (GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool
(GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool)
-> (GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool)
-> Eq GetDistributionLatestCacheReset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool
$c/= :: GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool
== :: GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool
$c== :: GetDistributionLatestCacheReset
-> GetDistributionLatestCacheReset -> Bool
Prelude.Eq, ReadPrec [GetDistributionLatestCacheReset]
ReadPrec GetDistributionLatestCacheReset
Int -> ReadS GetDistributionLatestCacheReset
ReadS [GetDistributionLatestCacheReset]
(Int -> ReadS GetDistributionLatestCacheReset)
-> ReadS [GetDistributionLatestCacheReset]
-> ReadPrec GetDistributionLatestCacheReset
-> ReadPrec [GetDistributionLatestCacheReset]
-> Read GetDistributionLatestCacheReset
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDistributionLatestCacheReset]
$creadListPrec :: ReadPrec [GetDistributionLatestCacheReset]
readPrec :: ReadPrec GetDistributionLatestCacheReset
$creadPrec :: ReadPrec GetDistributionLatestCacheReset
readList :: ReadS [GetDistributionLatestCacheReset]
$creadList :: ReadS [GetDistributionLatestCacheReset]
readsPrec :: Int -> ReadS GetDistributionLatestCacheReset
$creadsPrec :: Int -> ReadS GetDistributionLatestCacheReset
Prelude.Read, Int -> GetDistributionLatestCacheReset -> ShowS
[GetDistributionLatestCacheReset] -> ShowS
GetDistributionLatestCacheReset -> String
(Int -> GetDistributionLatestCacheReset -> ShowS)
-> (GetDistributionLatestCacheReset -> String)
-> ([GetDistributionLatestCacheReset] -> ShowS)
-> Show GetDistributionLatestCacheReset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDistributionLatestCacheReset] -> ShowS
$cshowList :: [GetDistributionLatestCacheReset] -> ShowS
show :: GetDistributionLatestCacheReset -> String
$cshow :: GetDistributionLatestCacheReset -> String
showsPrec :: Int -> GetDistributionLatestCacheReset -> ShowS
$cshowsPrec :: Int -> GetDistributionLatestCacheReset -> ShowS
Prelude.Show, (forall x.
GetDistributionLatestCacheReset
-> Rep GetDistributionLatestCacheReset x)
-> (forall x.
Rep GetDistributionLatestCacheReset x
-> GetDistributionLatestCacheReset)
-> Generic GetDistributionLatestCacheReset
forall x.
Rep GetDistributionLatestCacheReset x
-> GetDistributionLatestCacheReset
forall x.
GetDistributionLatestCacheReset
-> Rep GetDistributionLatestCacheReset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDistributionLatestCacheReset x
-> GetDistributionLatestCacheReset
$cfrom :: forall x.
GetDistributionLatestCacheReset
-> Rep GetDistributionLatestCacheReset x
Prelude.Generic)
newGetDistributionLatestCacheReset ::
GetDistributionLatestCacheReset
newGetDistributionLatestCacheReset :: GetDistributionLatestCacheReset
newGetDistributionLatestCacheReset =
GetDistributionLatestCacheReset' :: Maybe Text -> GetDistributionLatestCacheReset
GetDistributionLatestCacheReset'
{ $sel:distributionName:GetDistributionLatestCacheReset' :: Maybe Text
distributionName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
getDistributionLatestCacheReset_distributionName :: Lens.Lens' GetDistributionLatestCacheReset (Prelude.Maybe Prelude.Text)
getDistributionLatestCacheReset_distributionName :: (Maybe Text -> f (Maybe Text))
-> GetDistributionLatestCacheReset
-> f GetDistributionLatestCacheReset
getDistributionLatestCacheReset_distributionName = (GetDistributionLatestCacheReset -> Maybe Text)
-> (GetDistributionLatestCacheReset
-> Maybe Text -> GetDistributionLatestCacheReset)
-> Lens
GetDistributionLatestCacheReset
GetDistributionLatestCacheReset
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionLatestCacheReset' {Maybe Text
distributionName :: Maybe Text
$sel:distributionName:GetDistributionLatestCacheReset' :: GetDistributionLatestCacheReset -> Maybe Text
distributionName} -> Maybe Text
distributionName) (\s :: GetDistributionLatestCacheReset
s@GetDistributionLatestCacheReset' {} Maybe Text
a -> GetDistributionLatestCacheReset
s {$sel:distributionName:GetDistributionLatestCacheReset' :: Maybe Text
distributionName = Maybe Text
a} :: GetDistributionLatestCacheReset)
instance
Core.AWSRequest
GetDistributionLatestCacheReset
where
type
AWSResponse GetDistributionLatestCacheReset =
GetDistributionLatestCacheResetResponse
request :: GetDistributionLatestCacheReset
-> Request GetDistributionLatestCacheReset
request = Service
-> GetDistributionLatestCacheReset
-> Request GetDistributionLatestCacheReset
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetDistributionLatestCacheReset
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetDistributionLatestCacheReset)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDistributionLatestCacheReset))
-> Logger
-> Service
-> Proxy GetDistributionLatestCacheReset
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetDistributionLatestCacheReset)))
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 Text
-> Maybe POSIX -> Int -> GetDistributionLatestCacheResetResponse
GetDistributionLatestCacheResetResponse'
(Maybe Text
-> Maybe POSIX -> Int -> GetDistributionLatestCacheResetResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe POSIX -> Int -> GetDistributionLatestCacheResetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
Either
String
(Maybe POSIX -> Int -> GetDistributionLatestCacheResetResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> GetDistributionLatestCacheResetResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"createTime")
Either String (Int -> GetDistributionLatestCacheResetResponse)
-> Either String Int
-> Either String GetDistributionLatestCacheResetResponse
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
GetDistributionLatestCacheReset
instance
Prelude.NFData
GetDistributionLatestCacheReset
instance
Core.ToHeaders
GetDistributionLatestCacheReset
where
toHeaders :: GetDistributionLatestCacheReset -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetDistributionLatestCacheReset -> 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
"Lightsail_20161128.GetDistributionLatestCacheReset" ::
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 GetDistributionLatestCacheReset where
toJSON :: GetDistributionLatestCacheReset -> Value
toJSON GetDistributionLatestCacheReset' {Maybe Text
distributionName :: Maybe Text
$sel:distributionName:GetDistributionLatestCacheReset' :: GetDistributionLatestCacheReset -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"distributionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
distributionName
]
)
instance Core.ToPath GetDistributionLatestCacheReset where
toPath :: GetDistributionLatestCacheReset -> ByteString
toPath = ByteString -> GetDistributionLatestCacheReset -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetDistributionLatestCacheReset where
toQuery :: GetDistributionLatestCacheReset -> QueryString
toQuery = QueryString -> GetDistributionLatestCacheReset -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetDistributionLatestCacheResetResponse = GetDistributionLatestCacheResetResponse'
{
GetDistributionLatestCacheResetResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
GetDistributionLatestCacheResetResponse -> Maybe POSIX
createTime :: Prelude.Maybe Core.POSIX,
GetDistributionLatestCacheResetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool
(GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool)
-> (GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool)
-> Eq GetDistributionLatestCacheResetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool
$c/= :: GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool
== :: GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool
$c== :: GetDistributionLatestCacheResetResponse
-> GetDistributionLatestCacheResetResponse -> Bool
Prelude.Eq, ReadPrec [GetDistributionLatestCacheResetResponse]
ReadPrec GetDistributionLatestCacheResetResponse
Int -> ReadS GetDistributionLatestCacheResetResponse
ReadS [GetDistributionLatestCacheResetResponse]
(Int -> ReadS GetDistributionLatestCacheResetResponse)
-> ReadS [GetDistributionLatestCacheResetResponse]
-> ReadPrec GetDistributionLatestCacheResetResponse
-> ReadPrec [GetDistributionLatestCacheResetResponse]
-> Read GetDistributionLatestCacheResetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDistributionLatestCacheResetResponse]
$creadListPrec :: ReadPrec [GetDistributionLatestCacheResetResponse]
readPrec :: ReadPrec GetDistributionLatestCacheResetResponse
$creadPrec :: ReadPrec GetDistributionLatestCacheResetResponse
readList :: ReadS [GetDistributionLatestCacheResetResponse]
$creadList :: ReadS [GetDistributionLatestCacheResetResponse]
readsPrec :: Int -> ReadS GetDistributionLatestCacheResetResponse
$creadsPrec :: Int -> ReadS GetDistributionLatestCacheResetResponse
Prelude.Read, Int -> GetDistributionLatestCacheResetResponse -> ShowS
[GetDistributionLatestCacheResetResponse] -> ShowS
GetDistributionLatestCacheResetResponse -> String
(Int -> GetDistributionLatestCacheResetResponse -> ShowS)
-> (GetDistributionLatestCacheResetResponse -> String)
-> ([GetDistributionLatestCacheResetResponse] -> ShowS)
-> Show GetDistributionLatestCacheResetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDistributionLatestCacheResetResponse] -> ShowS
$cshowList :: [GetDistributionLatestCacheResetResponse] -> ShowS
show :: GetDistributionLatestCacheResetResponse -> String
$cshow :: GetDistributionLatestCacheResetResponse -> String
showsPrec :: Int -> GetDistributionLatestCacheResetResponse -> ShowS
$cshowsPrec :: Int -> GetDistributionLatestCacheResetResponse -> ShowS
Prelude.Show, (forall x.
GetDistributionLatestCacheResetResponse
-> Rep GetDistributionLatestCacheResetResponse x)
-> (forall x.
Rep GetDistributionLatestCacheResetResponse x
-> GetDistributionLatestCacheResetResponse)
-> Generic GetDistributionLatestCacheResetResponse
forall x.
Rep GetDistributionLatestCacheResetResponse x
-> GetDistributionLatestCacheResetResponse
forall x.
GetDistributionLatestCacheResetResponse
-> Rep GetDistributionLatestCacheResetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDistributionLatestCacheResetResponse x
-> GetDistributionLatestCacheResetResponse
$cfrom :: forall x.
GetDistributionLatestCacheResetResponse
-> Rep GetDistributionLatestCacheResetResponse x
Prelude.Generic)
newGetDistributionLatestCacheResetResponse ::
Prelude.Int ->
GetDistributionLatestCacheResetResponse
newGetDistributionLatestCacheResetResponse :: Int -> GetDistributionLatestCacheResetResponse
newGetDistributionLatestCacheResetResponse
Int
pHttpStatus_ =
GetDistributionLatestCacheResetResponse' :: Maybe Text
-> Maybe POSIX -> Int -> GetDistributionLatestCacheResetResponse
GetDistributionLatestCacheResetResponse'
{ $sel:status:GetDistributionLatestCacheResetResponse' :: Maybe Text
status =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createTime:GetDistributionLatestCacheResetResponse' :: Maybe POSIX
createTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDistributionLatestCacheResetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDistributionLatestCacheResetResponse_status :: Lens.Lens' GetDistributionLatestCacheResetResponse (Prelude.Maybe Prelude.Text)
getDistributionLatestCacheResetResponse_status :: (Maybe Text -> f (Maybe Text))
-> GetDistributionLatestCacheResetResponse
-> f GetDistributionLatestCacheResetResponse
getDistributionLatestCacheResetResponse_status = (GetDistributionLatestCacheResetResponse -> Maybe Text)
-> (GetDistributionLatestCacheResetResponse
-> Maybe Text -> GetDistributionLatestCacheResetResponse)
-> Lens
GetDistributionLatestCacheResetResponse
GetDistributionLatestCacheResetResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionLatestCacheResetResponse' {Maybe Text
status :: Maybe Text
$sel:status:GetDistributionLatestCacheResetResponse' :: GetDistributionLatestCacheResetResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: GetDistributionLatestCacheResetResponse
s@GetDistributionLatestCacheResetResponse' {} Maybe Text
a -> GetDistributionLatestCacheResetResponse
s {$sel:status:GetDistributionLatestCacheResetResponse' :: Maybe Text
status = Maybe Text
a} :: GetDistributionLatestCacheResetResponse)
getDistributionLatestCacheResetResponse_createTime :: Lens.Lens' GetDistributionLatestCacheResetResponse (Prelude.Maybe Prelude.UTCTime)
getDistributionLatestCacheResetResponse_createTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetDistributionLatestCacheResetResponse
-> f GetDistributionLatestCacheResetResponse
getDistributionLatestCacheResetResponse_createTime = (GetDistributionLatestCacheResetResponse -> Maybe POSIX)
-> (GetDistributionLatestCacheResetResponse
-> Maybe POSIX -> GetDistributionLatestCacheResetResponse)
-> Lens
GetDistributionLatestCacheResetResponse
GetDistributionLatestCacheResetResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionLatestCacheResetResponse' {Maybe POSIX
createTime :: Maybe POSIX
$sel:createTime:GetDistributionLatestCacheResetResponse' :: GetDistributionLatestCacheResetResponse -> Maybe POSIX
createTime} -> Maybe POSIX
createTime) (\s :: GetDistributionLatestCacheResetResponse
s@GetDistributionLatestCacheResetResponse' {} Maybe POSIX
a -> GetDistributionLatestCacheResetResponse
s {$sel:createTime:GetDistributionLatestCacheResetResponse' :: Maybe POSIX
createTime = Maybe POSIX
a} :: GetDistributionLatestCacheResetResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> GetDistributionLatestCacheResetResponse
-> f GetDistributionLatestCacheResetResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetDistributionLatestCacheResetResponse
-> f GetDistributionLatestCacheResetResponse
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
getDistributionLatestCacheResetResponse_httpStatus :: Lens.Lens' GetDistributionLatestCacheResetResponse Prelude.Int
getDistributionLatestCacheResetResponse_httpStatus :: (Int -> f Int)
-> GetDistributionLatestCacheResetResponse
-> f GetDistributionLatestCacheResetResponse
getDistributionLatestCacheResetResponse_httpStatus = (GetDistributionLatestCacheResetResponse -> Int)
-> (GetDistributionLatestCacheResetResponse
-> Int -> GetDistributionLatestCacheResetResponse)
-> Lens
GetDistributionLatestCacheResetResponse
GetDistributionLatestCacheResetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDistributionLatestCacheResetResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDistributionLatestCacheResetResponse' :: GetDistributionLatestCacheResetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDistributionLatestCacheResetResponse
s@GetDistributionLatestCacheResetResponse' {} Int
a -> GetDistributionLatestCacheResetResponse
s {$sel:httpStatus:GetDistributionLatestCacheResetResponse' :: Int
httpStatus = Int
a} :: GetDistributionLatestCacheResetResponse)
instance
Prelude.NFData
GetDistributionLatestCacheResetResponse