{-# 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.CreateDistribution
(
CreateDistribution (..),
newCreateDistribution,
createDistribution_cacheBehaviorSettings,
createDistribution_ipAddressType,
createDistribution_cacheBehaviors,
createDistribution_tags,
createDistribution_distributionName,
createDistribution_origin,
createDistribution_defaultCacheBehavior,
createDistribution_bundleId,
CreateDistributionResponse (..),
newCreateDistributionResponse,
createDistributionResponse_distribution,
createDistributionResponse_operation,
createDistributionResponse_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 CreateDistribution = CreateDistribution'
{
CreateDistribution -> Maybe CacheSettings
cacheBehaviorSettings :: Prelude.Maybe CacheSettings,
CreateDistribution -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
CreateDistribution -> Maybe [CacheBehaviorPerPath]
cacheBehaviors :: Prelude.Maybe [CacheBehaviorPerPath],
CreateDistribution -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateDistribution -> Text
distributionName :: Prelude.Text,
CreateDistribution -> InputOrigin
origin :: InputOrigin,
CreateDistribution -> CacheBehavior
defaultCacheBehavior :: CacheBehavior,
CreateDistribution -> Text
bundleId :: Prelude.Text
}
deriving (CreateDistribution -> CreateDistribution -> Bool
(CreateDistribution -> CreateDistribution -> Bool)
-> (CreateDistribution -> CreateDistribution -> Bool)
-> Eq CreateDistribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDistribution -> CreateDistribution -> Bool
$c/= :: CreateDistribution -> CreateDistribution -> Bool
== :: CreateDistribution -> CreateDistribution -> Bool
$c== :: CreateDistribution -> CreateDistribution -> Bool
Prelude.Eq, ReadPrec [CreateDistribution]
ReadPrec CreateDistribution
Int -> ReadS CreateDistribution
ReadS [CreateDistribution]
(Int -> ReadS CreateDistribution)
-> ReadS [CreateDistribution]
-> ReadPrec CreateDistribution
-> ReadPrec [CreateDistribution]
-> Read CreateDistribution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDistribution]
$creadListPrec :: ReadPrec [CreateDistribution]
readPrec :: ReadPrec CreateDistribution
$creadPrec :: ReadPrec CreateDistribution
readList :: ReadS [CreateDistribution]
$creadList :: ReadS [CreateDistribution]
readsPrec :: Int -> ReadS CreateDistribution
$creadsPrec :: Int -> ReadS CreateDistribution
Prelude.Read, Int -> CreateDistribution -> ShowS
[CreateDistribution] -> ShowS
CreateDistribution -> String
(Int -> CreateDistribution -> ShowS)
-> (CreateDistribution -> String)
-> ([CreateDistribution] -> ShowS)
-> Show CreateDistribution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDistribution] -> ShowS
$cshowList :: [CreateDistribution] -> ShowS
show :: CreateDistribution -> String
$cshow :: CreateDistribution -> String
showsPrec :: Int -> CreateDistribution -> ShowS
$cshowsPrec :: Int -> CreateDistribution -> ShowS
Prelude.Show, (forall x. CreateDistribution -> Rep CreateDistribution x)
-> (forall x. Rep CreateDistribution x -> CreateDistribution)
-> Generic CreateDistribution
forall x. Rep CreateDistribution x -> CreateDistribution
forall x. CreateDistribution -> Rep CreateDistribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDistribution x -> CreateDistribution
$cfrom :: forall x. CreateDistribution -> Rep CreateDistribution x
Prelude.Generic)
newCreateDistribution ::
Prelude.Text ->
InputOrigin ->
CacheBehavior ->
Prelude.Text ->
CreateDistribution
newCreateDistribution :: Text -> InputOrigin -> CacheBehavior -> Text -> CreateDistribution
newCreateDistribution
Text
pDistributionName_
InputOrigin
pOrigin_
CacheBehavior
pDefaultCacheBehavior_
Text
pBundleId_ =
CreateDistribution' :: Maybe CacheSettings
-> Maybe IpAddressType
-> Maybe [CacheBehaviorPerPath]
-> Maybe [Tag]
-> Text
-> InputOrigin
-> CacheBehavior
-> Text
-> CreateDistribution
CreateDistribution'
{ $sel:cacheBehaviorSettings:CreateDistribution' :: Maybe CacheSettings
cacheBehaviorSettings =
Maybe CacheSettings
forall a. Maybe a
Prelude.Nothing,
$sel:ipAddressType:CreateDistribution' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
$sel:cacheBehaviors:CreateDistribution' :: Maybe [CacheBehaviorPerPath]
cacheBehaviors = Maybe [CacheBehaviorPerPath]
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateDistribution' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:distributionName:CreateDistribution' :: Text
distributionName = Text
pDistributionName_,
$sel:origin:CreateDistribution' :: InputOrigin
origin = InputOrigin
pOrigin_,
$sel:defaultCacheBehavior:CreateDistribution' :: CacheBehavior
defaultCacheBehavior = CacheBehavior
pDefaultCacheBehavior_,
$sel:bundleId:CreateDistribution' :: Text
bundleId = Text
pBundleId_
}
createDistribution_cacheBehaviorSettings :: Lens.Lens' CreateDistribution (Prelude.Maybe CacheSettings)
createDistribution_cacheBehaviorSettings :: (Maybe CacheSettings -> f (Maybe CacheSettings))
-> CreateDistribution -> f CreateDistribution
createDistribution_cacheBehaviorSettings = (CreateDistribution -> Maybe CacheSettings)
-> (CreateDistribution
-> Maybe CacheSettings -> CreateDistribution)
-> Lens
CreateDistribution
CreateDistribution
(Maybe CacheSettings)
(Maybe CacheSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {Maybe CacheSettings
cacheBehaviorSettings :: Maybe CacheSettings
$sel:cacheBehaviorSettings:CreateDistribution' :: CreateDistribution -> Maybe CacheSettings
cacheBehaviorSettings} -> Maybe CacheSettings
cacheBehaviorSettings) (\s :: CreateDistribution
s@CreateDistribution' {} Maybe CacheSettings
a -> CreateDistribution
s {$sel:cacheBehaviorSettings:CreateDistribution' :: Maybe CacheSettings
cacheBehaviorSettings = Maybe CacheSettings
a} :: CreateDistribution)
createDistribution_ipAddressType :: Lens.Lens' CreateDistribution (Prelude.Maybe IpAddressType)
createDistribution_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> CreateDistribution -> f CreateDistribution
createDistribution_ipAddressType = (CreateDistribution -> Maybe IpAddressType)
-> (CreateDistribution
-> Maybe IpAddressType -> CreateDistribution)
-> Lens
CreateDistribution
CreateDistribution
(Maybe IpAddressType)
(Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:CreateDistribution' :: CreateDistribution -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: CreateDistribution
s@CreateDistribution' {} Maybe IpAddressType
a -> CreateDistribution
s {$sel:ipAddressType:CreateDistribution' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: CreateDistribution)
createDistribution_cacheBehaviors :: Lens.Lens' CreateDistribution (Prelude.Maybe [CacheBehaviorPerPath])
createDistribution_cacheBehaviors :: (Maybe [CacheBehaviorPerPath] -> f (Maybe [CacheBehaviorPerPath]))
-> CreateDistribution -> f CreateDistribution
createDistribution_cacheBehaviors = (CreateDistribution -> Maybe [CacheBehaviorPerPath])
-> (CreateDistribution
-> Maybe [CacheBehaviorPerPath] -> CreateDistribution)
-> Lens
CreateDistribution
CreateDistribution
(Maybe [CacheBehaviorPerPath])
(Maybe [CacheBehaviorPerPath])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {Maybe [CacheBehaviorPerPath]
cacheBehaviors :: Maybe [CacheBehaviorPerPath]
$sel:cacheBehaviors:CreateDistribution' :: CreateDistribution -> Maybe [CacheBehaviorPerPath]
cacheBehaviors} -> Maybe [CacheBehaviorPerPath]
cacheBehaviors) (\s :: CreateDistribution
s@CreateDistribution' {} Maybe [CacheBehaviorPerPath]
a -> CreateDistribution
s {$sel:cacheBehaviors:CreateDistribution' :: Maybe [CacheBehaviorPerPath]
cacheBehaviors = Maybe [CacheBehaviorPerPath]
a} :: CreateDistribution) ((Maybe [CacheBehaviorPerPath] -> f (Maybe [CacheBehaviorPerPath]))
-> CreateDistribution -> f CreateDistribution)
-> ((Maybe [CacheBehaviorPerPath]
-> f (Maybe [CacheBehaviorPerPath]))
-> Maybe [CacheBehaviorPerPath]
-> f (Maybe [CacheBehaviorPerPath]))
-> (Maybe [CacheBehaviorPerPath]
-> f (Maybe [CacheBehaviorPerPath]))
-> CreateDistribution
-> f CreateDistribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CacheBehaviorPerPath]
[CacheBehaviorPerPath]
[CacheBehaviorPerPath]
[CacheBehaviorPerPath]
-> Iso
(Maybe [CacheBehaviorPerPath])
(Maybe [CacheBehaviorPerPath])
(Maybe [CacheBehaviorPerPath])
(Maybe [CacheBehaviorPerPath])
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
[CacheBehaviorPerPath]
[CacheBehaviorPerPath]
[CacheBehaviorPerPath]
[CacheBehaviorPerPath]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDistribution_tags :: Lens.Lens' CreateDistribution (Prelude.Maybe [Tag])
createDistribution_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDistribution -> f CreateDistribution
createDistribution_tags = (CreateDistribution -> Maybe [Tag])
-> (CreateDistribution -> Maybe [Tag] -> CreateDistribution)
-> Lens
CreateDistribution CreateDistribution (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateDistribution' :: CreateDistribution -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateDistribution
s@CreateDistribution' {} Maybe [Tag]
a -> CreateDistribution
s {$sel:tags:CreateDistribution' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateDistribution) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDistribution -> f CreateDistribution)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateDistribution
-> f CreateDistribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createDistribution_distributionName :: Lens.Lens' CreateDistribution Prelude.Text
createDistribution_distributionName :: (Text -> f Text) -> CreateDistribution -> f CreateDistribution
createDistribution_distributionName = (CreateDistribution -> Text)
-> (CreateDistribution -> Text -> CreateDistribution)
-> Lens CreateDistribution CreateDistribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {Text
distributionName :: Text
$sel:distributionName:CreateDistribution' :: CreateDistribution -> Text
distributionName} -> Text
distributionName) (\s :: CreateDistribution
s@CreateDistribution' {} Text
a -> CreateDistribution
s {$sel:distributionName:CreateDistribution' :: Text
distributionName = Text
a} :: CreateDistribution)
createDistribution_origin :: Lens.Lens' CreateDistribution InputOrigin
createDistribution_origin :: (InputOrigin -> f InputOrigin)
-> CreateDistribution -> f CreateDistribution
createDistribution_origin = (CreateDistribution -> InputOrigin)
-> (CreateDistribution -> InputOrigin -> CreateDistribution)
-> Lens
CreateDistribution CreateDistribution InputOrigin InputOrigin
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {InputOrigin
origin :: InputOrigin
$sel:origin:CreateDistribution' :: CreateDistribution -> InputOrigin
origin} -> InputOrigin
origin) (\s :: CreateDistribution
s@CreateDistribution' {} InputOrigin
a -> CreateDistribution
s {$sel:origin:CreateDistribution' :: InputOrigin
origin = InputOrigin
a} :: CreateDistribution)
createDistribution_defaultCacheBehavior :: Lens.Lens' CreateDistribution CacheBehavior
createDistribution_defaultCacheBehavior :: (CacheBehavior -> f CacheBehavior)
-> CreateDistribution -> f CreateDistribution
createDistribution_defaultCacheBehavior = (CreateDistribution -> CacheBehavior)
-> (CreateDistribution -> CacheBehavior -> CreateDistribution)
-> Lens
CreateDistribution CreateDistribution CacheBehavior CacheBehavior
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {CacheBehavior
defaultCacheBehavior :: CacheBehavior
$sel:defaultCacheBehavior:CreateDistribution' :: CreateDistribution -> CacheBehavior
defaultCacheBehavior} -> CacheBehavior
defaultCacheBehavior) (\s :: CreateDistribution
s@CreateDistribution' {} CacheBehavior
a -> CreateDistribution
s {$sel:defaultCacheBehavior:CreateDistribution' :: CacheBehavior
defaultCacheBehavior = CacheBehavior
a} :: CreateDistribution)
createDistribution_bundleId :: Lens.Lens' CreateDistribution Prelude.Text
createDistribution_bundleId :: (Text -> f Text) -> CreateDistribution -> f CreateDistribution
createDistribution_bundleId = (CreateDistribution -> Text)
-> (CreateDistribution -> Text -> CreateDistribution)
-> Lens CreateDistribution CreateDistribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistribution' {Text
bundleId :: Text
$sel:bundleId:CreateDistribution' :: CreateDistribution -> Text
bundleId} -> Text
bundleId) (\s :: CreateDistribution
s@CreateDistribution' {} Text
a -> CreateDistribution
s {$sel:bundleId:CreateDistribution' :: Text
bundleId = Text
a} :: CreateDistribution)
instance Core.AWSRequest CreateDistribution where
type
AWSResponse CreateDistribution =
CreateDistributionResponse
request :: CreateDistribution -> Request CreateDistribution
request = Service -> CreateDistribution -> Request CreateDistribution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDistribution)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateDistribution))
-> Logger
-> Service
-> Proxy CreateDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateDistribution)))
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 LightsailDistribution
-> Maybe Operation -> Int -> CreateDistributionResponse
CreateDistributionResponse'
(Maybe LightsailDistribution
-> Maybe Operation -> Int -> CreateDistributionResponse)
-> Either String (Maybe LightsailDistribution)
-> Either
String (Maybe Operation -> Int -> CreateDistributionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe LightsailDistribution)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"distribution")
Either
String (Maybe Operation -> Int -> CreateDistributionResponse)
-> Either String (Maybe Operation)
-> Either String (Int -> CreateDistributionResponse)
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 (Int -> CreateDistributionResponse)
-> Either String Int -> Either String CreateDistributionResponse
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 CreateDistribution
instance Prelude.NFData CreateDistribution
instance Core.ToHeaders CreateDistribution where
toHeaders :: CreateDistribution -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateDistribution -> 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.CreateDistribution" ::
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 CreateDistribution where
toJSON :: CreateDistribution -> Value
toJSON CreateDistribution' {Maybe [CacheBehaviorPerPath]
Maybe [Tag]
Maybe IpAddressType
Maybe CacheSettings
Text
CacheBehavior
InputOrigin
bundleId :: Text
defaultCacheBehavior :: CacheBehavior
origin :: InputOrigin
distributionName :: Text
tags :: Maybe [Tag]
cacheBehaviors :: Maybe [CacheBehaviorPerPath]
ipAddressType :: Maybe IpAddressType
cacheBehaviorSettings :: Maybe CacheSettings
$sel:bundleId:CreateDistribution' :: CreateDistribution -> Text
$sel:defaultCacheBehavior:CreateDistribution' :: CreateDistribution -> CacheBehavior
$sel:origin:CreateDistribution' :: CreateDistribution -> InputOrigin
$sel:distributionName:CreateDistribution' :: CreateDistribution -> Text
$sel:tags:CreateDistribution' :: CreateDistribution -> Maybe [Tag]
$sel:cacheBehaviors:CreateDistribution' :: CreateDistribution -> Maybe [CacheBehaviorPerPath]
$sel:ipAddressType:CreateDistribution' :: CreateDistribution -> Maybe IpAddressType
$sel:cacheBehaviorSettings:CreateDistribution' :: CreateDistribution -> Maybe CacheSettings
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"cacheBehaviorSettings" Text -> CacheSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(CacheSettings -> Pair) -> Maybe CacheSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CacheSettings
cacheBehaviorSettings,
(Text
"ipAddressType" Text -> IpAddressType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (IpAddressType -> Pair) -> Maybe IpAddressType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe IpAddressType
ipAddressType,
(Text
"cacheBehaviors" Text -> [CacheBehaviorPerPath] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([CacheBehaviorPerPath] -> Pair)
-> Maybe [CacheBehaviorPerPath] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CacheBehaviorPerPath]
cacheBehaviors,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"distributionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
distributionName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"origin" Text -> InputOrigin -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InputOrigin
origin),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"defaultCacheBehavior"
Text -> CacheBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CacheBehavior
defaultCacheBehavior
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"bundleId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bundleId)
]
)
instance Core.ToPath CreateDistribution where
toPath :: CreateDistribution -> ByteString
toPath = ByteString -> CreateDistribution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateDistribution where
toQuery :: CreateDistribution -> QueryString
toQuery = QueryString -> CreateDistribution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateDistributionResponse = CreateDistributionResponse'
{
CreateDistributionResponse -> Maybe LightsailDistribution
distribution :: Prelude.Maybe LightsailDistribution,
CreateDistributionResponse -> Maybe Operation
operation :: Prelude.Maybe Operation,
CreateDistributionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateDistributionResponse -> CreateDistributionResponse -> Bool
(CreateDistributionResponse -> CreateDistributionResponse -> Bool)
-> (CreateDistributionResponse
-> CreateDistributionResponse -> Bool)
-> Eq CreateDistributionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDistributionResponse -> CreateDistributionResponse -> Bool
$c/= :: CreateDistributionResponse -> CreateDistributionResponse -> Bool
== :: CreateDistributionResponse -> CreateDistributionResponse -> Bool
$c== :: CreateDistributionResponse -> CreateDistributionResponse -> Bool
Prelude.Eq, ReadPrec [CreateDistributionResponse]
ReadPrec CreateDistributionResponse
Int -> ReadS CreateDistributionResponse
ReadS [CreateDistributionResponse]
(Int -> ReadS CreateDistributionResponse)
-> ReadS [CreateDistributionResponse]
-> ReadPrec CreateDistributionResponse
-> ReadPrec [CreateDistributionResponse]
-> Read CreateDistributionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDistributionResponse]
$creadListPrec :: ReadPrec [CreateDistributionResponse]
readPrec :: ReadPrec CreateDistributionResponse
$creadPrec :: ReadPrec CreateDistributionResponse
readList :: ReadS [CreateDistributionResponse]
$creadList :: ReadS [CreateDistributionResponse]
readsPrec :: Int -> ReadS CreateDistributionResponse
$creadsPrec :: Int -> ReadS CreateDistributionResponse
Prelude.Read, Int -> CreateDistributionResponse -> ShowS
[CreateDistributionResponse] -> ShowS
CreateDistributionResponse -> String
(Int -> CreateDistributionResponse -> ShowS)
-> (CreateDistributionResponse -> String)
-> ([CreateDistributionResponse] -> ShowS)
-> Show CreateDistributionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDistributionResponse] -> ShowS
$cshowList :: [CreateDistributionResponse] -> ShowS
show :: CreateDistributionResponse -> String
$cshow :: CreateDistributionResponse -> String
showsPrec :: Int -> CreateDistributionResponse -> ShowS
$cshowsPrec :: Int -> CreateDistributionResponse -> ShowS
Prelude.Show, (forall x.
CreateDistributionResponse -> Rep CreateDistributionResponse x)
-> (forall x.
Rep CreateDistributionResponse x -> CreateDistributionResponse)
-> Generic CreateDistributionResponse
forall x.
Rep CreateDistributionResponse x -> CreateDistributionResponse
forall x.
CreateDistributionResponse -> Rep CreateDistributionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateDistributionResponse x -> CreateDistributionResponse
$cfrom :: forall x.
CreateDistributionResponse -> Rep CreateDistributionResponse x
Prelude.Generic)
newCreateDistributionResponse ::
Prelude.Int ->
CreateDistributionResponse
newCreateDistributionResponse :: Int -> CreateDistributionResponse
newCreateDistributionResponse Int
pHttpStatus_ =
CreateDistributionResponse' :: Maybe LightsailDistribution
-> Maybe Operation -> Int -> CreateDistributionResponse
CreateDistributionResponse'
{ $sel:distribution:CreateDistributionResponse' :: Maybe LightsailDistribution
distribution =
Maybe LightsailDistribution
forall a. Maybe a
Prelude.Nothing,
$sel:operation:CreateDistributionResponse' :: Maybe Operation
operation = Maybe Operation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateDistributionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createDistributionResponse_distribution :: Lens.Lens' CreateDistributionResponse (Prelude.Maybe LightsailDistribution)
createDistributionResponse_distribution :: (Maybe LightsailDistribution -> f (Maybe LightsailDistribution))
-> CreateDistributionResponse -> f CreateDistributionResponse
createDistributionResponse_distribution = (CreateDistributionResponse -> Maybe LightsailDistribution)
-> (CreateDistributionResponse
-> Maybe LightsailDistribution -> CreateDistributionResponse)
-> Lens
CreateDistributionResponse
CreateDistributionResponse
(Maybe LightsailDistribution)
(Maybe LightsailDistribution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionResponse' {Maybe LightsailDistribution
distribution :: Maybe LightsailDistribution
$sel:distribution:CreateDistributionResponse' :: CreateDistributionResponse -> Maybe LightsailDistribution
distribution} -> Maybe LightsailDistribution
distribution) (\s :: CreateDistributionResponse
s@CreateDistributionResponse' {} Maybe LightsailDistribution
a -> CreateDistributionResponse
s {$sel:distribution:CreateDistributionResponse' :: Maybe LightsailDistribution
distribution = Maybe LightsailDistribution
a} :: CreateDistributionResponse)
createDistributionResponse_operation :: Lens.Lens' CreateDistributionResponse (Prelude.Maybe Operation)
createDistributionResponse_operation :: (Maybe Operation -> f (Maybe Operation))
-> CreateDistributionResponse -> f CreateDistributionResponse
createDistributionResponse_operation = (CreateDistributionResponse -> Maybe Operation)
-> (CreateDistributionResponse
-> Maybe Operation -> CreateDistributionResponse)
-> Lens
CreateDistributionResponse
CreateDistributionResponse
(Maybe Operation)
(Maybe Operation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionResponse' {Maybe Operation
operation :: Maybe Operation
$sel:operation:CreateDistributionResponse' :: CreateDistributionResponse -> Maybe Operation
operation} -> Maybe Operation
operation) (\s :: CreateDistributionResponse
s@CreateDistributionResponse' {} Maybe Operation
a -> CreateDistributionResponse
s {$sel:operation:CreateDistributionResponse' :: Maybe Operation
operation = Maybe Operation
a} :: CreateDistributionResponse)
createDistributionResponse_httpStatus :: Lens.Lens' CreateDistributionResponse Prelude.Int
createDistributionResponse_httpStatus :: (Int -> f Int)
-> CreateDistributionResponse -> f CreateDistributionResponse
createDistributionResponse_httpStatus = (CreateDistributionResponse -> Int)
-> (CreateDistributionResponse
-> Int -> CreateDistributionResponse)
-> Lens
CreateDistributionResponse CreateDistributionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDistributionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateDistributionResponse' :: CreateDistributionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateDistributionResponse
s@CreateDistributionResponse' {} Int
a -> CreateDistributionResponse
s {$sel:httpStatus:CreateDistributionResponse' :: Int
httpStatus = Int
a} :: CreateDistributionResponse)
instance Prelude.NFData CreateDistributionResponse