{-# 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.APIGateway.CreateRestApi
(
CreateRestApi (..),
newCreateRestApi,
createRestApi_minimumCompressionSize,
createRestApi_disableExecuteApiEndpoint,
createRestApi_binaryMediaTypes,
createRestApi_version,
createRestApi_apiKeySource,
createRestApi_cloneFrom,
createRestApi_policy,
createRestApi_endpointConfiguration,
createRestApi_description,
createRestApi_tags,
createRestApi_name,
RestApi (..),
newRestApi,
restApi_minimumCompressionSize,
restApi_disableExecuteApiEndpoint,
restApi_binaryMediaTypes,
restApi_warnings,
restApi_createdDate,
restApi_name,
restApi_version,
restApi_apiKeySource,
restApi_id,
restApi_policy,
restApi_endpointConfiguration,
restApi_description,
restApi_tags,
)
where
import Amazonka.APIGateway.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 CreateRestApi = CreateRestApi'
{
CreateRestApi -> Maybe Int
minimumCompressionSize :: Prelude.Maybe Prelude.Int,
CreateRestApi -> Maybe Bool
disableExecuteApiEndpoint :: Prelude.Maybe Prelude.Bool,
CreateRestApi -> Maybe [Text]
binaryMediaTypes :: Prelude.Maybe [Prelude.Text],
CreateRestApi -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
CreateRestApi -> Maybe ApiKeySourceType
apiKeySource :: Prelude.Maybe ApiKeySourceType,
CreateRestApi -> Maybe Text
cloneFrom :: Prelude.Maybe Prelude.Text,
CreateRestApi -> Maybe Text
policy :: Prelude.Maybe Prelude.Text,
CreateRestApi -> Maybe EndpointConfiguration
endpointConfiguration :: Prelude.Maybe EndpointConfiguration,
CreateRestApi -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateRestApi -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateRestApi -> Text
name :: Prelude.Text
}
deriving (CreateRestApi -> CreateRestApi -> Bool
(CreateRestApi -> CreateRestApi -> Bool)
-> (CreateRestApi -> CreateRestApi -> Bool) -> Eq CreateRestApi
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRestApi -> CreateRestApi -> Bool
$c/= :: CreateRestApi -> CreateRestApi -> Bool
== :: CreateRestApi -> CreateRestApi -> Bool
$c== :: CreateRestApi -> CreateRestApi -> Bool
Prelude.Eq, ReadPrec [CreateRestApi]
ReadPrec CreateRestApi
Int -> ReadS CreateRestApi
ReadS [CreateRestApi]
(Int -> ReadS CreateRestApi)
-> ReadS [CreateRestApi]
-> ReadPrec CreateRestApi
-> ReadPrec [CreateRestApi]
-> Read CreateRestApi
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRestApi]
$creadListPrec :: ReadPrec [CreateRestApi]
readPrec :: ReadPrec CreateRestApi
$creadPrec :: ReadPrec CreateRestApi
readList :: ReadS [CreateRestApi]
$creadList :: ReadS [CreateRestApi]
readsPrec :: Int -> ReadS CreateRestApi
$creadsPrec :: Int -> ReadS CreateRestApi
Prelude.Read, Int -> CreateRestApi -> ShowS
[CreateRestApi] -> ShowS
CreateRestApi -> String
(Int -> CreateRestApi -> ShowS)
-> (CreateRestApi -> String)
-> ([CreateRestApi] -> ShowS)
-> Show CreateRestApi
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRestApi] -> ShowS
$cshowList :: [CreateRestApi] -> ShowS
show :: CreateRestApi -> String
$cshow :: CreateRestApi -> String
showsPrec :: Int -> CreateRestApi -> ShowS
$cshowsPrec :: Int -> CreateRestApi -> ShowS
Prelude.Show, (forall x. CreateRestApi -> Rep CreateRestApi x)
-> (forall x. Rep CreateRestApi x -> CreateRestApi)
-> Generic CreateRestApi
forall x. Rep CreateRestApi x -> CreateRestApi
forall x. CreateRestApi -> Rep CreateRestApi x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRestApi x -> CreateRestApi
$cfrom :: forall x. CreateRestApi -> Rep CreateRestApi x
Prelude.Generic)
newCreateRestApi ::
Prelude.Text ->
CreateRestApi
newCreateRestApi :: Text -> CreateRestApi
newCreateRestApi Text
pName_ =
CreateRestApi' :: Maybe Int
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe ApiKeySourceType
-> Maybe Text
-> Maybe Text
-> Maybe EndpointConfiguration
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> CreateRestApi
CreateRestApi'
{ $sel:minimumCompressionSize:CreateRestApi' :: Maybe Int
minimumCompressionSize =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:disableExecuteApiEndpoint:CreateRestApi' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:binaryMediaTypes:CreateRestApi' :: Maybe [Text]
binaryMediaTypes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:version:CreateRestApi' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:apiKeySource:CreateRestApi' :: Maybe ApiKeySourceType
apiKeySource = Maybe ApiKeySourceType
forall a. Maybe a
Prelude.Nothing,
$sel:cloneFrom:CreateRestApi' :: Maybe Text
cloneFrom = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:policy:CreateRestApi' :: Maybe Text
policy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointConfiguration:CreateRestApi' :: Maybe EndpointConfiguration
endpointConfiguration = Maybe EndpointConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateRestApi' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateRestApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateRestApi' :: Text
name = Text
pName_
}
createRestApi_minimumCompressionSize :: Lens.Lens' CreateRestApi (Prelude.Maybe Prelude.Int)
createRestApi_minimumCompressionSize :: (Maybe Int -> f (Maybe Int)) -> CreateRestApi -> f CreateRestApi
createRestApi_minimumCompressionSize = (CreateRestApi -> Maybe Int)
-> (CreateRestApi -> Maybe Int -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe Int
minimumCompressionSize :: Maybe Int
$sel:minimumCompressionSize:CreateRestApi' :: CreateRestApi -> Maybe Int
minimumCompressionSize} -> Maybe Int
minimumCompressionSize) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe Int
a -> CreateRestApi
s {$sel:minimumCompressionSize:CreateRestApi' :: Maybe Int
minimumCompressionSize = Maybe Int
a} :: CreateRestApi)
createRestApi_disableExecuteApiEndpoint :: Lens.Lens' CreateRestApi (Prelude.Maybe Prelude.Bool)
createRestApi_disableExecuteApiEndpoint :: (Maybe Bool -> f (Maybe Bool)) -> CreateRestApi -> f CreateRestApi
createRestApi_disableExecuteApiEndpoint = (CreateRestApi -> Maybe Bool)
-> (CreateRestApi -> Maybe Bool -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe Bool
disableExecuteApiEndpoint :: Maybe Bool
$sel:disableExecuteApiEndpoint:CreateRestApi' :: CreateRestApi -> Maybe Bool
disableExecuteApiEndpoint} -> Maybe Bool
disableExecuteApiEndpoint) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe Bool
a -> CreateRestApi
s {$sel:disableExecuteApiEndpoint:CreateRestApi' :: Maybe Bool
disableExecuteApiEndpoint = Maybe Bool
a} :: CreateRestApi)
createRestApi_binaryMediaTypes :: Lens.Lens' CreateRestApi (Prelude.Maybe [Prelude.Text])
createRestApi_binaryMediaTypes :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateRestApi -> f CreateRestApi
createRestApi_binaryMediaTypes = (CreateRestApi -> Maybe [Text])
-> (CreateRestApi -> Maybe [Text] -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe [Text]
binaryMediaTypes :: Maybe [Text]
$sel:binaryMediaTypes:CreateRestApi' :: CreateRestApi -> Maybe [Text]
binaryMediaTypes} -> Maybe [Text]
binaryMediaTypes) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe [Text]
a -> CreateRestApi
s {$sel:binaryMediaTypes:CreateRestApi' :: Maybe [Text]
binaryMediaTypes = Maybe [Text]
a} :: CreateRestApi) ((Maybe [Text] -> f (Maybe [Text]))
-> CreateRestApi -> f CreateRestApi)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateRestApi
-> f CreateRestApi
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createRestApi_version :: Lens.Lens' CreateRestApi (Prelude.Maybe Prelude.Text)
createRestApi_version :: (Maybe Text -> f (Maybe Text)) -> CreateRestApi -> f CreateRestApi
createRestApi_version = (CreateRestApi -> Maybe Text)
-> (CreateRestApi -> Maybe Text -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe Text
version :: Maybe Text
$sel:version:CreateRestApi' :: CreateRestApi -> Maybe Text
version} -> Maybe Text
version) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe Text
a -> CreateRestApi
s {$sel:version:CreateRestApi' :: Maybe Text
version = Maybe Text
a} :: CreateRestApi)
createRestApi_apiKeySource :: Lens.Lens' CreateRestApi (Prelude.Maybe ApiKeySourceType)
createRestApi_apiKeySource :: (Maybe ApiKeySourceType -> f (Maybe ApiKeySourceType))
-> CreateRestApi -> f CreateRestApi
createRestApi_apiKeySource = (CreateRestApi -> Maybe ApiKeySourceType)
-> (CreateRestApi -> Maybe ApiKeySourceType -> CreateRestApi)
-> Lens
CreateRestApi
CreateRestApi
(Maybe ApiKeySourceType)
(Maybe ApiKeySourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe ApiKeySourceType
apiKeySource :: Maybe ApiKeySourceType
$sel:apiKeySource:CreateRestApi' :: CreateRestApi -> Maybe ApiKeySourceType
apiKeySource} -> Maybe ApiKeySourceType
apiKeySource) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe ApiKeySourceType
a -> CreateRestApi
s {$sel:apiKeySource:CreateRestApi' :: Maybe ApiKeySourceType
apiKeySource = Maybe ApiKeySourceType
a} :: CreateRestApi)
createRestApi_cloneFrom :: Lens.Lens' CreateRestApi (Prelude.Maybe Prelude.Text)
createRestApi_cloneFrom :: (Maybe Text -> f (Maybe Text)) -> CreateRestApi -> f CreateRestApi
createRestApi_cloneFrom = (CreateRestApi -> Maybe Text)
-> (CreateRestApi -> Maybe Text -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe Text
cloneFrom :: Maybe Text
$sel:cloneFrom:CreateRestApi' :: CreateRestApi -> Maybe Text
cloneFrom} -> Maybe Text
cloneFrom) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe Text
a -> CreateRestApi
s {$sel:cloneFrom:CreateRestApi' :: Maybe Text
cloneFrom = Maybe Text
a} :: CreateRestApi)
createRestApi_policy :: Lens.Lens' CreateRestApi (Prelude.Maybe Prelude.Text)
createRestApi_policy :: (Maybe Text -> f (Maybe Text)) -> CreateRestApi -> f CreateRestApi
createRestApi_policy = (CreateRestApi -> Maybe Text)
-> (CreateRestApi -> Maybe Text -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe Text
policy :: Maybe Text
$sel:policy:CreateRestApi' :: CreateRestApi -> Maybe Text
policy} -> Maybe Text
policy) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe Text
a -> CreateRestApi
s {$sel:policy:CreateRestApi' :: Maybe Text
policy = Maybe Text
a} :: CreateRestApi)
createRestApi_endpointConfiguration :: Lens.Lens' CreateRestApi (Prelude.Maybe EndpointConfiguration)
createRestApi_endpointConfiguration :: (Maybe EndpointConfiguration -> f (Maybe EndpointConfiguration))
-> CreateRestApi -> f CreateRestApi
createRestApi_endpointConfiguration = (CreateRestApi -> Maybe EndpointConfiguration)
-> (CreateRestApi -> Maybe EndpointConfiguration -> CreateRestApi)
-> Lens
CreateRestApi
CreateRestApi
(Maybe EndpointConfiguration)
(Maybe EndpointConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe EndpointConfiguration
endpointConfiguration :: Maybe EndpointConfiguration
$sel:endpointConfiguration:CreateRestApi' :: CreateRestApi -> Maybe EndpointConfiguration
endpointConfiguration} -> Maybe EndpointConfiguration
endpointConfiguration) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe EndpointConfiguration
a -> CreateRestApi
s {$sel:endpointConfiguration:CreateRestApi' :: Maybe EndpointConfiguration
endpointConfiguration = Maybe EndpointConfiguration
a} :: CreateRestApi)
createRestApi_description :: Lens.Lens' CreateRestApi (Prelude.Maybe Prelude.Text)
createRestApi_description :: (Maybe Text -> f (Maybe Text)) -> CreateRestApi -> f CreateRestApi
createRestApi_description = (CreateRestApi -> Maybe Text)
-> (CreateRestApi -> Maybe Text -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe Text
description :: Maybe Text
$sel:description:CreateRestApi' :: CreateRestApi -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe Text
a -> CreateRestApi
s {$sel:description:CreateRestApi' :: Maybe Text
description = Maybe Text
a} :: CreateRestApi)
createRestApi_tags :: Lens.Lens' CreateRestApi (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRestApi_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRestApi -> f CreateRestApi
createRestApi_tags = (CreateRestApi -> Maybe (HashMap Text Text))
-> (CreateRestApi -> Maybe (HashMap Text Text) -> CreateRestApi)
-> Lens
CreateRestApi
CreateRestApi
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateRestApi' :: CreateRestApi -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateRestApi
s@CreateRestApi' {} Maybe (HashMap Text Text)
a -> CreateRestApi
s {$sel:tags:CreateRestApi' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateRestApi) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRestApi -> f CreateRestApi)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRestApi
-> f CreateRestApi
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createRestApi_name :: Lens.Lens' CreateRestApi Prelude.Text
createRestApi_name :: (Text -> f Text) -> CreateRestApi -> f CreateRestApi
createRestApi_name = (CreateRestApi -> Text)
-> (CreateRestApi -> Text -> CreateRestApi)
-> Lens CreateRestApi CreateRestApi Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRestApi' {Text
name :: Text
$sel:name:CreateRestApi' :: CreateRestApi -> Text
name} -> Text
name) (\s :: CreateRestApi
s@CreateRestApi' {} Text
a -> CreateRestApi
s {$sel:name:CreateRestApi' :: Text
name = Text
a} :: CreateRestApi)
instance Core.AWSRequest CreateRestApi where
type AWSResponse CreateRestApi = RestApi
request :: CreateRestApi -> Request CreateRestApi
request = Service -> CreateRestApi -> Request CreateRestApi
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateRestApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRestApi)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateRestApi))
-> Logger
-> Service
-> Proxy CreateRestApi
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRestApi)))
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 -> Object -> Either String RestApi
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable CreateRestApi
instance Prelude.NFData CreateRestApi
instance Core.ToHeaders CreateRestApi where
toHeaders :: CreateRestApi -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateRestApi -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToJSON CreateRestApi where
toJSON :: CreateRestApi -> Value
toJSON CreateRestApi' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Maybe (HashMap Text Text)
Maybe ApiKeySourceType
Maybe EndpointConfiguration
Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
endpointConfiguration :: Maybe EndpointConfiguration
policy :: Maybe Text
cloneFrom :: Maybe Text
apiKeySource :: Maybe ApiKeySourceType
version :: Maybe Text
binaryMediaTypes :: Maybe [Text]
disableExecuteApiEndpoint :: Maybe Bool
minimumCompressionSize :: Maybe Int
$sel:name:CreateRestApi' :: CreateRestApi -> Text
$sel:tags:CreateRestApi' :: CreateRestApi -> Maybe (HashMap Text Text)
$sel:description:CreateRestApi' :: CreateRestApi -> Maybe Text
$sel:endpointConfiguration:CreateRestApi' :: CreateRestApi -> Maybe EndpointConfiguration
$sel:policy:CreateRestApi' :: CreateRestApi -> Maybe Text
$sel:cloneFrom:CreateRestApi' :: CreateRestApi -> Maybe Text
$sel:apiKeySource:CreateRestApi' :: CreateRestApi -> Maybe ApiKeySourceType
$sel:version:CreateRestApi' :: CreateRestApi -> Maybe Text
$sel:binaryMediaTypes:CreateRestApi' :: CreateRestApi -> Maybe [Text]
$sel:disableExecuteApiEndpoint:CreateRestApi' :: CreateRestApi -> Maybe Bool
$sel:minimumCompressionSize:CreateRestApi' :: CreateRestApi -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"minimumCompressionSize" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
minimumCompressionSize,
(Text
"disableExecuteApiEndpoint" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableExecuteApiEndpoint,
(Text
"binaryMediaTypes" 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]
binaryMediaTypes,
(Text
"version" 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
version,
(Text
"apiKeySource" Text -> ApiKeySourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ApiKeySourceType -> Pair) -> Maybe ApiKeySourceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ApiKeySourceType
apiKeySource,
(Text
"cloneFrom" 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
cloneFrom,
(Text
"policy" 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
policy,
(Text
"endpointConfiguration" Text -> EndpointConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EndpointConfiguration -> Pair)
-> Maybe EndpointConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointConfiguration
endpointConfiguration,
(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 -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
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)
]
)
instance Core.ToPath CreateRestApi where
toPath :: CreateRestApi -> ByteString
toPath = ByteString -> CreateRestApi -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/restapis"
instance Core.ToQuery CreateRestApi where
toQuery :: CreateRestApi -> QueryString
toQuery = QueryString -> CreateRestApi -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty