{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.APIGateway.CreateApiKey
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create an ApiKey resource.
module Amazonka.APIGateway.CreateApiKey
  ( -- * Creating a Request
    CreateApiKey (..),
    newCreateApiKey,

    -- * Request Lenses
    createApiKey_customerId,
    createApiKey_description,
    createApiKey_enabled,
    createApiKey_generateDistinctId,
    createApiKey_name,
    createApiKey_stageKeys,
    createApiKey_tags,
    createApiKey_value,

    -- * Destructuring the Response
    ApiKey (..),
    newApiKey,

    -- * Response Lenses
    apiKey_createdDate,
    apiKey_customerId,
    apiKey_description,
    apiKey_enabled,
    apiKey_id,
    apiKey_lastUpdatedDate,
    apiKey_name,
    apiKey_stageKeys,
    apiKey_tags,
    apiKey_value,
  )
where

import Amazonka.APIGateway.Types
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

-- | Request to create an ApiKey resource.
--
-- /See:/ 'newCreateApiKey' smart constructor.
data CreateApiKey = CreateApiKey'
  { -- | An AWS Marketplace customer identifier , when integrating with the AWS
    -- SaaS Marketplace.
    CreateApiKey -> Maybe Text
customerId :: Prelude.Maybe Prelude.Text,
    -- | The description of the ApiKey.
    CreateApiKey -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether the ApiKey can be used by callers.
    CreateApiKey -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | Specifies whether (@true@) or not (@false@) the key identifier is
    -- distinct from the created API key value. This parameter is deprecated
    -- and should not be used.
    CreateApiKey -> Maybe Bool
generateDistinctId :: Prelude.Maybe Prelude.Bool,
    -- | The name of the ApiKey.
    CreateApiKey -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API
    -- key.
    CreateApiKey -> Maybe [StageKey]
stageKeys :: Prelude.Maybe [StageKey],
    -- | The key-value map of strings. The valid character set is
    -- [a-zA-Z+-=._:\/]. The tag key can be up to 128 characters and must not
    -- start with @aws:@. The tag value can be up to 256 characters.
    CreateApiKey -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Specifies a value of the API key.
    CreateApiKey -> Maybe Text
value :: Prelude.Maybe Prelude.Text
  }
  deriving (CreateApiKey -> CreateApiKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApiKey -> CreateApiKey -> Bool
$c/= :: CreateApiKey -> CreateApiKey -> Bool
== :: CreateApiKey -> CreateApiKey -> Bool
$c== :: CreateApiKey -> CreateApiKey -> Bool
Prelude.Eq, ReadPrec [CreateApiKey]
ReadPrec CreateApiKey
Int -> ReadS CreateApiKey
ReadS [CreateApiKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApiKey]
$creadListPrec :: ReadPrec [CreateApiKey]
readPrec :: ReadPrec CreateApiKey
$creadPrec :: ReadPrec CreateApiKey
readList :: ReadS [CreateApiKey]
$creadList :: ReadS [CreateApiKey]
readsPrec :: Int -> ReadS CreateApiKey
$creadsPrec :: Int -> ReadS CreateApiKey
Prelude.Read, Int -> CreateApiKey -> ShowS
[CreateApiKey] -> ShowS
CreateApiKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApiKey] -> ShowS
$cshowList :: [CreateApiKey] -> ShowS
show :: CreateApiKey -> String
$cshow :: CreateApiKey -> String
showsPrec :: Int -> CreateApiKey -> ShowS
$cshowsPrec :: Int -> CreateApiKey -> ShowS
Prelude.Show, forall x. Rep CreateApiKey x -> CreateApiKey
forall x. CreateApiKey -> Rep CreateApiKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateApiKey x -> CreateApiKey
$cfrom :: forall x. CreateApiKey -> Rep CreateApiKey x
Prelude.Generic)

-- |
-- Create a value of 'CreateApiKey' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'customerId', 'createApiKey_customerId' - An AWS Marketplace customer identifier , when integrating with the AWS
-- SaaS Marketplace.
--
-- 'description', 'createApiKey_description' - The description of the ApiKey.
--
-- 'enabled', 'createApiKey_enabled' - Specifies whether the ApiKey can be used by callers.
--
-- 'generateDistinctId', 'createApiKey_generateDistinctId' - Specifies whether (@true@) or not (@false@) the key identifier is
-- distinct from the created API key value. This parameter is deprecated
-- and should not be used.
--
-- 'name', 'createApiKey_name' - The name of the ApiKey.
--
-- 'stageKeys', 'createApiKey_stageKeys' - DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API
-- key.
--
-- 'tags', 'createApiKey_tags' - The key-value map of strings. The valid character set is
-- [a-zA-Z+-=._:\/]. The tag key can be up to 128 characters and must not
-- start with @aws:@. The tag value can be up to 256 characters.
--
-- 'value', 'createApiKey_value' - Specifies a value of the API key.
newCreateApiKey ::
  CreateApiKey
newCreateApiKey :: CreateApiKey
newCreateApiKey =
  CreateApiKey'
    { $sel:customerId:CreateApiKey' :: Maybe Text
customerId = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateApiKey' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:CreateApiKey' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:generateDistinctId:CreateApiKey' :: Maybe Bool
generateDistinctId = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateApiKey' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:stageKeys:CreateApiKey' :: Maybe [StageKey]
stageKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateApiKey' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:value:CreateApiKey' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
    }

-- | An AWS Marketplace customer identifier , when integrating with the AWS
-- SaaS Marketplace.
createApiKey_customerId :: Lens.Lens' CreateApiKey (Prelude.Maybe Prelude.Text)
createApiKey_customerId :: Lens' CreateApiKey (Maybe Text)
createApiKey_customerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe Text
customerId :: Maybe Text
$sel:customerId:CreateApiKey' :: CreateApiKey -> Maybe Text
customerId} -> Maybe Text
customerId) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe Text
a -> CreateApiKey
s {$sel:customerId:CreateApiKey' :: Maybe Text
customerId = Maybe Text
a} :: CreateApiKey)

-- | The description of the ApiKey.
createApiKey_description :: Lens.Lens' CreateApiKey (Prelude.Maybe Prelude.Text)
createApiKey_description :: Lens' CreateApiKey (Maybe Text)
createApiKey_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe Text
description :: Maybe Text
$sel:description:CreateApiKey' :: CreateApiKey -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe Text
a -> CreateApiKey
s {$sel:description:CreateApiKey' :: Maybe Text
description = Maybe Text
a} :: CreateApiKey)

-- | Specifies whether the ApiKey can be used by callers.
createApiKey_enabled :: Lens.Lens' CreateApiKey (Prelude.Maybe Prelude.Bool)
createApiKey_enabled :: Lens' CreateApiKey (Maybe Bool)
createApiKey_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:CreateApiKey' :: CreateApiKey -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe Bool
a -> CreateApiKey
s {$sel:enabled:CreateApiKey' :: Maybe Bool
enabled = Maybe Bool
a} :: CreateApiKey)

-- | Specifies whether (@true@) or not (@false@) the key identifier is
-- distinct from the created API key value. This parameter is deprecated
-- and should not be used.
createApiKey_generateDistinctId :: Lens.Lens' CreateApiKey (Prelude.Maybe Prelude.Bool)
createApiKey_generateDistinctId :: Lens' CreateApiKey (Maybe Bool)
createApiKey_generateDistinctId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe Bool
generateDistinctId :: Maybe Bool
$sel:generateDistinctId:CreateApiKey' :: CreateApiKey -> Maybe Bool
generateDistinctId} -> Maybe Bool
generateDistinctId) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe Bool
a -> CreateApiKey
s {$sel:generateDistinctId:CreateApiKey' :: Maybe Bool
generateDistinctId = Maybe Bool
a} :: CreateApiKey)

-- | The name of the ApiKey.
createApiKey_name :: Lens.Lens' CreateApiKey (Prelude.Maybe Prelude.Text)
createApiKey_name :: Lens' CreateApiKey (Maybe Text)
createApiKey_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe Text
name :: Maybe Text
$sel:name:CreateApiKey' :: CreateApiKey -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe Text
a -> CreateApiKey
s {$sel:name:CreateApiKey' :: Maybe Text
name = Maybe Text
a} :: CreateApiKey)

-- | DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API
-- key.
createApiKey_stageKeys :: Lens.Lens' CreateApiKey (Prelude.Maybe [StageKey])
createApiKey_stageKeys :: Lens' CreateApiKey (Maybe [StageKey])
createApiKey_stageKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe [StageKey]
stageKeys :: Maybe [StageKey]
$sel:stageKeys:CreateApiKey' :: CreateApiKey -> Maybe [StageKey]
stageKeys} -> Maybe [StageKey]
stageKeys) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe [StageKey]
a -> CreateApiKey
s {$sel:stageKeys:CreateApiKey' :: Maybe [StageKey]
stageKeys = Maybe [StageKey]
a} :: CreateApiKey) 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

-- | The key-value map of strings. The valid character set is
-- [a-zA-Z+-=._:\/]. The tag key can be up to 128 characters and must not
-- start with @aws:@. The tag value can be up to 256 characters.
createApiKey_tags :: Lens.Lens' CreateApiKey (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createApiKey_tags :: Lens' CreateApiKey (Maybe (HashMap Text Text))
createApiKey_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateApiKey' :: CreateApiKey -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe (HashMap Text Text)
a -> CreateApiKey
s {$sel:tags:CreateApiKey' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateApiKey) 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

-- | Specifies a value of the API key.
createApiKey_value :: Lens.Lens' CreateApiKey (Prelude.Maybe Prelude.Text)
createApiKey_value :: Lens' CreateApiKey (Maybe Text)
createApiKey_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApiKey' {Maybe Text
value :: Maybe Text
$sel:value:CreateApiKey' :: CreateApiKey -> Maybe Text
value} -> Maybe Text
value) (\s :: CreateApiKey
s@CreateApiKey' {} Maybe Text
a -> CreateApiKey
s {$sel:value:CreateApiKey' :: Maybe Text
value = Maybe Text
a} :: CreateApiKey)

instance Core.AWSRequest CreateApiKey where
  type AWSResponse CreateApiKey = ApiKey
  request :: (Service -> Service) -> CreateApiKey -> Request CreateApiKey
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 CreateApiKey
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApiKey)))
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 -> forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)

instance Prelude.Hashable CreateApiKey where
  hashWithSalt :: Int -> CreateApiKey -> Int
hashWithSalt Int
_salt CreateApiKey' {Maybe Bool
Maybe [StageKey]
Maybe Text
Maybe (HashMap Text Text)
value :: Maybe Text
tags :: Maybe (HashMap Text Text)
stageKeys :: Maybe [StageKey]
name :: Maybe Text
generateDistinctId :: Maybe Bool
enabled :: Maybe Bool
description :: Maybe Text
customerId :: Maybe Text
$sel:value:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:tags:CreateApiKey' :: CreateApiKey -> Maybe (HashMap Text Text)
$sel:stageKeys:CreateApiKey' :: CreateApiKey -> Maybe [StageKey]
$sel:name:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:generateDistinctId:CreateApiKey' :: CreateApiKey -> Maybe Bool
$sel:enabled:CreateApiKey' :: CreateApiKey -> Maybe Bool
$sel:description:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:customerId:CreateApiKey' :: CreateApiKey -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customerId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
generateDistinctId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [StageKey]
stageKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value

instance Prelude.NFData CreateApiKey where
  rnf :: CreateApiKey -> ()
rnf CreateApiKey' {Maybe Bool
Maybe [StageKey]
Maybe Text
Maybe (HashMap Text Text)
value :: Maybe Text
tags :: Maybe (HashMap Text Text)
stageKeys :: Maybe [StageKey]
name :: Maybe Text
generateDistinctId :: Maybe Bool
enabled :: Maybe Bool
description :: Maybe Text
customerId :: Maybe Text
$sel:value:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:tags:CreateApiKey' :: CreateApiKey -> Maybe (HashMap Text Text)
$sel:stageKeys:CreateApiKey' :: CreateApiKey -> Maybe [StageKey]
$sel:name:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:generateDistinctId:CreateApiKey' :: CreateApiKey -> Maybe Bool
$sel:enabled:CreateApiKey' :: CreateApiKey -> Maybe Bool
$sel:description:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:customerId:CreateApiKey' :: CreateApiKey -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
generateDistinctId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [StageKey]
stageKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value

instance Data.ToHeaders CreateApiKey where
  toHeaders :: CreateApiKey -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Data.ToJSON CreateApiKey where
  toJSON :: CreateApiKey -> Value
toJSON CreateApiKey' {Maybe Bool
Maybe [StageKey]
Maybe Text
Maybe (HashMap Text Text)
value :: Maybe Text
tags :: Maybe (HashMap Text Text)
stageKeys :: Maybe [StageKey]
name :: Maybe Text
generateDistinctId :: Maybe Bool
enabled :: Maybe Bool
description :: Maybe Text
customerId :: Maybe Text
$sel:value:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:tags:CreateApiKey' :: CreateApiKey -> Maybe (HashMap Text Text)
$sel:stageKeys:CreateApiKey' :: CreateApiKey -> Maybe [StageKey]
$sel:name:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:generateDistinctId:CreateApiKey' :: CreateApiKey -> Maybe Bool
$sel:enabled:CreateApiKey' :: CreateApiKey -> Maybe Bool
$sel:description:CreateApiKey' :: CreateApiKey -> Maybe Text
$sel:customerId:CreateApiKey' :: CreateApiKey -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"customerId" 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
customerId,
            (Key
"description" 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
description,
            (Key
"enabled" 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 Bool
enabled,
            (Key
"generateDistinctId" 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 Bool
generateDistinctId,
            (Key
"name" 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
name,
            (Key
"stageKeys" 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 [StageKey]
stageKeys,
            (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 (HashMap Text Text)
tags,
            (Key
"value" 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
value
          ]
      )

instance Data.ToPath CreateApiKey where
  toPath :: CreateApiKey -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/apikeys"

instance Data.ToQuery CreateApiKey where
  toQuery :: CreateApiKey -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty