{-# 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.Lens as Lens
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
(AssociateAlias -> AssociateAlias -> Bool)
-> (AssociateAlias -> AssociateAlias -> Bool) -> Eq AssociateAlias
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]
(Int -> ReadS AssociateAlias)
-> ReadS [AssociateAlias]
-> ReadPrec AssociateAlias
-> ReadPrec [AssociateAlias]
-> Read 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
(Int -> AssociateAlias -> ShowS)
-> (AssociateAlias -> String)
-> ([AssociateAlias] -> ShowS)
-> Show AssociateAlias
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. AssociateAlias -> Rep AssociateAlias x)
-> (forall x. Rep AssociateAlias x -> AssociateAlias)
-> Generic AssociateAlias
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' :: Text -> Text -> AssociateAlias
AssociateAlias'
{ $sel:targetDistributionId:AssociateAlias' :: Text
targetDistributionId =
Text
pTargetDistributionId_,
$sel:alias:AssociateAlias' :: Text
alias = Text
pAlias_
}
associateAlias_targetDistributionId :: Lens.Lens' AssociateAlias Prelude.Text
associateAlias_targetDistributionId :: (Text -> f Text) -> AssociateAlias -> f AssociateAlias
associateAlias_targetDistributionId = (AssociateAlias -> Text)
-> (AssociateAlias -> Text -> AssociateAlias)
-> Lens AssociateAlias AssociateAlias Text Text
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 :: (Text -> f Text) -> AssociateAlias -> f AssociateAlias
associateAlias_alias = (AssociateAlias -> Text)
-> (AssociateAlias -> Text -> AssociateAlias)
-> Lens AssociateAlias AssociateAlias Text Text
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 :: AssociateAlias -> Request AssociateAlias
request = Service -> AssociateAlias -> Request AssociateAlias
forall a. ToRequest a => Service -> a -> Request a
Request.put Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AssociateAlias)))
response =
AWSResponse AssociateAlias
-> Logger
-> Service
-> Proxy AssociateAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AssociateAlias)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse AssociateAlias
AssociateAliasResponse
AssociateAliasResponse'
instance Prelude.Hashable AssociateAlias
instance Prelude.NFData AssociateAlias
instance Core.ToHeaders AssociateAlias where
toHeaders :: AssociateAlias -> [Header]
toHeaders = [Header] -> AssociateAlias -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath AssociateAlias where
toPath :: AssociateAlias -> ByteString
toPath AssociateAlias' {Text
alias :: Text
targetDistributionId :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/distribution/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
targetDistributionId,
ByteString
"/associate-alias"
]
instance Core.ToQuery AssociateAlias where
toQuery :: AssociateAlias -> QueryString
toQuery AssociateAlias' {Text
alias :: Text
targetDistributionId :: Text
$sel:alias:AssociateAlias' :: AssociateAlias -> Text
$sel:targetDistributionId:AssociateAlias' :: AssociateAlias -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Alias" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
alias]
data AssociateAliasResponse = AssociateAliasResponse'
{
}
deriving (AssociateAliasResponse -> AssociateAliasResponse -> Bool
(AssociateAliasResponse -> AssociateAliasResponse -> Bool)
-> (AssociateAliasResponse -> AssociateAliasResponse -> Bool)
-> Eq AssociateAliasResponse
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]
(Int -> ReadS AssociateAliasResponse)
-> ReadS [AssociateAliasResponse]
-> ReadPrec AssociateAliasResponse
-> ReadPrec [AssociateAliasResponse]
-> Read 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
(Int -> AssociateAliasResponse -> ShowS)
-> (AssociateAliasResponse -> String)
-> ([AssociateAliasResponse] -> ShowS)
-> Show AssociateAliasResponse
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. AssociateAliasResponse -> Rep AssociateAliasResponse x)
-> (forall x.
Rep AssociateAliasResponse x -> AssociateAliasResponse)
-> Generic AssociateAliasResponse
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