{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Lightsail.CreateLoadBalancerTLSCertificate
(
createLoadBalancerTLSCertificate
, CreateLoadBalancerTLSCertificate
, clbtcCertificateAlternativeNames
, clbtcLoadBalancerName
, clbtcCertificateName
, clbtcCertificateDomainName
, createLoadBalancerTLSCertificateResponse
, CreateLoadBalancerTLSCertificateResponse
, clbtcrsOperations
, clbtcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Lightsail.Types
import Network.AWS.Lightsail.Types.Product
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data CreateLoadBalancerTLSCertificate = CreateLoadBalancerTLSCertificate'
{ _clbtcCertificateAlternativeNames :: !(Maybe [Text])
, _clbtcLoadBalancerName :: !Text
, _clbtcCertificateName :: !Text
, _clbtcCertificateDomainName :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createLoadBalancerTLSCertificate
:: Text
-> Text
-> Text
-> CreateLoadBalancerTLSCertificate
createLoadBalancerTLSCertificate pLoadBalancerName_ pCertificateName_ pCertificateDomainName_ =
CreateLoadBalancerTLSCertificate'
{ _clbtcCertificateAlternativeNames = Nothing
, _clbtcLoadBalancerName = pLoadBalancerName_
, _clbtcCertificateName = pCertificateName_
, _clbtcCertificateDomainName = pCertificateDomainName_
}
clbtcCertificateAlternativeNames :: Lens' CreateLoadBalancerTLSCertificate [Text]
clbtcCertificateAlternativeNames = lens _clbtcCertificateAlternativeNames (\ s a -> s{_clbtcCertificateAlternativeNames = a}) . _Default . _Coerce
clbtcLoadBalancerName :: Lens' CreateLoadBalancerTLSCertificate Text
clbtcLoadBalancerName = lens _clbtcLoadBalancerName (\ s a -> s{_clbtcLoadBalancerName = a})
clbtcCertificateName :: Lens' CreateLoadBalancerTLSCertificate Text
clbtcCertificateName = lens _clbtcCertificateName (\ s a -> s{_clbtcCertificateName = a})
clbtcCertificateDomainName :: Lens' CreateLoadBalancerTLSCertificate Text
clbtcCertificateDomainName = lens _clbtcCertificateDomainName (\ s a -> s{_clbtcCertificateDomainName = a})
instance AWSRequest CreateLoadBalancerTLSCertificate
where
type Rs CreateLoadBalancerTLSCertificate =
CreateLoadBalancerTLSCertificateResponse
request = postJSON lightsail
response
= receiveJSON
(\ s h x ->
CreateLoadBalancerTLSCertificateResponse' <$>
(x .?> "operations" .!@ mempty) <*>
(pure (fromEnum s)))
instance Hashable CreateLoadBalancerTLSCertificate
where
instance NFData CreateLoadBalancerTLSCertificate
where
instance ToHeaders CreateLoadBalancerTLSCertificate
where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("Lightsail_20161128.CreateLoadBalancerTlsCertificate"
:: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON CreateLoadBalancerTLSCertificate
where
toJSON CreateLoadBalancerTLSCertificate'{..}
= object
(catMaybes
[("certificateAlternativeNames" .=) <$>
_clbtcCertificateAlternativeNames,
Just ("loadBalancerName" .= _clbtcLoadBalancerName),
Just ("certificateName" .= _clbtcCertificateName),
Just
("certificateDomainName" .=
_clbtcCertificateDomainName)])
instance ToPath CreateLoadBalancerTLSCertificate
where
toPath = const "/"
instance ToQuery CreateLoadBalancerTLSCertificate
where
toQuery = const mempty
data CreateLoadBalancerTLSCertificateResponse = CreateLoadBalancerTLSCertificateResponse'
{ _clbtcrsOperations :: !(Maybe [Operation])
, _clbtcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
createLoadBalancerTLSCertificateResponse
:: Int
-> CreateLoadBalancerTLSCertificateResponse
createLoadBalancerTLSCertificateResponse pResponseStatus_ =
CreateLoadBalancerTLSCertificateResponse'
{_clbtcrsOperations = Nothing, _clbtcrsResponseStatus = pResponseStatus_}
clbtcrsOperations :: Lens' CreateLoadBalancerTLSCertificateResponse [Operation]
clbtcrsOperations = lens _clbtcrsOperations (\ s a -> s{_clbtcrsOperations = a}) . _Default . _Coerce
clbtcrsResponseStatus :: Lens' CreateLoadBalancerTLSCertificateResponse Int
clbtcrsResponseStatus = lens _clbtcrsResponseStatus (\ s a -> s{_clbtcrsResponseStatus = a})
instance NFData
CreateLoadBalancerTLSCertificateResponse
where