{-# 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.CloudFront.AssociateAlias
(
AssociateAlias (..),
newAssociateAlias,
associateAlias_targetDistributionId,
associateAlias_alias,
AssociateAliasResponse (..),
newAssociateAliasResponse,
)
where
import Amazonka.CloudFront.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateAlias = AssociateAlias'
{
AssociateAlias -> Text
targetDistributionId :: Prelude.Text,
AssociateAlias -> Text
alias :: Prelude.Text
}
deriving (AssociateAlias -> AssociateAlias -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateAlias -> AssociateAlias -> Bool
$c/= :: AssociateAlias -> AssociateAlias -> Bool
== :: AssociateAlias -> AssociateAlias -> Bool
$c== :: AssociateAlias -> AssociateAlias -> Bool
Prelude.Eq, ReadPrec [AssociateAlias]
ReadPrec AssociateAlias
Int -> ReadS AssociateAlias
ReadS [AssociateAlias]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateAlias]
$creadListPrec :: ReadPrec [AssociateAlias]
readPrec :: ReadPrec AssociateAlias
$creadPrec :: ReadPrec AssociateAlias
readList :: ReadS [AssociateAlias]
$creadList :: ReadS [AssociateAlias]
readsPrec :: Int -> ReadS AssociateAlias
$creadsPrec :: Int -> ReadS AssociateAlias
Prelude.Read, Int -> AssociateAlias -> ShowS
[AssociateAlias] -> ShowS
AssociateAlias -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateAlias] -> ShowS
$cshowList :: [AssociateAlias] -> ShowS
show :: AssociateAlias -> String
$cshow :: AssociateAlias -> String
showsPrec :: Int -> AssociateAlias -> ShowS
$cshowsPrec :: Int -> AssociateAlias -> ShowS
Prelude.Show, forall x. Rep AssociateAlias x -> AssociateAlias
forall x. AssociateAlias -> Rep AssociateAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateAlias x -> AssociateAlias
$cfrom :: forall x. AssociateAlias -> Rep AssociateAlias x
Prelude.Generic)
newAssociateAlias ::
Prelude.Text ->
Prelude.Text ->
AssociateAlias
newAssociateAlias :: Text -> Text -> AssociateAlias
newAssociateAlias Text
pTargetDistributionId_ Text
pAlias_ =
AssociateAlias'
{ $sel:targetDistributionId:AssociateAlias' :: Text
targetDistributionId =
Text
pTargetDistributionId_,
$sel:alias:AssociateAlias' :: Text
alias = Text
pAlias_
}
associateAlias_targetDistributionId :: Lens.Lens' AssociateAlias Prelude.Text
associateAlias_targetDistributionId :: Lens' AssociateAlias Text
associateAlias_targetDistributionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAlias' {Text
targetDistributionId :: Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
targetDistributionId} -> Text
targetDistributionId) (\s :: AssociateAlias
s@AssociateAlias' {} Text
a -> AssociateAlias
s {$sel:targetDistributionId:AssociateAlias' :: Text
targetDistributionId = Text
a} :: AssociateAlias)
associateAlias_alias :: Lens.Lens' AssociateAlias Prelude.Text
associateAlias_alias :: Lens' AssociateAlias Text
associateAlias_alias = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAlias' {Text
alias :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
alias} -> Text
alias) (\s :: AssociateAlias
s@AssociateAlias' {} Text
a -> AssociateAlias
s {$sel:alias:AssociateAlias' :: Text
alias = Text
a} :: AssociateAlias)
instance Core.AWSRequest AssociateAlias where
type
AWSResponse AssociateAlias =
AssociateAliasResponse
request :: (Service -> Service) -> AssociateAlias -> Request AssociateAlias
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.put (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AssociateAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AssociateAlias)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AssociateAliasResponse
AssociateAliasResponse'
instance Prelude.Hashable AssociateAlias where
hashWithSalt :: Int -> AssociateAlias -> Int
hashWithSalt Int
_salt AssociateAlias' {Text
alias :: Text
targetDistributionId :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
targetDistributionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
alias
instance Prelude.NFData AssociateAlias where
rnf :: AssociateAlias -> ()
rnf AssociateAlias' {Text
alias :: Text
targetDistributionId :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
targetDistributionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
alias
instance Data.ToHeaders AssociateAlias where
toHeaders :: AssociateAlias -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath AssociateAlias where
toPath :: AssociateAlias -> ByteString
toPath AssociateAlias' {Text
alias :: Text
targetDistributionId :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/distribution/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
targetDistributionId,
ByteString
"/associate-alias"
]
instance Data.ToQuery AssociateAlias where
toQuery :: AssociateAlias -> QueryString
toQuery AssociateAlias' {Text
alias :: Text
targetDistributionId :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Alias" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
alias]
data AssociateAliasResponse = AssociateAliasResponse'
{
}
deriving (AssociateAliasResponse -> AssociateAliasResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateAliasResponse -> AssociateAliasResponse -> Bool
$c/= :: AssociateAliasResponse -> AssociateAliasResponse -> Bool
== :: AssociateAliasResponse -> AssociateAliasResponse -> Bool
$c== :: AssociateAliasResponse -> AssociateAliasResponse -> Bool
Prelude.Eq, ReadPrec [AssociateAliasResponse]
ReadPrec AssociateAliasResponse
Int -> ReadS AssociateAliasResponse
ReadS [AssociateAliasResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateAliasResponse]
$creadListPrec :: ReadPrec [AssociateAliasResponse]
readPrec :: ReadPrec AssociateAliasResponse
$creadPrec :: ReadPrec AssociateAliasResponse
readList :: ReadS [AssociateAliasResponse]
$creadList :: ReadS [AssociateAliasResponse]
readsPrec :: Int -> ReadS AssociateAliasResponse
$creadsPrec :: Int -> ReadS AssociateAliasResponse
Prelude.Read, Int -> AssociateAliasResponse -> ShowS
[AssociateAliasResponse] -> ShowS
AssociateAliasResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateAliasResponse] -> ShowS
$cshowList :: [AssociateAliasResponse] -> ShowS
show :: AssociateAliasResponse -> String
$cshow :: AssociateAliasResponse -> String
showsPrec :: Int -> AssociateAliasResponse -> ShowS
$cshowsPrec :: Int -> AssociateAliasResponse -> ShowS
Prelude.Show, forall x. Rep AssociateAliasResponse x -> AssociateAliasResponse
forall x. AssociateAliasResponse -> Rep AssociateAliasResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateAliasResponse x -> AssociateAliasResponse
$cfrom :: forall x. AssociateAliasResponse -> Rep AssociateAliasResponse x
Prelude.Generic)
newAssociateAliasResponse ::
AssociateAliasResponse
newAssociateAliasResponse :: AssociateAliasResponse
newAssociateAliasResponse = AssociateAliasResponse
AssociateAliasResponse'
instance Prelude.NFData AssociateAliasResponse where
rnf :: AssociateAliasResponse -> ()
rnf AssociateAliasResponse
_ = ()