{-# 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.AlexaBusiness.CreateGatewayGroup
(
CreateGatewayGroup (..),
newCreateGatewayGroup,
createGatewayGroup_description,
createGatewayGroup_tags,
createGatewayGroup_name,
createGatewayGroup_clientRequestToken,
CreateGatewayGroupResponse (..),
newCreateGatewayGroupResponse,
createGatewayGroupResponse_gatewayGroupArn,
createGatewayGroupResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.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 CreateGatewayGroup = CreateGatewayGroup'
{
CreateGatewayGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateGatewayGroup -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
CreateGatewayGroup -> Text
name :: Prelude.Text,
CreateGatewayGroup -> Text
clientRequestToken :: Prelude.Text
}
deriving (CreateGatewayGroup -> CreateGatewayGroup -> Bool
(CreateGatewayGroup -> CreateGatewayGroup -> Bool)
-> (CreateGatewayGroup -> CreateGatewayGroup -> Bool)
-> Eq CreateGatewayGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGatewayGroup -> CreateGatewayGroup -> Bool
$c/= :: CreateGatewayGroup -> CreateGatewayGroup -> Bool
== :: CreateGatewayGroup -> CreateGatewayGroup -> Bool
$c== :: CreateGatewayGroup -> CreateGatewayGroup -> Bool
Prelude.Eq, ReadPrec [CreateGatewayGroup]
ReadPrec CreateGatewayGroup
Int -> ReadS CreateGatewayGroup
ReadS [CreateGatewayGroup]
(Int -> ReadS CreateGatewayGroup)
-> ReadS [CreateGatewayGroup]
-> ReadPrec CreateGatewayGroup
-> ReadPrec [CreateGatewayGroup]
-> Read CreateGatewayGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGatewayGroup]
$creadListPrec :: ReadPrec [CreateGatewayGroup]
readPrec :: ReadPrec CreateGatewayGroup
$creadPrec :: ReadPrec CreateGatewayGroup
readList :: ReadS [CreateGatewayGroup]
$creadList :: ReadS [CreateGatewayGroup]
readsPrec :: Int -> ReadS CreateGatewayGroup
$creadsPrec :: Int -> ReadS CreateGatewayGroup
Prelude.Read, Int -> CreateGatewayGroup -> ShowS
[CreateGatewayGroup] -> ShowS
CreateGatewayGroup -> String
(Int -> CreateGatewayGroup -> ShowS)
-> (CreateGatewayGroup -> String)
-> ([CreateGatewayGroup] -> ShowS)
-> Show CreateGatewayGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGatewayGroup] -> ShowS
$cshowList :: [CreateGatewayGroup] -> ShowS
show :: CreateGatewayGroup -> String
$cshow :: CreateGatewayGroup -> String
showsPrec :: Int -> CreateGatewayGroup -> ShowS
$cshowsPrec :: Int -> CreateGatewayGroup -> ShowS
Prelude.Show, (forall x. CreateGatewayGroup -> Rep CreateGatewayGroup x)
-> (forall x. Rep CreateGatewayGroup x -> CreateGatewayGroup)
-> Generic CreateGatewayGroup
forall x. Rep CreateGatewayGroup x -> CreateGatewayGroup
forall x. CreateGatewayGroup -> Rep CreateGatewayGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateGatewayGroup x -> CreateGatewayGroup
$cfrom :: forall x. CreateGatewayGroup -> Rep CreateGatewayGroup x
Prelude.Generic)
newCreateGatewayGroup ::
Prelude.Text ->
Prelude.Text ->
CreateGatewayGroup
newCreateGatewayGroup :: Text -> Text -> CreateGatewayGroup
newCreateGatewayGroup Text
pName_ Text
pClientRequestToken_ =
CreateGatewayGroup' :: Maybe Text -> Maybe [Tag] -> Text -> Text -> CreateGatewayGroup
CreateGatewayGroup'
{ $sel:description:CreateGatewayGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateGatewayGroup' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateGatewayGroup' :: Text
name = Text
pName_,
$sel:clientRequestToken:CreateGatewayGroup' :: Text
clientRequestToken = Text
pClientRequestToken_
}
createGatewayGroup_description :: Lens.Lens' CreateGatewayGroup (Prelude.Maybe Prelude.Text)
createGatewayGroup_description :: (Maybe Text -> f (Maybe Text))
-> CreateGatewayGroup -> f CreateGatewayGroup
createGatewayGroup_description = (CreateGatewayGroup -> Maybe Text)
-> (CreateGatewayGroup -> Maybe Text -> CreateGatewayGroup)
-> Lens
CreateGatewayGroup CreateGatewayGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGatewayGroup' {Maybe Text
description :: Maybe Text
$sel:description:CreateGatewayGroup' :: CreateGatewayGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateGatewayGroup
s@CreateGatewayGroup' {} Maybe Text
a -> CreateGatewayGroup
s {$sel:description:CreateGatewayGroup' :: Maybe Text
description = Maybe Text
a} :: CreateGatewayGroup)
createGatewayGroup_tags :: Lens.Lens' CreateGatewayGroup (Prelude.Maybe [Tag])
createGatewayGroup_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateGatewayGroup -> f CreateGatewayGroup
createGatewayGroup_tags = (CreateGatewayGroup -> Maybe [Tag])
-> (CreateGatewayGroup -> Maybe [Tag] -> CreateGatewayGroup)
-> Lens
CreateGatewayGroup CreateGatewayGroup (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGatewayGroup' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateGatewayGroup' :: CreateGatewayGroup -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateGatewayGroup
s@CreateGatewayGroup' {} Maybe [Tag]
a -> CreateGatewayGroup
s {$sel:tags:CreateGatewayGroup' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateGatewayGroup) ((Maybe [Tag] -> f (Maybe [Tag]))
-> CreateGatewayGroup -> f CreateGatewayGroup)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateGatewayGroup
-> f CreateGatewayGroup
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
createGatewayGroup_name :: Lens.Lens' CreateGatewayGroup Prelude.Text
createGatewayGroup_name :: (Text -> f Text) -> CreateGatewayGroup -> f CreateGatewayGroup
createGatewayGroup_name = (CreateGatewayGroup -> Text)
-> (CreateGatewayGroup -> Text -> CreateGatewayGroup)
-> Lens CreateGatewayGroup CreateGatewayGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGatewayGroup' {Text
name :: Text
$sel:name:CreateGatewayGroup' :: CreateGatewayGroup -> Text
name} -> Text
name) (\s :: CreateGatewayGroup
s@CreateGatewayGroup' {} Text
a -> CreateGatewayGroup
s {$sel:name:CreateGatewayGroup' :: Text
name = Text
a} :: CreateGatewayGroup)
createGatewayGroup_clientRequestToken :: Lens.Lens' CreateGatewayGroup Prelude.Text
createGatewayGroup_clientRequestToken :: (Text -> f Text) -> CreateGatewayGroup -> f CreateGatewayGroup
createGatewayGroup_clientRequestToken = (CreateGatewayGroup -> Text)
-> (CreateGatewayGroup -> Text -> CreateGatewayGroup)
-> Lens CreateGatewayGroup CreateGatewayGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGatewayGroup' {Text
clientRequestToken :: Text
$sel:clientRequestToken:CreateGatewayGroup' :: CreateGatewayGroup -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: CreateGatewayGroup
s@CreateGatewayGroup' {} Text
a -> CreateGatewayGroup
s {$sel:clientRequestToken:CreateGatewayGroup' :: Text
clientRequestToken = Text
a} :: CreateGatewayGroup)
instance Core.AWSRequest CreateGatewayGroup where
type
AWSResponse CreateGatewayGroup =
CreateGatewayGroupResponse
request :: CreateGatewayGroup -> Request CreateGatewayGroup
request = Service -> CreateGatewayGroup -> Request CreateGatewayGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateGatewayGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateGatewayGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateGatewayGroup))
-> Logger
-> Service
-> Proxy CreateGatewayGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateGatewayGroup)))
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 Text -> Int -> CreateGatewayGroupResponse
CreateGatewayGroupResponse'
(Maybe Text -> Int -> CreateGatewayGroupResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateGatewayGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GatewayGroupArn")
Either String (Int -> CreateGatewayGroupResponse)
-> Either String Int -> Either String CreateGatewayGroupResponse
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 CreateGatewayGroup
instance Prelude.NFData CreateGatewayGroup
instance Core.ToHeaders CreateGatewayGroup where
toHeaders :: CreateGatewayGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateGatewayGroup -> 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
"AlexaForBusiness.CreateGatewayGroup" ::
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 CreateGatewayGroup where
toJSON :: CreateGatewayGroup -> Value
toJSON CreateGatewayGroup' {Maybe [Tag]
Maybe Text
Text
clientRequestToken :: Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe Text
$sel:clientRequestToken:CreateGatewayGroup' :: CreateGatewayGroup -> Text
$sel:name:CreateGatewayGroup' :: CreateGatewayGroup -> Text
$sel:tags:CreateGatewayGroup' :: CreateGatewayGroup -> Maybe [Tag]
$sel:description:CreateGatewayGroup' :: CreateGatewayGroup -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
(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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientRequestToken)
]
)
instance Core.ToPath CreateGatewayGroup where
toPath :: CreateGatewayGroup -> ByteString
toPath = ByteString -> CreateGatewayGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery CreateGatewayGroup where
toQuery :: CreateGatewayGroup -> QueryString
toQuery = QueryString -> CreateGatewayGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateGatewayGroupResponse = CreateGatewayGroupResponse'
{
CreateGatewayGroupResponse -> Maybe Text
gatewayGroupArn :: Prelude.Maybe Prelude.Text,
CreateGatewayGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateGatewayGroupResponse -> CreateGatewayGroupResponse -> Bool
(CreateGatewayGroupResponse -> CreateGatewayGroupResponse -> Bool)
-> (CreateGatewayGroupResponse
-> CreateGatewayGroupResponse -> Bool)
-> Eq CreateGatewayGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateGatewayGroupResponse -> CreateGatewayGroupResponse -> Bool
$c/= :: CreateGatewayGroupResponse -> CreateGatewayGroupResponse -> Bool
== :: CreateGatewayGroupResponse -> CreateGatewayGroupResponse -> Bool
$c== :: CreateGatewayGroupResponse -> CreateGatewayGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateGatewayGroupResponse]
ReadPrec CreateGatewayGroupResponse
Int -> ReadS CreateGatewayGroupResponse
ReadS [CreateGatewayGroupResponse]
(Int -> ReadS CreateGatewayGroupResponse)
-> ReadS [CreateGatewayGroupResponse]
-> ReadPrec CreateGatewayGroupResponse
-> ReadPrec [CreateGatewayGroupResponse]
-> Read CreateGatewayGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateGatewayGroupResponse]
$creadListPrec :: ReadPrec [CreateGatewayGroupResponse]
readPrec :: ReadPrec CreateGatewayGroupResponse
$creadPrec :: ReadPrec CreateGatewayGroupResponse
readList :: ReadS [CreateGatewayGroupResponse]
$creadList :: ReadS [CreateGatewayGroupResponse]
readsPrec :: Int -> ReadS CreateGatewayGroupResponse
$creadsPrec :: Int -> ReadS CreateGatewayGroupResponse
Prelude.Read, Int -> CreateGatewayGroupResponse -> ShowS
[CreateGatewayGroupResponse] -> ShowS
CreateGatewayGroupResponse -> String
(Int -> CreateGatewayGroupResponse -> ShowS)
-> (CreateGatewayGroupResponse -> String)
-> ([CreateGatewayGroupResponse] -> ShowS)
-> Show CreateGatewayGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateGatewayGroupResponse] -> ShowS
$cshowList :: [CreateGatewayGroupResponse] -> ShowS
show :: CreateGatewayGroupResponse -> String
$cshow :: CreateGatewayGroupResponse -> String
showsPrec :: Int -> CreateGatewayGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateGatewayGroupResponse -> ShowS
Prelude.Show, (forall x.
CreateGatewayGroupResponse -> Rep CreateGatewayGroupResponse x)
-> (forall x.
Rep CreateGatewayGroupResponse x -> CreateGatewayGroupResponse)
-> Generic CreateGatewayGroupResponse
forall x.
Rep CreateGatewayGroupResponse x -> CreateGatewayGroupResponse
forall x.
CreateGatewayGroupResponse -> Rep CreateGatewayGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateGatewayGroupResponse x -> CreateGatewayGroupResponse
$cfrom :: forall x.
CreateGatewayGroupResponse -> Rep CreateGatewayGroupResponse x
Prelude.Generic)
newCreateGatewayGroupResponse ::
Prelude.Int ->
CreateGatewayGroupResponse
newCreateGatewayGroupResponse :: Int -> CreateGatewayGroupResponse
newCreateGatewayGroupResponse Int
pHttpStatus_ =
CreateGatewayGroupResponse' :: Maybe Text -> Int -> CreateGatewayGroupResponse
CreateGatewayGroupResponse'
{ $sel:gatewayGroupArn:CreateGatewayGroupResponse' :: Maybe Text
gatewayGroupArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateGatewayGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createGatewayGroupResponse_gatewayGroupArn :: Lens.Lens' CreateGatewayGroupResponse (Prelude.Maybe Prelude.Text)
createGatewayGroupResponse_gatewayGroupArn :: (Maybe Text -> f (Maybe Text))
-> CreateGatewayGroupResponse -> f CreateGatewayGroupResponse
createGatewayGroupResponse_gatewayGroupArn = (CreateGatewayGroupResponse -> Maybe Text)
-> (CreateGatewayGroupResponse
-> Maybe Text -> CreateGatewayGroupResponse)
-> Lens
CreateGatewayGroupResponse
CreateGatewayGroupResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGatewayGroupResponse' {Maybe Text
gatewayGroupArn :: Maybe Text
$sel:gatewayGroupArn:CreateGatewayGroupResponse' :: CreateGatewayGroupResponse -> Maybe Text
gatewayGroupArn} -> Maybe Text
gatewayGroupArn) (\s :: CreateGatewayGroupResponse
s@CreateGatewayGroupResponse' {} Maybe Text
a -> CreateGatewayGroupResponse
s {$sel:gatewayGroupArn:CreateGatewayGroupResponse' :: Maybe Text
gatewayGroupArn = Maybe Text
a} :: CreateGatewayGroupResponse)
createGatewayGroupResponse_httpStatus :: Lens.Lens' CreateGatewayGroupResponse Prelude.Int
createGatewayGroupResponse_httpStatus :: (Int -> f Int)
-> CreateGatewayGroupResponse -> f CreateGatewayGroupResponse
createGatewayGroupResponse_httpStatus = (CreateGatewayGroupResponse -> Int)
-> (CreateGatewayGroupResponse
-> Int -> CreateGatewayGroupResponse)
-> Lens
CreateGatewayGroupResponse CreateGatewayGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateGatewayGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateGatewayGroupResponse' :: CreateGatewayGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateGatewayGroupResponse
s@CreateGatewayGroupResponse' {} Int
a -> CreateGatewayGroupResponse
s {$sel:httpStatus:CreateGatewayGroupResponse' :: Int
httpStatus = Int
a} :: CreateGatewayGroupResponse)
instance Prelude.NFData CreateGatewayGroupResponse