{-# 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.ResetDistributionCache
(
ResetDistributionCache (..),
newResetDistributionCache,
resetDistributionCache_distributionName,
ResetDistributionCacheResponse (..),
newResetDistributionCacheResponse,
resetDistributionCacheResponse_status,
resetDistributionCacheResponse_operation,
resetDistributionCacheResponse_createTime,
resetDistributionCacheResponse_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 ResetDistributionCache = ResetDistributionCache'
{
ResetDistributionCache -> Maybe Text
distributionName :: Prelude.Maybe Prelude.Text
}
deriving (ResetDistributionCache -> ResetDistributionCache -> Bool
(ResetDistributionCache -> ResetDistributionCache -> Bool)
-> (ResetDistributionCache -> ResetDistributionCache -> Bool)
-> Eq ResetDistributionCache
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetDistributionCache -> ResetDistributionCache -> Bool
$c/= :: ResetDistributionCache -> ResetDistributionCache -> Bool
== :: ResetDistributionCache -> ResetDistributionCache -> Bool
$c== :: ResetDistributionCache -> ResetDistributionCache -> Bool
Prelude.Eq, ReadPrec [ResetDistributionCache]
ReadPrec ResetDistributionCache
Int -> ReadS ResetDistributionCache
ReadS [ResetDistributionCache]
(Int -> ReadS ResetDistributionCache)
-> ReadS [ResetDistributionCache]
-> ReadPrec ResetDistributionCache
-> ReadPrec [ResetDistributionCache]
-> Read ResetDistributionCache
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetDistributionCache]
$creadListPrec :: ReadPrec [ResetDistributionCache]
readPrec :: ReadPrec ResetDistributionCache
$creadPrec :: ReadPrec ResetDistributionCache
readList :: ReadS [ResetDistributionCache]
$creadList :: ReadS [ResetDistributionCache]
readsPrec :: Int -> ReadS ResetDistributionCache
$creadsPrec :: Int -> ReadS ResetDistributionCache
Prelude.Read, Int -> ResetDistributionCache -> ShowS
[ResetDistributionCache] -> ShowS
ResetDistributionCache -> String
(Int -> ResetDistributionCache -> ShowS)
-> (ResetDistributionCache -> String)
-> ([ResetDistributionCache] -> ShowS)
-> Show ResetDistributionCache
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetDistributionCache] -> ShowS
$cshowList :: [ResetDistributionCache] -> ShowS
show :: ResetDistributionCache -> String
$cshow :: ResetDistributionCache -> String
showsPrec :: Int -> ResetDistributionCache -> ShowS
$cshowsPrec :: Int -> ResetDistributionCache -> ShowS
Prelude.Show, (forall x. ResetDistributionCache -> Rep ResetDistributionCache x)
-> (forall x.
Rep ResetDistributionCache x -> ResetDistributionCache)
-> Generic ResetDistributionCache
forall x. Rep ResetDistributionCache x -> ResetDistributionCache
forall x. ResetDistributionCache -> Rep ResetDistributionCache x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResetDistributionCache x -> ResetDistributionCache
$cfrom :: forall x. ResetDistributionCache -> Rep ResetDistributionCache x
Prelude.Generic)
newResetDistributionCache ::
ResetDistributionCache
newResetDistributionCache :: ResetDistributionCache
newResetDistributionCache =
ResetDistributionCache' :: Maybe Text -> ResetDistributionCache
ResetDistributionCache'
{ $sel:distributionName:ResetDistributionCache' :: Maybe Text
distributionName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resetDistributionCache_distributionName :: Lens.Lens' ResetDistributionCache (Prelude.Maybe Prelude.Text)
resetDistributionCache_distributionName :: (Maybe Text -> f (Maybe Text))
-> ResetDistributionCache -> f ResetDistributionCache
resetDistributionCache_distributionName = (ResetDistributionCache -> Maybe Text)
-> (ResetDistributionCache -> Maybe Text -> ResetDistributionCache)
-> Lens
ResetDistributionCache
ResetDistributionCache
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetDistributionCache' {Maybe Text
distributionName :: Maybe Text
$sel:distributionName:ResetDistributionCache' :: ResetDistributionCache -> Maybe Text
distributionName} -> Maybe Text
distributionName) (\s :: ResetDistributionCache
s@ResetDistributionCache' {} Maybe Text
a -> ResetDistributionCache
s {$sel:distributionName:ResetDistributionCache' :: Maybe Text
distributionName = Maybe Text
a} :: ResetDistributionCache)
instance Core.AWSRequest ResetDistributionCache where
type
AWSResponse ResetDistributionCache =
ResetDistributionCacheResponse
request :: ResetDistributionCache -> Request ResetDistributionCache
request = Service -> ResetDistributionCache -> Request ResetDistributionCache
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ResetDistributionCache
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResetDistributionCache)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ResetDistributionCache))
-> Logger
-> Service
-> Proxy ResetDistributionCache
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResetDistributionCache)))
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 Operation
-> Maybe POSIX
-> Int
-> ResetDistributionCacheResponse
ResetDistributionCacheResponse'
(Maybe Text
-> Maybe Operation
-> Maybe POSIX
-> Int
-> ResetDistributionCacheResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Operation
-> Maybe POSIX -> Int -> ResetDistributionCacheResponse)
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 Operation
-> Maybe POSIX -> Int -> ResetDistributionCacheResponse)
-> Either String (Maybe Operation)
-> Either
String (Maybe POSIX -> Int -> ResetDistributionCacheResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Operation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operation")
Either
String (Maybe POSIX -> Int -> ResetDistributionCacheResponse)
-> Either String (Maybe POSIX)
-> Either String (Int -> ResetDistributionCacheResponse)
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 -> ResetDistributionCacheResponse)
-> Either String Int
-> Either String ResetDistributionCacheResponse
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 ResetDistributionCache
instance Prelude.NFData ResetDistributionCache
instance Core.ToHeaders ResetDistributionCache where
toHeaders :: ResetDistributionCache -> ResponseHeaders
toHeaders =
ResponseHeaders -> ResetDistributionCache -> 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.ResetDistributionCache" ::
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 ResetDistributionCache where
toJSON :: ResetDistributionCache -> Value
toJSON ResetDistributionCache' {Maybe Text
distributionName :: Maybe Text
$sel:distributionName:ResetDistributionCache' :: ResetDistributionCache -> 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 ResetDistributionCache where
toPath :: ResetDistributionCache -> ByteString
toPath = ByteString -> ResetDistributionCache -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ResetDistributionCache where
toQuery :: ResetDistributionCache -> QueryString
toQuery = QueryString -> ResetDistributionCache -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ResetDistributionCacheResponse = ResetDistributionCacheResponse'
{
ResetDistributionCacheResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
ResetDistributionCacheResponse -> Maybe Operation
operation :: Prelude.Maybe Operation,
ResetDistributionCacheResponse -> Maybe POSIX
createTime :: Prelude.Maybe Core.POSIX,
ResetDistributionCacheResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool
(ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool)
-> (ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool)
-> Eq ResetDistributionCacheResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool
$c/= :: ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool
== :: ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool
$c== :: ResetDistributionCacheResponse
-> ResetDistributionCacheResponse -> Bool
Prelude.Eq, ReadPrec [ResetDistributionCacheResponse]
ReadPrec ResetDistributionCacheResponse
Int -> ReadS ResetDistributionCacheResponse
ReadS [ResetDistributionCacheResponse]
(Int -> ReadS ResetDistributionCacheResponse)
-> ReadS [ResetDistributionCacheResponse]
-> ReadPrec ResetDistributionCacheResponse
-> ReadPrec [ResetDistributionCacheResponse]
-> Read ResetDistributionCacheResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResetDistributionCacheResponse]
$creadListPrec :: ReadPrec [ResetDistributionCacheResponse]
readPrec :: ReadPrec ResetDistributionCacheResponse
$creadPrec :: ReadPrec ResetDistributionCacheResponse
readList :: ReadS [ResetDistributionCacheResponse]
$creadList :: ReadS [ResetDistributionCacheResponse]
readsPrec :: Int -> ReadS ResetDistributionCacheResponse
$creadsPrec :: Int -> ReadS ResetDistributionCacheResponse
Prelude.Read, Int -> ResetDistributionCacheResponse -> ShowS
[ResetDistributionCacheResponse] -> ShowS
ResetDistributionCacheResponse -> String
(Int -> ResetDistributionCacheResponse -> ShowS)
-> (ResetDistributionCacheResponse -> String)
-> ([ResetDistributionCacheResponse] -> ShowS)
-> Show ResetDistributionCacheResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResetDistributionCacheResponse] -> ShowS
$cshowList :: [ResetDistributionCacheResponse] -> ShowS
show :: ResetDistributionCacheResponse -> String
$cshow :: ResetDistributionCacheResponse -> String
showsPrec :: Int -> ResetDistributionCacheResponse -> ShowS
$cshowsPrec :: Int -> ResetDistributionCacheResponse -> ShowS
Prelude.Show, (forall x.
ResetDistributionCacheResponse
-> Rep ResetDistributionCacheResponse x)
-> (forall x.
Rep ResetDistributionCacheResponse x
-> ResetDistributionCacheResponse)
-> Generic ResetDistributionCacheResponse
forall x.
Rep ResetDistributionCacheResponse x
-> ResetDistributionCacheResponse
forall x.
ResetDistributionCacheResponse
-> Rep ResetDistributionCacheResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResetDistributionCacheResponse x
-> ResetDistributionCacheResponse
$cfrom :: forall x.
ResetDistributionCacheResponse
-> Rep ResetDistributionCacheResponse x
Prelude.Generic)
newResetDistributionCacheResponse ::
Prelude.Int ->
ResetDistributionCacheResponse
newResetDistributionCacheResponse :: Int -> ResetDistributionCacheResponse
newResetDistributionCacheResponse Int
pHttpStatus_ =
ResetDistributionCacheResponse' :: Maybe Text
-> Maybe Operation
-> Maybe POSIX
-> Int
-> ResetDistributionCacheResponse
ResetDistributionCacheResponse'
{ $sel:status:ResetDistributionCacheResponse' :: Maybe Text
status =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:operation:ResetDistributionCacheResponse' :: Maybe Operation
operation = Maybe Operation
forall a. Maybe a
Prelude.Nothing,
$sel:createTime:ResetDistributionCacheResponse' :: Maybe POSIX
createTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResetDistributionCacheResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resetDistributionCacheResponse_status :: Lens.Lens' ResetDistributionCacheResponse (Prelude.Maybe Prelude.Text)
resetDistributionCacheResponse_status :: (Maybe Text -> f (Maybe Text))
-> ResetDistributionCacheResponse
-> f ResetDistributionCacheResponse
resetDistributionCacheResponse_status = (ResetDistributionCacheResponse -> Maybe Text)
-> (ResetDistributionCacheResponse
-> Maybe Text -> ResetDistributionCacheResponse)
-> Lens
ResetDistributionCacheResponse
ResetDistributionCacheResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetDistributionCacheResponse' {Maybe Text
status :: Maybe Text
$sel:status:ResetDistributionCacheResponse' :: ResetDistributionCacheResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: ResetDistributionCacheResponse
s@ResetDistributionCacheResponse' {} Maybe Text
a -> ResetDistributionCacheResponse
s {$sel:status:ResetDistributionCacheResponse' :: Maybe Text
status = Maybe Text
a} :: ResetDistributionCacheResponse)
resetDistributionCacheResponse_operation :: Lens.Lens' ResetDistributionCacheResponse (Prelude.Maybe Operation)
resetDistributionCacheResponse_operation :: (Maybe Operation -> f (Maybe Operation))
-> ResetDistributionCacheResponse
-> f ResetDistributionCacheResponse
resetDistributionCacheResponse_operation = (ResetDistributionCacheResponse -> Maybe Operation)
-> (ResetDistributionCacheResponse
-> Maybe Operation -> ResetDistributionCacheResponse)
-> Lens
ResetDistributionCacheResponse
ResetDistributionCacheResponse
(Maybe Operation)
(Maybe Operation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetDistributionCacheResponse' {Maybe Operation
operation :: Maybe Operation
$sel:operation:ResetDistributionCacheResponse' :: ResetDistributionCacheResponse -> Maybe Operation
operation} -> Maybe Operation
operation) (\s :: ResetDistributionCacheResponse
s@ResetDistributionCacheResponse' {} Maybe Operation
a -> ResetDistributionCacheResponse
s {$sel:operation:ResetDistributionCacheResponse' :: Maybe Operation
operation = Maybe Operation
a} :: ResetDistributionCacheResponse)
resetDistributionCacheResponse_createTime :: Lens.Lens' ResetDistributionCacheResponse (Prelude.Maybe Prelude.UTCTime)
resetDistributionCacheResponse_createTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResetDistributionCacheResponse
-> f ResetDistributionCacheResponse
resetDistributionCacheResponse_createTime = (ResetDistributionCacheResponse -> Maybe POSIX)
-> (ResetDistributionCacheResponse
-> Maybe POSIX -> ResetDistributionCacheResponse)
-> Lens
ResetDistributionCacheResponse
ResetDistributionCacheResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetDistributionCacheResponse' {Maybe POSIX
createTime :: Maybe POSIX
$sel:createTime:ResetDistributionCacheResponse' :: ResetDistributionCacheResponse -> Maybe POSIX
createTime} -> Maybe POSIX
createTime) (\s :: ResetDistributionCacheResponse
s@ResetDistributionCacheResponse' {} Maybe POSIX
a -> ResetDistributionCacheResponse
s {$sel:createTime:ResetDistributionCacheResponse' :: Maybe POSIX
createTime = Maybe POSIX
a} :: ResetDistributionCacheResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> ResetDistributionCacheResponse
-> f ResetDistributionCacheResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResetDistributionCacheResponse
-> f ResetDistributionCacheResponse
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
resetDistributionCacheResponse_httpStatus :: Lens.Lens' ResetDistributionCacheResponse Prelude.Int
resetDistributionCacheResponse_httpStatus :: (Int -> f Int)
-> ResetDistributionCacheResponse
-> f ResetDistributionCacheResponse
resetDistributionCacheResponse_httpStatus = (ResetDistributionCacheResponse -> Int)
-> (ResetDistributionCacheResponse
-> Int -> ResetDistributionCacheResponse)
-> Lens
ResetDistributionCacheResponse
ResetDistributionCacheResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResetDistributionCacheResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResetDistributionCacheResponse' :: ResetDistributionCacheResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResetDistributionCacheResponse
s@ResetDistributionCacheResponse' {} Int
a -> ResetDistributionCacheResponse
s {$sel:httpStatus:ResetDistributionCacheResponse' :: Int
httpStatus = Int
a} :: ResetDistributionCacheResponse)
instance
Prelude.NFData
ResetDistributionCacheResponse