{-# 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.WorkSpacesWeb.CreateTrustStore
(
CreateTrustStore (..),
newCreateTrustStore,
createTrustStore_clientToken,
createTrustStore_tags,
createTrustStore_certificateList,
CreateTrustStoreResponse (..),
newCreateTrustStoreResponse,
createTrustStoreResponse_httpStatus,
createTrustStoreResponse_trustStoreArn,
)
where
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
import Amazonka.WorkSpacesWeb.Types
data CreateTrustStore = CreateTrustStore'
{
CreateTrustStore -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
CreateTrustStore -> Maybe [Sensitive Tag]
tags :: Prelude.Maybe [Data.Sensitive Tag],
CreateTrustStore -> [Base64]
certificateList :: [Data.Base64]
}
deriving (CreateTrustStore -> CreateTrustStore -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrustStore -> CreateTrustStore -> Bool
$c/= :: CreateTrustStore -> CreateTrustStore -> Bool
== :: CreateTrustStore -> CreateTrustStore -> Bool
$c== :: CreateTrustStore -> CreateTrustStore -> Bool
Prelude.Eq, Int -> CreateTrustStore -> ShowS
[CreateTrustStore] -> ShowS
CreateTrustStore -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrustStore] -> ShowS
$cshowList :: [CreateTrustStore] -> ShowS
show :: CreateTrustStore -> String
$cshow :: CreateTrustStore -> String
showsPrec :: Int -> CreateTrustStore -> ShowS
$cshowsPrec :: Int -> CreateTrustStore -> ShowS
Prelude.Show, forall x. Rep CreateTrustStore x -> CreateTrustStore
forall x. CreateTrustStore -> Rep CreateTrustStore x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateTrustStore x -> CreateTrustStore
$cfrom :: forall x. CreateTrustStore -> Rep CreateTrustStore x
Prelude.Generic)
newCreateTrustStore ::
CreateTrustStore
newCreateTrustStore :: CreateTrustStore
newCreateTrustStore =
CreateTrustStore'
{ $sel:clientToken:CreateTrustStore' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateTrustStore' :: Maybe [Sensitive Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:certificateList:CreateTrustStore' :: [Base64]
certificateList = forall a. Monoid a => a
Prelude.mempty
}
createTrustStore_clientToken :: Lens.Lens' CreateTrustStore (Prelude.Maybe Prelude.Text)
createTrustStore_clientToken :: Lens' CreateTrustStore (Maybe Text)
createTrustStore_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrustStore' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateTrustStore' :: CreateTrustStore -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateTrustStore
s@CreateTrustStore' {} Maybe Text
a -> CreateTrustStore
s {$sel:clientToken:CreateTrustStore' :: Maybe Text
clientToken = Maybe Text
a} :: CreateTrustStore)
createTrustStore_tags :: Lens.Lens' CreateTrustStore (Prelude.Maybe [Tag])
createTrustStore_tags :: Lens' CreateTrustStore (Maybe [Tag])
createTrustStore_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrustStore' {Maybe [Sensitive Tag]
tags :: Maybe [Sensitive Tag]
$sel:tags:CreateTrustStore' :: CreateTrustStore -> Maybe [Sensitive Tag]
tags} -> Maybe [Sensitive Tag]
tags) (\s :: CreateTrustStore
s@CreateTrustStore' {} Maybe [Sensitive Tag]
a -> CreateTrustStore
s {$sel:tags:CreateTrustStore' :: Maybe [Sensitive Tag]
tags = Maybe [Sensitive Tag]
a} :: CreateTrustStore) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createTrustStore_certificateList :: Lens.Lens' CreateTrustStore [Prelude.ByteString]
createTrustStore_certificateList :: Lens' CreateTrustStore [ByteString]
createTrustStore_certificateList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrustStore' {[Base64]
certificateList :: [Base64]
$sel:certificateList:CreateTrustStore' :: CreateTrustStore -> [Base64]
certificateList} -> [Base64]
certificateList) (\s :: CreateTrustStore
s@CreateTrustStore' {} [Base64]
a -> CreateTrustStore
s {$sel:certificateList:CreateTrustStore' :: [Base64]
certificateList = [Base64]
a} :: CreateTrustStore) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest CreateTrustStore where
type
AWSResponse CreateTrustStore =
CreateTrustStoreResponse
request :: (Service -> Service)
-> CreateTrustStore -> Request CreateTrustStore
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateTrustStore
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateTrustStore)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Text -> CreateTrustStoreResponse
CreateTrustStoreResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"trustStoreArn")
)
instance Prelude.Hashable CreateTrustStore where
hashWithSalt :: Int -> CreateTrustStore -> Int
hashWithSalt Int
_salt CreateTrustStore' {[Base64]
Maybe [Sensitive Tag]
Maybe Text
certificateList :: [Base64]
tags :: Maybe [Sensitive Tag]
clientToken :: Maybe Text
$sel:certificateList:CreateTrustStore' :: CreateTrustStore -> [Base64]
$sel:tags:CreateTrustStore' :: CreateTrustStore -> Maybe [Sensitive Tag]
$sel:clientToken:CreateTrustStore' :: CreateTrustStore -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Sensitive Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Base64]
certificateList
instance Prelude.NFData CreateTrustStore where
rnf :: CreateTrustStore -> ()
rnf CreateTrustStore' {[Base64]
Maybe [Sensitive Tag]
Maybe Text
certificateList :: [Base64]
tags :: Maybe [Sensitive Tag]
clientToken :: Maybe Text
$sel:certificateList:CreateTrustStore' :: CreateTrustStore -> [Base64]
$sel:tags:CreateTrustStore' :: CreateTrustStore -> Maybe [Sensitive Tag]
$sel:clientToken:CreateTrustStore' :: CreateTrustStore -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sensitive Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Base64]
certificateList
instance Data.ToHeaders CreateTrustStore where
toHeaders :: CreateTrustStore -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateTrustStore where
toJSON :: CreateTrustStore -> Value
toJSON CreateTrustStore' {[Base64]
Maybe [Sensitive Tag]
Maybe Text
certificateList :: [Base64]
tags :: Maybe [Sensitive Tag]
clientToken :: Maybe Text
$sel:certificateList:CreateTrustStore' :: CreateTrustStore -> [Base64]
$sel:tags:CreateTrustStore' :: CreateTrustStore -> Maybe [Sensitive Tag]
$sel:clientToken:CreateTrustStore' :: CreateTrustStore -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
(Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Sensitive Tag]
tags,
forall a. a -> Maybe a
Prelude.Just
(Key
"certificateList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Base64]
certificateList)
]
)
instance Data.ToPath CreateTrustStore where
toPath :: CreateTrustStore -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/trustStores"
instance Data.ToQuery CreateTrustStore where
toQuery :: CreateTrustStore -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateTrustStoreResponse = CreateTrustStoreResponse'
{
CreateTrustStoreResponse -> Int
httpStatus :: Prelude.Int,
CreateTrustStoreResponse -> Text
trustStoreArn :: Prelude.Text
}
deriving (CreateTrustStoreResponse -> CreateTrustStoreResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateTrustStoreResponse -> CreateTrustStoreResponse -> Bool
$c/= :: CreateTrustStoreResponse -> CreateTrustStoreResponse -> Bool
== :: CreateTrustStoreResponse -> CreateTrustStoreResponse -> Bool
$c== :: CreateTrustStoreResponse -> CreateTrustStoreResponse -> Bool
Prelude.Eq, ReadPrec [CreateTrustStoreResponse]
ReadPrec CreateTrustStoreResponse
Int -> ReadS CreateTrustStoreResponse
ReadS [CreateTrustStoreResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateTrustStoreResponse]
$creadListPrec :: ReadPrec [CreateTrustStoreResponse]
readPrec :: ReadPrec CreateTrustStoreResponse
$creadPrec :: ReadPrec CreateTrustStoreResponse
readList :: ReadS [CreateTrustStoreResponse]
$creadList :: ReadS [CreateTrustStoreResponse]
readsPrec :: Int -> ReadS CreateTrustStoreResponse
$creadsPrec :: Int -> ReadS CreateTrustStoreResponse
Prelude.Read, Int -> CreateTrustStoreResponse -> ShowS
[CreateTrustStoreResponse] -> ShowS
CreateTrustStoreResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateTrustStoreResponse] -> ShowS
$cshowList :: [CreateTrustStoreResponse] -> ShowS
show :: CreateTrustStoreResponse -> String
$cshow :: CreateTrustStoreResponse -> String
showsPrec :: Int -> CreateTrustStoreResponse -> ShowS
$cshowsPrec :: Int -> CreateTrustStoreResponse -> ShowS
Prelude.Show, forall x.
Rep CreateTrustStoreResponse x -> CreateTrustStoreResponse
forall x.
CreateTrustStoreResponse -> Rep CreateTrustStoreResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateTrustStoreResponse x -> CreateTrustStoreResponse
$cfrom :: forall x.
CreateTrustStoreResponse -> Rep CreateTrustStoreResponse x
Prelude.Generic)
newCreateTrustStoreResponse ::
Prelude.Int ->
Prelude.Text ->
CreateTrustStoreResponse
newCreateTrustStoreResponse :: Int -> Text -> CreateTrustStoreResponse
newCreateTrustStoreResponse
Int
pHttpStatus_
Text
pTrustStoreArn_ =
CreateTrustStoreResponse'
{ $sel:httpStatus:CreateTrustStoreResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:trustStoreArn:CreateTrustStoreResponse' :: Text
trustStoreArn = Text
pTrustStoreArn_
}
createTrustStoreResponse_httpStatus :: Lens.Lens' CreateTrustStoreResponse Prelude.Int
createTrustStoreResponse_httpStatus :: Lens' CreateTrustStoreResponse Int
createTrustStoreResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrustStoreResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateTrustStoreResponse' :: CreateTrustStoreResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateTrustStoreResponse
s@CreateTrustStoreResponse' {} Int
a -> CreateTrustStoreResponse
s {$sel:httpStatus:CreateTrustStoreResponse' :: Int
httpStatus = Int
a} :: CreateTrustStoreResponse)
createTrustStoreResponse_trustStoreArn :: Lens.Lens' CreateTrustStoreResponse Prelude.Text
createTrustStoreResponse_trustStoreArn :: Lens' CreateTrustStoreResponse Text
createTrustStoreResponse_trustStoreArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateTrustStoreResponse' {Text
trustStoreArn :: Text
$sel:trustStoreArn:CreateTrustStoreResponse' :: CreateTrustStoreResponse -> Text
trustStoreArn} -> Text
trustStoreArn) (\s :: CreateTrustStoreResponse
s@CreateTrustStoreResponse' {} Text
a -> CreateTrustStoreResponse
s {$sel:trustStoreArn:CreateTrustStoreResponse' :: Text
trustStoreArn = Text
a} :: CreateTrustStoreResponse)
instance Prelude.NFData CreateTrustStoreResponse where
rnf :: CreateTrustStoreResponse -> ()
rnf CreateTrustStoreResponse' {Int
Text
trustStoreArn :: Text
httpStatus :: Int
$sel:trustStoreArn:CreateTrustStoreResponse' :: CreateTrustStoreResponse -> Text
$sel:httpStatus:CreateTrustStoreResponse' :: CreateTrustStoreResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
trustStoreArn